remove inline requires from ProjectEntityHandler

This commit is contained in:
Hayden Faulds 2017-11-14 16:52:53 +00:00
parent ef68c6a531
commit acda4c2295

View file

@ -16,7 +16,7 @@ projectUpdateHandler = require('./ProjectUpdateHandler')
DocstoreManager = require "../Docstore/DocstoreManager"
ProjectGetter = require "./ProjectGetter"
CooldownManager = require '../Cooldown/CooldownManager'
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
module.exports = ProjectEntityHandler =
getAllFolders: (project_id, callback) ->
@ -106,7 +106,6 @@ module.exports = ProjectEntityHandler =
flushProjectToThirdPartyDataStore: (project_id, callback) ->
self = @
logger.log project_id:project_id, "flushing project to tpds"
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
documentUpdaterHandler.flushProjectToMongo project_id, (error) ->
return callback(error) if error?
ProjectGetter.getProject project_id, {name:true}, (error, project) ->
@ -181,7 +180,6 @@ module.exports = ProjectEntityHandler =
doc: doc
path: result?.path?.fileSystem
docLines: docLines.join('\n')
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
documentUpdaterHandler.updateProjectStructure project_id, null, [], [newDoc], [], [], (error) ->
return callback(error) if error?
callback null, doc, folder_id
@ -220,7 +218,6 @@ module.exports = ProjectEntityHandler =
file: fileRef
path: result?.path?.fileSystem
url: fileStoreUrl
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
documentUpdaterHandler.updateProjectStructure project_id, userId, [], [], [], [newFile], (error) ->
return callback(error) if error?
callback null, fileRef, folder_id
@ -398,7 +395,6 @@ module.exports = ProjectEntityHandler =
self.getAllEntitiesFromProject newProject, (error, newDocs, newFiles
) =>
return callback(error) if error?
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
documentUpdaterHandler.updateProjectStructure project_id, userId, oldDocs, newDocs, oldFiles, newFiles, callback
_checkValidMove: (project, entityType, entityPath, destFolderId, callback = (error) ->) ->
@ -456,7 +452,6 @@ module.exports = ProjectEntityHandler =
return callback(error) if error?
ProjectEntityHandler.getAllEntitiesFromProject newProject, (error, newDocs, newFiles) =>
return callback(error) if error?
documentUpdaterHandler = require('../../Features/DocumentUpdater/DocumentUpdaterHandler')
documentUpdaterHandler.updateProjectStructure project_id, userId, oldDocs, newDocs, oldFiles, newFiles, callback
_cleanUpEntity: (project, entity, entityType, callback = (error) ->) ->
@ -480,7 +475,7 @@ module.exports = ProjectEntityHandler =
unsetRootDocIfRequired (error) ->
return callback(error) if error?
require('../../Features/DocumentUpdater/DocumentUpdaterHandler').deleteDoc project_id, doc_id, (error) ->
documentUpdaterHandler.deleteDoc project_id, doc_id, (error) ->
return callback(error) if error?
ProjectEntityHandler._insertDeletedDocReference project._id, doc, (error) ->
return callback(error) if error?