From eed200dd39616ed462271316a974cc5aa8a80032 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 11:13:09 +0100 Subject: [PATCH 1/8] Improve user details panel --- .../src/components/Users/SideBar/DetailsPanel.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index 1730f9fe3a8..74bcc8644ad 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -19,7 +19,7 @@ - + @@ -34,6 +34,12 @@ + + + + + + @@ -81,6 +87,9 @@ export default defineComponent({ return this.$gettext( this.roles.find((role) => role.id === assignedRole.appRoleId)?.displayName || '' ) + }, + groupsDisplayValue() { + return this.user.memberOf.map((group) => group.displayName).sort().join(', ') } } }) From 40502a986e50c089fae9b220c9f60942914ebe91 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 11:34:31 +0100 Subject: [PATCH 2/8] Add changelog item --- ...nt-admin-settings-user-details-improvement | 5 +++++ .../components/Users/SideBar/DetailsPanel.vue | 21 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/enhancement-admin-settings-user-details-improvement diff --git a/changelog/unreleased/enhancement-admin-settings-user-details-improvement b/changelog/unreleased/enhancement-admin-settings-user-details-improvement new file mode 100644 index 00000000000..3e93f5950a2 --- /dev/null +++ b/changelog/unreleased/enhancement-admin-settings-user-details-improvement @@ -0,0 +1,5 @@ +Enhancement: Admin settings users section details improvement + +We've switched improved the details panel in the user's section to show the assigned groups and total quota + +https://github.com/owncloud/web/pull/8331 diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index 74bcc8644ad..83d21a94e4e 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -34,6 +34,12 @@ + + + + + + @@ -49,6 +55,7 @@ import { defineComponent } from 'vue' import UserInfoBox from './UserInfoBox.vue' import { PropType } from 'vue' import { User } from 'web-client/src/generated' +import filesize from 'filesize' export default defineComponent({ name: 'DetailsPanel', @@ -89,7 +96,19 @@ export default defineComponent({ ) }, groupsDisplayValue() { - return this.user.memberOf.map((group) => group.displayName).sort().join(', ') + return this.user.memberOf + .map((group) => group.displayName) + .sort() + .join(', ') + }, + quotaDisplayValue() { + if (!('total' in (this.user.drive?.quota || {}))) { + return this.$gettext('Not set') + } + + return this.user.drive.quota.total === 0 + ? this.$gettext('No restriction') + : filesize(this.user.drive.quota.total) } } }) From 009da1f5862320e8da24901c798abc62b797b1ae Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 11:43:17 +0100 Subject: [PATCH 3/8] typo --- .../enhancement-admin-settings-user-details-improvement | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/enhancement-admin-settings-user-details-improvement b/changelog/unreleased/enhancement-admin-settings-user-details-improvement index 3e93f5950a2..95fb0f9c0f8 100644 --- a/changelog/unreleased/enhancement-admin-settings-user-details-improvement +++ b/changelog/unreleased/enhancement-admin-settings-user-details-improvement @@ -1,5 +1,5 @@ Enhancement: Admin settings users section details improvement -We've switched improved the details panel in the user's section to show the assigned groups and total quota +We've improved the details panel in the user's section to show the assigned groups and total quota https://github.com/owncloud/web/pull/8331 From fade23e8f4f2d1b15cdaf89f3c2abc4736c9ba88 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 12:38:43 +0100 Subject: [PATCH 4/8] use formatFileSize helper --- .../src/components/Users/SideBar/DetailsPanel.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index 83d21a94e4e..e590dd5d4de 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -55,7 +55,9 @@ import { defineComponent } from 'vue' import UserInfoBox from './UserInfoBox.vue' import { PropType } from 'vue' import { User } from 'web-client/src/generated' -import filesize from 'filesize' +import { formatFileSize } from 'web-pkg/src/helpers' +import user from 'web-runtime/src/store/user' +import { useGettext } from 'vue3-gettext' export default defineComponent({ name: 'DetailsPanel', @@ -76,6 +78,13 @@ export default defineComponent({ required: true } }, + setup() { + const { current: currentLanguage } = useGettext() + + return { + currentLanguage + } + }, computed: { noUsers() { return !this.users.length @@ -108,7 +117,7 @@ export default defineComponent({ return this.user.drive.quota.total === 0 ? this.$gettext('No restriction') - : filesize(this.user.drive.quota.total) + : formatFileSize(this.user.drive.quota.total, this.currentLanguage) } } }) From ea849a7bcae3ab34cac339c6bbd431326a94c844 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 19:38:21 +0100 Subject: [PATCH 5/8] add hint if no quota set --- .../src/components/Users/SideBar/DetailsPanel.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index e590dd5d4de..e7e4acf26bd 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -37,7 +37,10 @@ - + + + To see an individual quota, the user needs to have logged in once. + @@ -110,11 +113,10 @@ export default defineComponent({ .sort() .join(', ') }, + showUserQuota() { + return 'total' in (this.user.drive?.quota || {}) + }, quotaDisplayValue() { - if (!('total' in (this.user.drive?.quota || {}))) { - return this.$gettext('Not set') - } - return this.user.drive.quota.total === 0 ? this.$gettext('No restriction') : formatFileSize(this.user.drive.quota.total, this.currentLanguage) From add48b212226f1328303e7a19bcca86f04087bd6 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Jan 2023 19:40:30 +0100 Subject: [PATCH 6/8] rm unused import --- .../src/components/Users/SideBar/DetailsPanel.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index e7e4acf26bd..51dff974732 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -59,7 +59,6 @@ import UserInfoBox from './UserInfoBox.vue' import { PropType } from 'vue' import { User } from 'web-client/src/generated' import { formatFileSize } from 'web-pkg/src/helpers' -import user from 'web-runtime/src/store/user' import { useGettext } from 'vue3-gettext' export default defineComponent({ From fd17a3a98cfe15c0899a74c838513ad59adfc920 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 31 Jan 2023 10:41:27 +0100 Subject: [PATCH 7/8] Don't use deprecated v-translate --- .../src/components/Users/SideBar/DetailsPanel.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index 51dff974732..1a1ad2363d1 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -38,9 +38,13 @@ - - To see an individual quota, the user needs to have logged in once. - + @@ -60,9 +64,11 @@ import { PropType } from 'vue' import { User } from 'web-client/src/generated' import { formatFileSize } from 'web-pkg/src/helpers' import { useGettext } from 'vue3-gettext' +import { $gettext } from 'web-app-files/src/router/utils' export default defineComponent({ name: 'DetailsPanel', + methods: { $gettext }, components: { UserInfoBox }, From 618cdf656587fea0a7d46f891000696a6946d40a Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 31 Jan 2023 10:45:39 +0100 Subject: [PATCH 8/8] Fix --- .../src/components/Users/SideBar/DetailsPanel.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index 1a1ad2363d1..b4e76aa3e7c 100644 --- a/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -64,11 +64,9 @@ import { PropType } from 'vue' import { User } from 'web-client/src/generated' import { formatFileSize } from 'web-pkg/src/helpers' import { useGettext } from 'vue3-gettext' -import { $gettext } from 'web-app-files/src/router/utils' export default defineComponent({ name: 'DetailsPanel', - methods: { $gettext }, components: { UserInfoBox }, @@ -87,9 +85,10 @@ export default defineComponent({ } }, setup() { - const { current: currentLanguage } = useGettext() + const { $gettext, current: currentLanguage } = useGettext() return { + $gettext, currentLanguage } },