mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Account for the new referencesSearch
flag when deciding to do fullIndex
This commit is contained in:
parent
8ea690a745
commit
43d00a2e5f
2 changed files with 12 additions and 1 deletions
|
@ -46,7 +46,8 @@ module.exports = ReferencesHandler =
|
||||||
_isFullIndex: (project, callback = (err, result) ->) ->
|
_isFullIndex: (project, callback = (err, result) ->) ->
|
||||||
UserGetter.getUser project.owner_ref, { features: true }, (err, owner) ->
|
UserGetter.getUser project.owner_ref, { features: true }, (err, owner) ->
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
callback(null, owner?.features?.references == true)
|
features = owner?.features
|
||||||
|
callback(null, features?.references == true || features?.referencesSearch == true)
|
||||||
|
|
||||||
indexAll: (projectId, callback=(err, data)->) ->
|
indexAll: (projectId, callback=(err, data)->) ->
|
||||||
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->
|
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->
|
||||||
|
|
|
@ -385,3 +385,13 @@ describe 'ReferencesHandler', ->
|
||||||
@call (err, isFullIndex) =>
|
@call (err, isFullIndex) =>
|
||||||
expect(err).to.equal null
|
expect(err).to.equal null
|
||||||
expect(isFullIndex).to.equal false
|
expect(isFullIndex).to.equal false
|
||||||
|
|
||||||
|
describe 'with referencesSearch', ->
|
||||||
|
|
||||||
|
beforeEach ->
|
||||||
|
@owner.features = {referencesSearch: true, references: false}
|
||||||
|
|
||||||
|
it 'should return true', ->
|
||||||
|
@call (err, isFullIndex) =>
|
||||||
|
expect(err).to.equal null
|
||||||
|
expect(isFullIndex).to.equal true
|
||||||
|
|
Loading…
Reference in a new issue