diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index e067d7f9e7..3b2099f923 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -19,7 +19,7 @@ fs = require "fs" InactiveProjectManager = require("../InactiveData/InactiveProjectManager") ProjectUpdateHandler = require("./ProjectUpdateHandler") ProjectGetter = require("./ProjectGetter") -OlProjectGetter = require("./OlProjectGetter") +V1ProjectGetter = require("./V1ProjectGetter") PrivilegeLevels = require("../Authorization/PrivilegeLevels") AuthenticationController = require("../Authentication/AuthenticationController") PackageVersions = require("../../infrastructure/PackageVersions") @@ -153,7 +153,7 @@ module.exports = ProjectController = projects: (cb)-> ProjectGetter.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel archived owner_ref tokens', cb v1Projects: (cb) -> - OlProjectGetter.findAllUsersProjects user_id, cb + V1ProjectGetter.findAllUsersProjects user_id, cb hasSubscription: (cb)-> LimitationsManager.userHasSubscriptionOrIsGroupMember currentUser, cb user: (cb) -> @@ -398,7 +398,7 @@ module.exports = ProjectController = showLinkSharingOnboarding: showLinkSharingOnboarding timer.done() - _buildProjectList: (allProjects, olProjects = [])-> + _buildProjectList: (allProjects, v1Projects = [])-> {owned, readAndWrite, readOnly, tokenReadAndWrite, tokenReadOnly} = allProjects projects = [] for project in owned @@ -408,8 +408,8 @@ module.exports = ProjectController = projects.push ProjectController._buildProjectViewModel(project, "readWrite", Sources.INVITE) for project in readOnly projects.push ProjectController._buildProjectViewModel(project, "readOnly", Sources.INVITE) - for project in olProjects - projects.push ProjectController._buildOlProjectViwModel(project) + for project in v1Projects + projects.push ProjectController._buildV1ProjectViewModel(project) # Token-access # Only add these projects if they're not already present, this gives us cascading access # from 'owner' => 'token-read-only' @@ -438,7 +438,7 @@ module.exports = ProjectController = } return model - _buildOlProjectViewModel: (project) -> + _buildV1ProjectViewModel: (project) -> { id: project.id name: project.title diff --git a/services/web/app/coffee/Features/Project/OlProjectGetter.coffee b/services/web/app/coffee/Features/Project/V1ProjectGetter.coffee similarity index 90% rename from services/web/app/coffee/Features/Project/OlProjectGetter.coffee rename to services/web/app/coffee/Features/Project/V1ProjectGetter.coffee index ab3187a636..ca957e2804 100644 --- a/services/web/app/coffee/Features/Project/OlProjectGetter.coffee +++ b/services/web/app/coffee/Features/Project/V1ProjectGetter.coffee @@ -4,7 +4,7 @@ logger = require 'logger-sharelatex' INTEGRATION_MODULE_PATH = path.resolve(__dirname, '../../../../modules/overleaf-integration-web-module') -module.exports = OlProjectGetter = +module.exports = V1ProjectGetter = integrationModuleExists: (callback = (error, stats) ->) -> fs.stat INTEGRATION_MODULE_PATH, (error, stats) -> if error? or !stats.isDirectory() @@ -12,7 +12,7 @@ module.exports = OlProjectGetter = return callback(true) findAllUsersProjects: (userId, callback = (error, projects) ->) -> - OlProjectGetter.integrationModuleExists (exists) -> + V1ProjectGetter.integrationModuleExists (exists) -> if exists logger.log {exists}, "integration module does exist, loading V1 projects" V1ProjectListGetter = require(path.join(INTEGRATION_MODULE_PATH, 'app/coffee/ProjectList/ProjectListGetter'))