From 9e2db00d53cca00164bcff2cc09467037f5c2ae7 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Tue, 30 Mar 2021 16:40:14 +0100 Subject: [PATCH] Merge pull request #3845 from overleaf/ho-upload-file-mark-updated mark project as updated when uploading/replacing files GitOrigin-RevId: 948a3351ac59d4f08411dd83bb543444de0b9b52 --- .../Features/Project/ProjectEntityUpdateHandler.js | 3 +++ .../src/Project/ProjectEntityUpdateHandlerTests.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/services/web/app/src/Features/Project/ProjectEntityUpdateHandler.js b/services/web/app/src/Features/Project/ProjectEntityUpdateHandler.js index b51fef4ae7..87ec1d20bd 100644 --- a/services/web/app/src/Features/Project/ProjectEntityUpdateHandler.js +++ b/services/web/app/src/Features/Project/ProjectEntityUpdateHandler.js @@ -533,6 +533,7 @@ const ProjectEntityUpdateHandler = { if (error != null) { return callback(error) } + ProjectUpdateHandler.markAsUpdated(projectId, new Date(), userId) callback(null, fileRef, folderId) } ) @@ -631,6 +632,8 @@ const ProjectEntityUpdateHandler = { if (err != null) { return callback(err) } + ProjectUpdateHandler.markAsUpdated(projectId, new Date(), userId) + DocumentUpdaterHandler.updateProjectStructure( projectId, projectHistoryId, diff --git a/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js b/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js index 4b4108b556..15c583f854 100644 --- a/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js @@ -651,6 +651,13 @@ describe('ProjectEntityUpdateHandler', function() { .should.equal(true) }) + it('should mark the project as updated', function() { + const args = this.ProjectUpdater.markAsUpdated.args[0] + args[0].should.equal(projectId) + args[1].should.exist + args[2].should.equal(userId) + }) + it('sends the change in project structure to the doc updater', function() { const newFiles = [ { @@ -769,6 +776,13 @@ describe('ProjectEntityUpdateHandler', function() { .should.equal(true) }) + it('should mark the project as updated', function() { + const args = this.ProjectUpdater.markAsUpdated.args[0] + args[0].should.equal(projectId) + args[1].should.exist + args[2].should.equal(userId) + }) + it('updates the project structure in the doc updater', function() { const oldFiles = [ {