From 0cceafa394bb4fc0fce4fa12eff70c3af988f760 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Tue, 14 Nov 2023 16:23:02 +0000 Subject: [PATCH 1/2] Update embedded login dialog following UX review --- .../pkg/epinio/components/LoginDialog.vue | 215 ++++++++++++++++++ dashboard/pkg/epinio/dialog/LoginDialog.vue | 199 ---------------- dashboard/pkg/epinio/l10n/en-us.yaml | 20 +- dashboard/pkg/epinio/login/epinio.vue | 2 +- dashboard/pkg/epinio/pages/index.vue | 37 ++- 5 files changed, 255 insertions(+), 218 deletions(-) create mode 100644 dashboard/pkg/epinio/components/LoginDialog.vue delete mode 100644 dashboard/pkg/epinio/dialog/LoginDialog.vue diff --git a/dashboard/pkg/epinio/components/LoginDialog.vue b/dashboard/pkg/epinio/components/LoginDialog.vue new file mode 100644 index 0000000..ed1fe26 --- /dev/null +++ b/dashboard/pkg/epinio/components/LoginDialog.vue @@ -0,0 +1,215 @@ + + + + diff --git a/dashboard/pkg/epinio/dialog/LoginDialog.vue b/dashboard/pkg/epinio/dialog/LoginDialog.vue deleted file mode 100644 index 833b947..0000000 --- a/dashboard/pkg/epinio/dialog/LoginDialog.vue +++ /dev/null @@ -1,199 +0,0 @@ - - - - diff --git a/dashboard/pkg/epinio/l10n/en-us.yaml b/dashboard/pkg/epinio/l10n/en-us.yaml index 90de0ae..fc0d1ab 100644 --- a/dashboard/pkg/epinio/l10n/en-us.yaml +++ b/dashboard/pkg/epinio/l10n/en-us.yaml @@ -49,6 +49,15 @@ asyncButton: action: Log In success: Log In waiting: Log In + refresh: + action: 'Refresh' + actionIcon: refresh + error: 'Refresh' + errorIcon: error + success: 'Refreshed' + successIcon: checkmark + waiting: 'Refreshing' + waitingIcon: refresh epinio: label: Epinio about: @@ -367,16 +376,9 @@ epinio: warnings: noNamespace: There are no namespaces. Please create one before proceeding login: - modal: - title: Log In - local: - tabLabel: Local - dex: - tabLabel: Auth Provider - prompt: Login via Auth Provider + genericProvider: Log in with Auth Provider + useGenericProvider: Use Auth Provider model: authConfig: provider: epinio: Auth Provider -login: - genericProvider: Log in with Auth Provider diff --git a/dashboard/pkg/epinio/login/epinio.vue b/dashboard/pkg/epinio/login/epinio.vue index e37a348..893c8a9 100644 --- a/dashboard/pkg/epinio/login/epinio.vue +++ b/dashboard/pkg/epinio/login/epinio.vue @@ -60,7 +60,7 @@ export default { :disabled="$fetchState.pending" @click="login" > - {{ t('login.genericProvider') }} + {{ t('epinio.login.genericProvider') }} diff --git a/dashboard/pkg/epinio/pages/index.vue b/dashboard/pkg/epinio/pages/index.vue index 4cad827..b89858f 100644 --- a/dashboard/pkg/epinio/pages/index.vue +++ b/dashboard/pkg/epinio/pages/index.vue @@ -10,7 +10,8 @@ import AsyncButton from '@shell/components/AsyncButton.vue'; import { _MERGE } from '@shell/plugins/dashboard-store/actions'; import epinioAuth, { EpinioAuthTypes } from '../utils/auth'; import EpinioCluster, { EpinioInfoPath } from '../models/cluster'; -import PromptModal from '@shell/components/PromptModal.vue'; +import LoginDialog from '../components/LoginDialog.vue'; +import Dialog from '@shell/components/Dialog.vue'; interface Data { clustersSchema: any; @@ -19,7 +20,7 @@ interface Data { // Data, Methods, Computed, Props export default Vue.extend({ components: { - AsyncButton, Loading, Link, ResourceTable, PromptModal + AsyncButton, Loading, Link, ResourceTable, LoginDialog, Dialog }, layout: 'plain', @@ -34,7 +35,8 @@ export default Vue.extend({ return { clustersSchema: this.$store.getters[`${ EPINIO_MGMT_STORE }/schemaFor`](EPINIO_TYPES.CLUSTER), version: null, - infoUrl: EpinioInfoPath + infoUrl: EpinioInfoPath, + currentCluster: {}, }; }, @@ -125,13 +127,14 @@ export default Vue.extend({ params: { cluster: c.id } }); } else { - await this.$store.dispatch('epinio/promptModal', { - resources: c, - component: 'LoginDialog', - modalWidth: '450px', - }, { root: true }); + this.currentCluster = c; + this.$modal.show('epinio-login-dialog'); } }, + + closeDialog() { + this.$modal.hide('epinio-login-dialog'); + } } }); @@ -194,7 +197,23 @@ export default Vue.extend({ - + + + + From 6680ccce9b5871a0723e0d4cdff8dca78dd16a6d Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Thu, 16 Nov 2023 16:26:48 +0000 Subject: [PATCH 2/2] Remove the local user part of log in button if that's the only option --- dashboard/pkg/epinio/components/LoginDialog.vue | 2 +- dashboard/pkg/epinio/l10n/en-us.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard/pkg/epinio/components/LoginDialog.vue b/dashboard/pkg/epinio/components/LoginDialog.vue index ed1fe26..dd435d9 100644 --- a/dashboard/pkg/epinio/components/LoginDialog.vue +++ b/dashboard/pkg/epinio/components/LoginDialog.vue @@ -157,7 +157,7 @@ export default { style="font-size: 18px;" @click="!busy && login(PROVIDER_TYPES.LOCAL)" > - {{ t('login.loginWithLocal') }} + {{ t(cluster.oidcEnabled ? 'login.loginWithLocal' : 'epinio.login.login') }} diff --git a/dashboard/pkg/epinio/l10n/en-us.yaml b/dashboard/pkg/epinio/l10n/en-us.yaml index fc0d1ab..13190ce 100644 --- a/dashboard/pkg/epinio/l10n/en-us.yaml +++ b/dashboard/pkg/epinio/l10n/en-us.yaml @@ -376,6 +376,7 @@ epinio: warnings: noNamespace: There are no namespaces. Please create one before proceeding login: + login: Log in genericProvider: Log in with Auth Provider useGenericProvider: Use Auth Provider model: