mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 02:13:56 +00:00
Merge pull request #562 from sharelatex/sk-fix-references-full-index
Account for the new `referencesSearch` flag in full-index decision
This commit is contained in:
commit
607bd3f6a5
2 changed files with 12 additions and 1 deletions
|
@ -46,7 +46,8 @@ module.exports = ReferencesHandler =
|
|||
_isFullIndex: (project, callback = (err, result) ->) ->
|
||||
UserGetter.getUser project.owner_ref, { features: true }, (err, owner) ->
|
||||
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)->) ->
|
||||
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->
|
||||
|
|
|
@ -385,3 +385,13 @@ describe 'ReferencesHandler', ->
|
|||
@call (err, isFullIndex) =>
|
||||
expect(err).to.equal null
|
||||
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