Skip to content
Merged
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
31 changes: 24 additions & 7 deletions cypress/e2e/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@ describe('Nextcloud integration', function() {
it('Open locally', function() {
cy.get('@loleafletframe').within(() => {
cy.get('.notebookbar-shortcuts-bar', { timeout: 30_000 })
.should('be.visible')
.as('shortcuts-bar')

cy.get('@shortcuts-bar').should('be.visible')

cy.get('button[aria-label="Open in local editor"]').click()
cy.get('@shortcuts-bar')
.find('button[aria-label="Open in local editor"]')
.click()
})

cy.get('.confirmation-dialog').should('be.visible')
Expand All @@ -126,11 +130,24 @@ describe('Nextcloud integration', function() {
cy.get('@open').its('firstCall.args.0').should('contain', 'nc://open/' + randUser.userId + '@' + nextcloudHost + '/document.odt')
})

it('Insert image', function() {
// TODO: Unskip once there is a viable nightly Docker container
// available to the workflows
it.skip('Insert image', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#Insert-tab-label').click()
cy.get('#insert-insert-graphic-button').click()
cy.get('#insert-insert-graphic-entries #insert-insert-graphic-entry-1').click()
cy.get('.notebookbar-tabs-container')
.get('button[aria-label="Insert"]')
.filter('[role="tab"]')
.click()

cy.get('#overflow-button-insert-illustrations')
.find('button[aria-label="Open Illustrations"]')
.click()

cy.get('#insert-insert-graphic')
.find('button[aria-label="Image"]')
.click()

cy.get('#insert-insert-graphic-entry-1').click()
})
cy.get('.modal-container__content').should('be.visible')
})
Expand Down Expand Up @@ -180,4 +197,4 @@ describe('Nextcloud integration', function() {
})
})
})
})
})
21 changes: 11 additions & 10 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,6 @@ export default {
this.loading = LOADING_STATE.DOCUMENT_READY
clearTimeout(this.loadingTimeout)
this.sendPostMessage('Host_PostmessageReady')
if (loadState('richdocuments', 'open_local_editor', true) && !this.isEmbedded) {
this.sendPostMessage('Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),
mobile: false,
label: t('richdocuments', 'Open in local editor'),
hint: t('richdocuments', 'Open in local editor'),
insertBefore: 'print',
})
}
},
async share() {
FilesAppIntegration.share()
Expand Down Expand Up @@ -394,6 +384,17 @@ export default {
FilesAppIntegration.initAfterReady()
} else if (args.Status === 'Document_Loaded') {
this.documentReady()

if (loadState('richdocuments', 'open_local_editor', true) && !this.isEmbedded) {
this.sendPostMessage('Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),
mobile: false,
label: t('richdocuments', 'Open in local editor'),
hint: t('richdocuments', 'Open in local editor'),
insertBefore: 'print',
})
}
} else if (args.Status === 'Failed') {
this.loading = LOADING_STATE.FAILED
this.$emit('update:loaded', true)
Expand Down
Loading