Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/conflict.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variants.forEach(function({ fixture, mime }) {
cy.openFile(fileName)

cy.get('.text-editor .document-status')
.should('contain', 'Document has been changed outside of the editor.')
.should('contain', 'The file was overwritten.')
getWrapper()
.find('#read-only-editor')
.should('contain', 'Hello world')
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ describe('Sync', () => {
cy.intercept('**/apps/text/session/*/*', req => req.destroy()).as('dead')
cy.wait('@dead', { timeout: 30000 })
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('contain', 'Document could not be loaded.')
.should('contain', 'The document could not be loaded.')
cy.intercept('**/apps/text/session/*/*', req => req.continue()).as('alive')
cy.wait('@alive', { timeout: 30000 })
cy.intercept({ method: 'POST', url: '**/apps/text/session/*/sync' })
.as('syncAfterRecovery')
cy.wait('@syncAfterRecovery', { timeout: 30000 })
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('not.contain', 'Document could not be loaded.')
.should('not.contain', 'The 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.insertLine('* more content added after the lost connection')
Expand All @@ -73,13 +73,13 @@ describe('Sync', () => {
cy.intercept('**/apps/text/session/*/*', req => req.destroy()).as('dead')
cy.wait('@dead', { timeout: 30000 })
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('contain', 'Document could not be loaded.')
.should('contain', 'The document could not be loaded.')
cy.get('#editor-container .document-status')
.find('.button.primary').click()
cy.get('.toastify').should('contain', 'Connection failed.')
cy.get('.toastify', { timeout: 30000 }).should('not.exist')
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('contain', 'Document could not be loaded.')
.should('contain', 'The document could not be loaded.')
// bring back the network connection
cy.intercept('**/apps/text/session/*/*', req => { req.continue() }).as('alive')
cy.intercept('**/apps/text/session/*/create').as('create')
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('Sync', () => {

cy.wait('@sessionRequests', { timeout: 30000 })
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('contain', 'Document could not be loaded.')
.should('contain', 'The document could not be loaded.')

// Reconnect button works - it closes and reopens the session
cy.get('#editor-container .document-status a.button')
Expand All @@ -117,7 +117,7 @@ describe('Sync', () => {
cy.wait('@syncAfterRecovery', { timeout: 60000 })

cy.get('#editor-container .document-status', { timeout: 30000 })
.should('not.contain', 'Document could not be loaded.')
.should('not.contain', 'The 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.insertLine('* more content added after the lost connection')
Expand Down
10 changes: 6 additions & 4 deletions src/components/CollisionResolveDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ import {
useIsRichEditorMixin,
useSyncServiceMixin,
} from './Editor.provider.js'
import CloudIcon from 'vue-material-design-icons/Cloud.vue'
import PencilIcon from 'vue-material-design-icons/Pencil.vue'
import { NcButton } from '@nextcloud/vue'
import setContent from './../mixins/setContent.js'
export default {
name: 'CollisionResolveDialog',
components: {
NcButton,
PencilIcon,
CloudIcon,
},
mixins: [
useEditorMixin,
Expand Down Expand Up @@ -64,12 +68,10 @@ export default {
<style scoped lang="scss">
#resolve-conflicts {
display: flex;
width: 100%;
margin: auto;
padding: 20px 0;

padding: 0 var(--default-grid-baseline);
button {
margin: auto;
margin: 0 var(--default-grid-baseline) ;
}
}
</style>
1 change: 1 addition & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@reconnect="reconnect" />

<SkeletonLoading v-if="showLoadingSkeleton" />
<CollisionResolveDialog v-if="isResolvingConflict" :sync-error="syncError" />
<Wrapper v-if="displayed"
:is-resolving-conflict="isResolvingConflict"
:has-connection-issue="hasConnectionIssue"
Expand Down