mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 12:53:34 -05:00
Merge pull request #234 from sharelatex/hof-remove-unused-method
remove unused EditorController.getListOfDocPaths
This commit is contained in:
commit
859e03cd4f
2 changed files with 0 additions and 21 deletions
|
@ -126,12 +126,6 @@ module.exports = EditorController =
|
||||||
if callback?
|
if callback?
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
getListOfDocPaths: (project_id, callback)->
|
|
||||||
ProjectEntityHandler.getAllDocs project_id, (err, docs)->
|
|
||||||
docList = _.map docs, (doc, path)->
|
|
||||||
return {_id:doc._id, path:path.substring(1)}
|
|
||||||
callback(null, docList)
|
|
||||||
|
|
||||||
notifyUsersProjectHasBeenDeletedOrRenamed: (project_id, callback)->
|
notifyUsersProjectHasBeenDeletedOrRenamed: (project_id, callback)->
|
||||||
EditorRealTimeController.emitToRoom(project_id, 'projectRenamedOrDeletedByExternalSource')
|
EditorRealTimeController.emitToRoom(project_id, 'projectRenamedOrDeletedByExternalSource')
|
||||||
callback()
|
callback()
|
||||||
|
|
|
@ -424,21 +424,6 @@ describe "EditorController", ->
|
||||||
.calledWith(@project_id, "removeEntity", @entity_id, @source)
|
.calledWith(@project_id, "removeEntity", @entity_id, @source)
|
||||||
.should.equal true
|
.should.equal true
|
||||||
|
|
||||||
describe "getting a list of project paths", ->
|
|
||||||
|
|
||||||
it 'should call the project entity handler to get an array of docs', (done)->
|
|
||||||
fullDocsHash =
|
|
||||||
"/doc1.tex":{lines:["das"], _id:"1234"}
|
|
||||||
"/doc2.tex":{lines:["dshajkh"]}
|
|
||||||
project_id = "d312nkjnajn"
|
|
||||||
@ProjectEntityHandler.getAllDocs = sinon.stub().callsArgWith(1, null, fullDocsHash)
|
|
||||||
@EditorController.getListOfDocPaths project_id, (err, returnedDocs)->
|
|
||||||
returnedDocs.length.should.equal 2
|
|
||||||
returnedDocs[0]._id.should.equal "1234"
|
|
||||||
assert.equal returnedDocs[0].lines, undefined
|
|
||||||
returnedDocs[1].path.should.equal "doc2.tex"
|
|
||||||
done()
|
|
||||||
|
|
||||||
describe "notifyUsersProjectHasBeenDeletedOrRenamed", ->
|
describe "notifyUsersProjectHasBeenDeletedOrRenamed", ->
|
||||||
it 'should emmit a message to all users in a project', (done)->
|
it 'should emmit a message to all users in a project', (done)->
|
||||||
@EditorRealTimeController.emitToRoom = sinon.stub()
|
@EditorRealTimeController.emitToRoom = sinon.stub()
|
||||||
|
|
Loading…
Reference in a new issue