From e15a5d35e9d276020429fd58d77027742605c76d Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Fri, 16 Jun 2023 11:13:59 +0545 Subject: [PATCH 001/164] [tests-only] Make proper use of Promise.all (#9116) * make proper use of waitForResponse * refactor * check file after copy,move action --- .../app-admin-settings/groups/actions.ts | 4 ++-- .../app-admin-settings/users/actions.ts | 20 +++++++++---------- .../objects/app-files/resource/actions.ts | 14 +++++++------ .../objects/app-files/share/actions.ts | 4 ++-- .../objects/app-files/share/collaborator.ts | 9 +++++---- .../objects/app-files/spaces/actions.ts | 8 ++++---- .../support/objects/runtime/application.ts | 1 + 7 files changed, 32 insertions(+), 28 deletions(-) diff --git a/tests/e2e/support/objects/app-admin-settings/groups/actions.ts b/tests/e2e/support/objects/app-admin-settings/groups/actions.ts index 383add9d4f4..a599343eabc 100644 --- a/tests/e2e/support/objects/app-admin-settings/groups/actions.ts +++ b/tests/e2e/support/objects/app-admin-settings/groups/actions.ts @@ -72,7 +72,7 @@ export const deleteGroupUsingContextMenu = async (args: { resp.status() === 204 && resp.request().method() === 'DELETE' ), - await page.locator(actionConfirmButton).click() + page.locator(actionConfirmButton).click() ]) } @@ -114,7 +114,7 @@ export const changeGroup = async (args: { resp.status() === 204 && resp.request().method() === 'PATCH' ), - await page.locator(compareDialogConfirm).click() + page.locator(compareDialogConfirm).click() ]) } export const openEditPanel = async (args: { diff --git a/tests/e2e/support/objects/app-admin-settings/users/actions.ts b/tests/e2e/support/objects/app-admin-settings/users/actions.ts index d5c382af35a..79d8de8c698 100644 --- a/tests/e2e/support/objects/app-admin-settings/users/actions.ts +++ b/tests/e2e/support/objects/app-admin-settings/users/actions.ts @@ -91,7 +91,7 @@ export const changeAccountEnabled = async (args: { resp.status() === 200 && resp.request().method() === 'PATCH' ), - await page.locator(compareDialogConfirm).click() + page.locator(compareDialogConfirm).click() ]) } @@ -111,7 +111,7 @@ export const changeQuota = async (args: { resp.status() === 200 && resp.request().method() === 'PATCH' ), - await page.locator(compareDialogConfirm).click() + page.locator(compareDialogConfirm).click() ]) } @@ -200,7 +200,7 @@ export const addSelectedUsersToGroups = async (args: { } } - await Promise.all([...checkResponses, await page.locator(actionConfirmButton).click()]) + await Promise.all([...checkResponses, page.locator(actionConfirmButton).click()]) } export const removeSelectedUsersFromGroups = async (args: { @@ -237,7 +237,7 @@ export const removeSelectedUsersFromGroups = async (args: { } } - await Promise.all([...checkResponses, await page.locator(actionConfirmButton).click()]) + await Promise.all([...checkResponses, page.locator(actionConfirmButton).click()]) } export const filterUsers = async (args: { @@ -278,7 +278,7 @@ export const changeUser = async (args: { resp.status() === 201 && resp.request().method() === 'POST' ), - await page.locator(compareDialogConfirm).click() + page.locator(compareDialogConfirm).click() ]) } @@ -289,7 +289,7 @@ export const changeUser = async (args: { resp.status() === 200 && resp.request().method() === 'PATCH' ), - await page.locator(compareDialogConfirm).click() + page.locator(compareDialogConfirm).click() ]) } @@ -324,7 +324,7 @@ export const addUserToGroups = async (args: { ) } - await Promise.all([...checkResponses, await page.locator(compareDialogConfirm).click()]) + await Promise.all([...checkResponses, page.locator(compareDialogConfirm).click()]) } export const removeUserFromGroups = async (args: { @@ -355,7 +355,7 @@ export const removeUserFromGroups = async (args: { ) } - await Promise.all([...checkResponses, await page.locator(compareDialogConfirm).click()]) + await Promise.all([...checkResponses, page.locator(compareDialogConfirm).click()]) } export const openEditPanel = async (args: { @@ -396,7 +396,7 @@ export const deleteUserUsingContextMenu = async (args: { resp.status() === 204 && resp.request().method() === 'DELETE' ), - await page.locator(actionConfirmButton).click() + page.locator(actionConfirmButton).click() ]) } @@ -419,7 +419,7 @@ export const deleteUserUsingBatchAction = async (args: { ) } - await Promise.all([...checkResponses, await page.locator(actionConfirmButton).click()]) + await Promise.all([...checkResponses, page.locator(actionConfirmButton).click()]) } export const waitForEditPanelToBeVisible = async (args: { page: Page }): Promise => { diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 1eeb40e2c63..14656d3021b 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -556,8 +556,7 @@ export const moveOrCopyResource = async (args: moveOrCopyResourceArgs): Promise< resp.status() === 201 && resp.request().method() === (action === 'copy' ? 'COPY' : 'MOVE') ), - page.locator(util.format(resourceNameSelector, resource)), - await page.keyboard.press('Control+V') + page.keyboard.press('Control+V') ]) break } @@ -583,6 +582,10 @@ export const moveOrCopyResource = async (args: moveOrCopyResourceArgs): Promise< break } } + await waitForResources({ + page, + names: [resourceBase] + }) } /**/ @@ -617,7 +620,6 @@ export const renameResource = async (args: renameResourceArgs): Promise => resp.status() === 201 && resp.request().method() === 'MOVE' ), - page.locator(util.format(resourceNameSelector, newName)), page.locator(util.format(actionConfirmationButton, 'Rename')).click() ]) } @@ -642,7 +644,7 @@ export const restoreResourceVersion = async (args: resourceVersionArgs) => { (resp) => resp.url().includes('/v/') && resp.status() === 204 && resp.request().method() === 'COPY' ), - await page.locator(versionRevertButton).first().click() + page.locator(versionRevertButton).first().click() ]) } @@ -732,7 +734,7 @@ export const downloadResourceVersion = async ( resp.url().includes('/v/') && resp.status() === 200 && resp.request().method() === 'HEAD' ), page.waitForEvent('download'), - await page.locator('//*[@data-testid="file-versions-download-button"]').first().click() + page.locator('//*[@data-testid="file-versions-download-button"]').first().click() ]) await sidebar.close({ page: page }) downloads.push(download) @@ -830,7 +832,7 @@ export const restoreResourceTrashbin = async ( page.waitForResponse( (resp) => statuses.includes(resp.status()) && resp.request().method() === 'MOVE' ), - await page.locator(restoreResourceButton).click() + page.locator(restoreResourceButton).click() ]) const message = await page.locator(notificationMessageDialog).textContent() diff --git a/tests/e2e/support/objects/app-files/share/actions.ts b/tests/e2e/support/objects/app-files/share/actions.ts index b0eec844892..fdba860a005 100644 --- a/tests/e2e/support/objects/app-files/share/actions.ts +++ b/tests/e2e/support/objects/app-files/share/actions.ts @@ -146,13 +146,13 @@ export const changeShareeRole = async (args: ShareArgs): Promise => { for (const collaborator of recipients) { await Promise.all([ - Collaborator.changeCollaboratorRole({ page, collaborator }), page.waitForResponse( (resp) => resp.url().includes('shares') && resp.status() === 200 && resp.request().method() === 'PUT' - ) + ), + Collaborator.changeCollaboratorRole({ page, collaborator }) ]) } } diff --git a/tests/e2e/support/objects/app-files/share/collaborator.ts b/tests/e2e/support/objects/app-files/share/collaborator.ts index 4eeaf611529..0cc541b7218 100644 --- a/tests/e2e/support/objects/app-files/share/collaborator.ts +++ b/tests/e2e/support/objects/app-files/share/collaborator.ts @@ -243,6 +243,11 @@ export default class Collaborator { } = args const collaboratorRow = Collaborator.getCollaboratorUserOrGroupSelector(collaborator, type) + await page + .locator(util.format(Collaborator.collaboratorEditDropdownButton, collaboratorRow)) + .click() + await page.locator(util.format(Collaborator.removeCollaboratorButton, collaboratorRow)).click() + await Promise.all([ page.waitForResponse( (resp) => @@ -250,10 +255,6 @@ export default class Collaborator { resp.status() === 200 && resp.request().method() === 'DELETE' ), - page - .locator(util.format(Collaborator.collaboratorEditDropdownButton, collaboratorRow)) - .click(), - page.locator(util.format(Collaborator.removeCollaboratorButton, collaboratorRow)).click(), page.locator(Collaborator.removeCollaboratorConfirmationButton).click() ]) if (removeOwnSpaceAccess) { diff --git a/tests/e2e/support/objects/app-files/spaces/actions.ts b/tests/e2e/support/objects/app-files/spaces/actions.ts index 8f224b1d519..ecdb5fb6109 100644 --- a/tests/e2e/support/objects/app-files/spaces/actions.ts +++ b/tests/e2e/support/objects/app-files/spaces/actions.ts @@ -145,8 +145,8 @@ export const changeSpaceDescription = async (args: { }): Promise => { const { page, value } = args await openActionsPanel(page) - const waitForUpdate = async () => - await page.waitForResponse( + const waitForUpdate = () => + page.waitForResponse( (resp) => resp.url().endsWith('readme.md') && resp.status() === 200 && @@ -275,13 +275,13 @@ export const changeSpaceRole = async (args: SpaceMembersArgs): Promise => for (const collaborator of users) { await Promise.all([ - Collaborator.changeCollaboratorRole({ page, collaborator }), page.waitForResponse( (resp) => resp.url().includes('shares') && resp.status() === 200 && resp.request().method() === 'POST' - ) + ), + Collaborator.changeCollaboratorRole({ page, collaborator }) ]) } } diff --git a/tests/e2e/support/objects/runtime/application.ts b/tests/e2e/support/objects/runtime/application.ts index 684e3445350..c00edcec7c4 100644 --- a/tests/e2e/support/objects/runtime/application.ts +++ b/tests/e2e/support/objects/runtime/application.ts @@ -26,6 +26,7 @@ export class Application { } async getNotificationMessages(): Promise { + // wait for the notifications to load await this.#page.waitForResponse( (resp) => resp.url().endsWith('notifications?format=json') && From 078e6e40894340cf6589dadee50829fdd5c45c44 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi <41103328+SwikritiT@users.noreply.github.com> Date: Fri, 16 Jun 2023 11:18:45 +0545 Subject: [PATCH 002/164] Bump ocis commit id for tests (#9253) --- .drone.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.env b/.drone.env index f841f2e4418..bf258e745df 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=9e85bd8be7a424dc88148e21575807789403b79b +OCIS_COMMITID=8c414acfbd8c4a0544923f95a47a0632303b1001 OCIS_BRANCH=master From 70d16743c939cd59e2b3d489a528b698a1d12d59 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 16 Jun 2023 14:56:01 +0545 Subject: [PATCH 003/164] bump info.xml to 7.0.2 -- it still said 6.0.0 all the time since 6.0.0 (#9254) I've money-patched that for the release of tag v7.0.2 during the sign process. Co-authored-by: Juergen Weigert --- packages/web-integration-oc10/appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web-integration-oc10/appinfo/info.xml b/packages/web-integration-oc10/appinfo/info.xml index b6095de76d6..c85cd9c3b01 100644 --- a/packages/web-integration-oc10/appinfo/info.xml +++ b/packages/web-integration-oc10/appinfo/info.xml @@ -15,7 +15,7 @@ For feedback and bug reports, please use the [public issue tracker](https://gith AGPL ownCloud - 6.0.0 + 7.0.2 tools https://github.com/owncloud/web https://github.com/owncloud/web/issues From 2dc80f6b1dde0a09516ddc7d6731a63b52de05b9 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi <41103328+SwikritiT@users.noreply.github.com> Date: Tue, 20 Jun 2023 15:23:21 +0545 Subject: [PATCH 004/164] Bump ocis commit id for tests (#9277) --- .drone.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.env b/.drone.env index bf258e745df..8d8d4c64d0f 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=8c414acfbd8c4a0544923f95a47a0632303b1001 +OCIS_COMMITID=938a2a006f8e3a308d3f99e7d2142ef2e4c83237 OCIS_BRANCH=master From 5da9ccda571df4601e7cd865c0aa9220919b16d1 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Fri, 23 Jun 2023 10:06:53 +0545 Subject: [PATCH 005/164] Bump ocis commit id for tests --- .drone.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.env b/.drone.env index 8d8d4c64d0f..96a0fa10888 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=938a2a006f8e3a308d3f99e7d2142ef2e4c83237 +OCIS_COMMITID=2ea3b8c400688b14ef328786b3af445c2edbbe18 OCIS_BRANCH=master From 5a46341beb31523aa59119c71e2e1be030a751fe Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Fri, 23 Jun 2023 14:59:37 +0200 Subject: [PATCH 006/164] [full-ci] Access denied page change message / load common theme (#9263) * Load common theme into store * Implement url in access denied page * Fix add return * Add changelog * Update/add unittests * Update config.spec.ts * Fix typo * Rename accessDeniedHelpUrl * Fix acceptance tests, remove dev leftover * Rename more to readmore --- ...ancement-access-denied-page-change-message | 6 ++++ .../web-runtime/src/container/bootstrap.ts | 6 ++-- packages/web-runtime/src/helpers/theme.ts | 4 +-- .../web-runtime/src/pages/accessDenied.vue | 24 +++++++++++++-- packages/web-runtime/src/store/config.ts | 15 ++++++++-- .../tests/unit/helpers/theme.spec.ts | 29 +++++++++++-------- .../tests/unit/store/config.spec.ts | 10 +++---- .../web-runtime/themes/owncloud/theme.json | 6 ++-- .../acceptance/pageObjects/loginErrorPage.js | 2 +- 9 files changed, 71 insertions(+), 31 deletions(-) create mode 100644 changelog/unreleased/enhancement-access-denied-page-change-message diff --git a/changelog/unreleased/enhancement-access-denied-page-change-message b/changelog/unreleased/enhancement-access-denied-page-change-message new file mode 100644 index 00000000000..ed7fda36c67 --- /dev/null +++ b/changelog/unreleased/enhancement-access-denied-page-change-message @@ -0,0 +1,6 @@ +Enhancement: Access denied page update message + +We've updated the access denied page message to be more specific and give the user a link to a help page. + +https://github.com/owncloud/web/pull/9263 +https://github.com/owncloud/web/issues/9051 diff --git a/packages/web-runtime/src/container/bootstrap.ts b/packages/web-runtime/src/container/bootstrap.ts index fffc60f5879..e5ca501e831 100644 --- a/packages/web-runtime/src/container/bootstrap.ts +++ b/packages/web-runtime/src/container/bootstrap.ts @@ -217,13 +217,13 @@ export const announceTheme = async ({ designSystem: any runtimeConfiguration?: RuntimeConfiguration }): Promise => { - const { theme } = await loadTheme(runtimeConfiguration?.theme) - await store.dispatch('loadThemes', { theme }) + const { web, common } = await loadTheme(runtimeConfiguration?.theme) + await store.dispatch('loadThemes', { theme: web, common }) const currentThemeName = useLocalStorage('oc_currentThemeName', null) // note: use null as default so that we can fall back to system preferences if (unref(currentThemeName) === null) { currentThemeName.value = useDefaultThemeName() } - await store.dispatch('loadTheme', { theme: theme[unref(currentThemeName)] || theme.default }) + await store.dispatch('loadTheme', { theme: web[unref(currentThemeName)] || web.default }) app.use(designSystem, { tokens: store.getters.theme.designTokens diff --git a/packages/web-runtime/src/helpers/theme.ts b/packages/web-runtime/src/helpers/theme.ts index 7ff062c2fb3..1595b98fd35 100644 --- a/packages/web-runtime/src/helpers/theme.ts +++ b/packages/web-runtime/src/helpers/theme.ts @@ -3,7 +3,7 @@ import defaultTheme from '../../themes/owncloud/theme.json' import { v4 as uuidV4 } from 'uuid' export const loadTheme = async (location = '') => { - const defaults = { theme: defaultTheme.web || defaultTheme } + const defaults = { web: defaultTheme.web || defaultTheme, common: defaultTheme.common || {} } if (location.split('.').pop() !== 'json') { if (isEqual(process.env.NODE_ENV, 'development')) { @@ -18,7 +18,7 @@ export const loadTheme = async (location = '') => { return defaults } const theme = await response.json() - return { theme: theme.web || theme } + return { web: theme.web || theme, common: theme.common || {} } } catch (e) { console.error( `Failed to load theme '${location}' is not a valid json file, using default theme.` diff --git a/packages/web-runtime/src/pages/accessDenied.vue b/packages/web-runtime/src/pages/accessDenied.vue index 00a843c7d38..d3c162999e5 100644 --- a/packages/web-runtime/src/pages/accessDenied.vue +++ b/packages/web-runtime/src/pages/accessDenied.vue @@ -5,6 +5,14 @@