From e0ee9c143b0335753db5dfae19e324781d55bd4e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 5 Apr 2023 09:28:23 +0200 Subject: [PATCH] fix(apps): Show message when the user doesn't have approved apps yet Signed-off-by: Thomas Citharel --- js/src/components/core/MaterialIcon.vue | 2 + js/src/views/Settings/AppsView.vue | 92 ++++++++++++++----------- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/js/src/components/core/MaterialIcon.vue b/js/src/components/core/MaterialIcon.vue index 4d05b7be..bb1f6298 100644 --- a/js/src/components/core/MaterialIcon.vue +++ b/js/src/components/core/MaterialIcon.vue @@ -258,6 +258,8 @@ const icons: Record Promise> = { import(`../../../node_modules/vue-material-design-icons/EyeOutline.vue`), PencilOutline: () => import(`../../../node_modules/vue-material-design-icons/PencilOutline.vue`), + Apps: () => + import(`../../../node_modules/vue-material-design-icons/Apps.vue`), }; const props = withDefaults( diff --git a/js/src/views/Settings/AppsView.vue b/js/src/views/Settings/AppsView.vue index 2f6f6b5c..0f0f5bad 100644 --- a/js/src/views/Settings/AppsView.vue +++ b/js/src/views/Settings/AppsView.vue @@ -21,49 +21,56 @@ ) }}

-
-
-

- {{ authAuthorizedApplication.application.name }} -

- {{ - urlToHostname(authAuthorizedApplication.application.website) - }} -

- {{ - t("Last used on {last_used_date}", { - last_used_date: formatDateString( - authAuthorizedApplication.lastUsedAt - ), - }) - }} - {{ t("Never used") }} ⋅ - {{ - t("Authorized on {authorization_date}", { - authorization_date: formatDateString( - authAuthorizedApplication.insertedAt - ), - }) - }} -

-
-
- {{ t("Revoke") }} +
+
+
+

+ {{ authAuthorizedApplication.application.name }} +

+ {{ + urlToHostname(authAuthorizedApplication.application.website) + }} +

+ {{ + t("Last used on {last_used_date}", { + last_used_date: formatDateString( + authAuthorizedApplication.lastUsedAt + ), + }) + }} + {{ t("Never used") }} ⋅ + {{ + t("Authorized on {authorization_date}", { + authorization_date: formatDateString( + authAuthorizedApplication.insertedAt + ), + }) + }} +

+
+
+ {{ t("Revoke") }} +
+ + {{ t("No apps authorized yet") }} +
@@ -82,6 +89,7 @@ import RouteName from "../../router/name"; import { IUser } from "@/types/current-user.model"; import { formatDateString } from "@/filters/datetime"; import { Notifier } from "@/plugins/notifier"; +import EmptyContent from "@/components/Utils/EmptyContent.vue"; const { t } = useI18n({ useScope: "global" }); @@ -94,7 +102,7 @@ const { result: authAuthorizedApplicationsResult } = useQuery<{ const authAuthorizedApplications = computed( () => authAuthorizedApplicationsResult.value?.loggedUser - ?.authAuthorizedApplications + ?.authAuthorizedApplications ?? [] ); const urlToHostname = (url: string | undefined): string | null => {