diff --git a/changelog/unreleased/enhancement-user-menu-move-quota-info-to-general-info b/changelog/unreleased/enhancement-user-menu-move-quota-info-to-general-info new file mode 100644 index 00000000000..ba37fe3603e --- /dev/null +++ b/changelog/unreleased/enhancement-user-menu-move-quota-info-to-general-info @@ -0,0 +1,6 @@ +Enhancement: Move quota info to general info in user menu + +We've moved the quota information out of its own section in the user menu and into the general information section. +This change makes it easier to find and understand the quota information. + +https://github.com/owncloud/web/pull/11279 diff --git a/packages/web-runtime/src/components/Topbar/UserMenu.vue b/packages/web-runtime/src/components/Topbar/UserMenu.vue index 0fc9d5aba9a..a5ea4094607 100644 --- a/packages/web-runtime/src/components/Topbar/UserMenu.vue +++ b/packages/web-runtime/src/components/Topbar/UserMenu.vue @@ -70,6 +70,24 @@ +
+ +
+

+ +

+ +
+
  • @@ -83,25 +101,6 @@
  • -
  • - -
    -

    - - -

    - -
    -
  • @@ -183,21 +182,14 @@ export default defineComponent({ onPremisesSamAccountName() { return this.user?.onPremisesSamAccountName }, - personalStorageLabel() { - if (!this.limitedPersonalStorage) { - return this.$gettext('Personal storage') - } - return this.$gettext('Personal storage (%{percentage}% used)', { - percentage: (this.quotaUsagePercent || 0).toString() - }) - }, personalStorageDetailsLabel() { const total = this.quota.total || 0 const used = this.quota.used || 0 return total - ? this.$gettext('%{used} of %{total} used', { + ? this.$gettext('%{used} of %{total} used (%{percentage}%)', { used: filesize(used), - total: filesize(total) + total: filesize(total), + percentage: (this.quotaUsagePercent || 0).toString() }) : this.$gettext('%{used} used', { used: filesize(used), diff --git a/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/UserMenu.spec.ts.snap b/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/UserMenu.spec.ts.snap index e56fedf1ce5..d867135f6f6 100644 --- a/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/UserMenu.spec.ts.snap +++ b/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/UserMenu.spec.ts.snap @@ -8,14 +8,14 @@ exports[`User Menu component > when no quota and email is set > the user menu do
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
  • Preferences
  • -
  • Log out @@ -36,6 +36,7 @@ exports[`User Menu component > when no quota and no email is set > the user menu
  • Albert Einstein +
  • @@ -43,7 +44,6 @@ exports[`User Menu component > when no quota and no email is set > the user menu Preferences
  • -
  • Log out @@ -64,20 +64,20 @@ exports[`User Menu component > when quota and no email is set > renders a naviga
  • Albert Einstein - + +
    + +
    +

    300 B of 1 kB used (30%)

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage (30% used) 300 B of 1 kB used

    - -
    -
  • Log out @@ -97,20 +97,20 @@ exports[`User Menu component > when quota is above 80% and below 90% > renders a
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
    + +
    +

    810 B of 1 kB used (81%)

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage (81% used) 810 B of 1 kB used

    - -
    -
  • Log out @@ -130,20 +130,20 @@ exports[`User Menu component > when quota is above 90% > renders a danger quota
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
    + +
    +

    910 B of 1 kB used (91%)

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage (91% used) 910 B of 1 kB used

    - -
    -
  • Log out @@ -163,20 +163,20 @@ exports[`User Menu component > when quota is below 80% > renders a primary quota
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
    + +
    +

    300 B of 1 kB used (30%)

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage (30% used) 300 B of 1 kB used

    - -
    -
  • Log out @@ -196,20 +196,20 @@ exports[`User Menu component > when quota is not defined > renders no percentag
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
    + +
    +

    910 B used

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage 910 B used

    - -
    -
  • Log out @@ -229,20 +229,20 @@ exports[`User Menu component > when quota is unlimited > renders no percentag of
  • - Albert Einstein test@test.de + Albert Einstein test@test.de +
    + +
    +

    300 B used

    + +
    +
  • Preferences
  • -
  • - -
    -

    Personal storage 300 B used

    - -
    -
  • Log out diff --git a/tests/e2e/support/objects/account/actions.ts b/tests/e2e/support/objects/account/actions.ts index 1caa2ccb0d0..29bfdc98ecd 100644 --- a/tests/e2e/support/objects/account/actions.ts +++ b/tests/e2e/support/objects/account/actions.ts @@ -21,8 +21,7 @@ export const getQuotaValue = async (args: { page: Page }): Promise => { await page.locator(quotaValue).click() // parse "0 B of 10 GB used" - const value = quotaText.split('of') - return value[1].replace(/[^0-9]/g, '') + return quotaText.match(/\d+/g)?.[1] } export const getUserInfo = async (args: { page: Page; key: string }): Promise => {