From bd9346e3fdb13e4f585cd4a7d14e2f1055a8ad82 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 18 Mar 2024 19:58:16 +0100 Subject: [PATCH] fix(DocumentStatus): Refactor and migrate to `NcNoteCard` Fixes: #4905 Signed-off-by: Jonas --- cypress/e2e/conflict.spec.js | 3 +- cypress/e2e/sync.spec.js | 8 +-- src/components/Editor/DocumentStatus.vue | 85 +++++++++++------------- 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/cypress/e2e/conflict.spec.js b/cypress/e2e/conflict.spec.js index 9e5021dc6c1..1396f6f9bef 100644 --- a/cypress/e2e/conflict.spec.js +++ b/cypress/e2e/conflict.spec.js @@ -54,7 +54,8 @@ variants.forEach(function({ fixture, mime }) { cy.get('#viewer .modal-header button.header-close').click() cy.get('#viewer').should('not.exist') cy.openFile(fileName) - cy.get('.text-editor .document-status .icon-error') + cy.get('.text-editor .document-status') + .should('contain', 'Document has been changed outside of the editor.') getWrapper() .find('#read-only-editor') .should('contain', 'Hello world') diff --git a/cypress/e2e/sync.spec.js b/cypress/e2e/sync.spec.js index 01a68ab7035..582157cff3a 100644 --- a/cypress/e2e/sync.spec.js +++ b/cypress/e2e/sync.spec.js @@ -74,7 +74,7 @@ describe('Sync', () => { }).as('sessionRequests') cy.wait('@dead', { timeout: 30000 }) cy.get('#editor-container .document-status', { timeout: 30000 }) - .should('contain', 'File could not be loaded') + .should('contain', 'Document could not be loaded.') .then(() => { reconnect = true }) @@ -83,7 +83,7 @@ describe('Sync', () => { .as('syncAfterRecovery') cy.wait('@syncAfterRecovery', { timeout: 30000 }) cy.get('#editor-container .document-status', { timeout: 30000 }) - .should('not.contain', 'File could not be loaded') + .should('not.contain', 'Document could not be loaded.') // FIXME: There seems to be a bug where typed words maybe lost if not waiting for the new session cy.wait('@syncAfterRecovery', { timeout: 10000 }) cy.getContent().type('* more content added after the lost connection{enter}') @@ -109,12 +109,12 @@ describe('Sync', () => { cy.wait('@sessionRequests', { timeout: 30000 }) cy.get('#editor-container .document-status', { timeout: 30000 }) - .should('contain', 'File could not be loaded') + .should('contain', 'Document could not be loaded.') cy.wait('@syncAfterRecovery', { timeout: 60000 }) cy.get('#editor-container .document-status', { timeout: 30000 }) - .should('not.contain', 'File could not be loaded') + .should('not.contain', 'Document could not be loaded.') // FIXME: There seems to be a bug where typed words maybe lost if not waiting for the new session cy.wait('@syncAfterRecovery', { timeout: 10000 }) cy.getContent().type('* more content added after the lost connection{enter}') diff --git a/src/components/Editor/DocumentStatus.vue b/src/components/Editor/DocumentStatus.vue index 3782b765197..014ac7a25ee 100644 --- a/src/components/Editor/DocumentStatus.vue +++ b/src/components/Editor/DocumentStatus.vue @@ -22,27 +22,34 @@