From a947b06091d4396d7395540ae3ece07ef7c58232 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 27 May 2020 11:23:21 +0100 Subject: [PATCH] ui: New Empty States (#7940) * ui: CSS and component changes to the component * ui: Reset the auth-form component back to its initial state Moving forwards we are going to have the auth-form on the page all the time, even when logged in (for relogging in purposes). This means the auth-form will not always be removed from the DOM when you log in. This sets the form back to its idle state before calling onsubmit * ui: Make a public api for modal-dialog with a single close method * ui : Move cache reset somewhere that makes more sense, + single refresh 1. Centralize cache resetting elsewhere, for now the store makes most sense, although I would prefer the Repository class, so using the store is temporary 2. We only need to refresh on login once, unless we have a differing nspace * ui: Ensure visibilitychange events are cleaned up * ui: Only cache DataSource data if we have any, + only clear the cache * ui: Add the modal login dialog to both unauth and auth views This means we can 'relogin' when already logged in * ui: Add new empty states * ui: CSS Tweaks * Remove marketing grays --- ui-v2/app/components/auth-form/index.hbs | 2 +- ui-v2/app/components/empty-state/index.hbs | 21 +++++++++--- .../app/components/hashicorp-consul/index.hbs | 21 ++++++++++-- .../app/components/hashicorp-consul/index.js | 4 +++ ui-v2/app/components/modal-dialog/index.hbs | 18 ++++++++-- ui-v2/app/controllers/application.js | 34 +++++++++---------- ui-v2/app/services/client/http.js | 32 +++++++++++------ ui-v2/app/services/data-source/service.js | 26 +++++++------- ui-v2/app/services/store.js | 15 ++++++++ .../app/styles/base/color/base-variables.scss | 11 +----- .../styles/components/empty-state/index.scss | 3 ++ .../styles/components/empty-state/layout.scss | 15 +++++++- .../styles/components/empty-state/skin.scss | 17 ++++++---- .../app/templates/dc/acls/-authorization.hbs | 2 +- ui-v2/app/templates/dc/acls/-disabled.hbs | 2 +- ui-v2/app/templates/dc/acls/index.hbs | 21 ++++++++++-- .../app/templates/dc/acls/policies/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/acls/roles/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/intentions/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/kv/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/nodes/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/nspaces/index.hbs | 21 ++++++++++-- ui-v2/app/templates/dc/services/index.hbs | 21 ++++++++++-- 23 files changed, 297 insertions(+), 94 deletions(-) diff --git a/ui-v2/app/components/auth-form/index.hbs b/ui-v2/app/components/auth-form/index.hbs index c9ec424984f4..e83e3f05cebb 100644 --- a/ui-v2/app/components/auth-form/index.hbs +++ b/ui-v2/app/components/auth-form/index.hbs @@ -93,7 +93,7 @@ @nspace={{or value.Namespace nspace}} @type={{if value.Name 'oidc' 'secret'}} @value={{if value.Name value.Name value}} - @onchange={{action onsubmit}} + @onchange={{queue (action dispatch "RESET") (action onsubmit)}} @onerror={{queue (action (mut error) value="error.errors.firstObject") (action dispatch "ERROR")}} /> diff --git a/ui-v2/app/components/empty-state/index.hbs b/ui-v2/app/components/empty-state/index.hbs index d42fa7ccc9cb..8af5c2716302 100644 --- a/ui-v2/app/components/empty-state/index.hbs +++ b/ui-v2/app/components/empty-state/index.hbs @@ -8,11 +8,24 @@ {{yield}} {{/yield-slot}} -

- {{#yield-slot name="body"}} + {{#yield-slot name="body"}} +

{{yield}} - {{/yield-slot}} -

+ {{#if (and (env 'CONSUL_ACLS_ENABLED') allowLogin)}} + + {{/if}} +
+ {{/yield-slot}} {{#yield-slot name="actions"}}