Просмотр исходного кода

Merge pull request #234 from sharelatex/hof-remove-unused-method

remove unused EditorController.getListOfDocPaths
Timothée Alby 8 лет назад
Родитель
Сommit
859e03cd4f

+ 0 - 6
services/web/app/coffee/Features/Editor/EditorController.coffee

@@ -126,12 +126,6 @@ module.exports = EditorController =
 			if 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)->
 		EditorRealTimeController.emitToRoom(project_id, 'projectRenamedOrDeletedByExternalSource')
 		callback()

+ 0 - 15
services/web/test/unit/coffee/Editor/EditorControllerTests.coffee

@@ -424,21 +424,6 @@ describe "EditorController", ->
 				.calledWith(@project_id, "removeEntity", @entity_id, @source)
 				.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", ->
 		it 'should emmit a message to all users in a project', (done)->
 			@EditorRealTimeController.emitToRoom = sinon.stub()