From 61b17cc941704c18a5a54f1658fe126b5a51cb8d Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 6 Oct 2020 14:34:32 +0100 Subject: [PATCH] ui: Remove authorization and disabled partials/blocks (#8829) * Add disabled and unauthorized views into AppView without a block * Remove disabled/unauthorized block usage * Remove unauthorized and diabled partials * Passthrough allowLogin attribute --- ui-v2/app/components/app-view/index.hbs | 26 ++++++++++++++++++- ui-v2/app/components/error-state/index.hbs | 10 +++++-- .../app/templates/dc/acls/-authorization.hbs | 21 --------------- ui-v2/app/templates/dc/acls/-disabled.hbs | 18 ------------- ui-v2/app/templates/dc/acls/policies/edit.hbs | 6 ----- .../app/templates/dc/acls/policies/index.hbs | 6 ----- ui-v2/app/templates/dc/acls/roles/edit.hbs | 6 ----- ui-v2/app/templates/dc/acls/roles/index.hbs | 6 ----- ui-v2/app/templates/dc/acls/tokens/edit.hbs | 6 ----- ui-v2/app/templates/dc/acls/tokens/index.hbs | 6 ----- 10 files changed, 33 insertions(+), 78 deletions(-) delete mode 100644 ui-v2/app/templates/dc/acls/-authorization.hbs delete mode 100644 ui-v2/app/templates/dc/acls/-disabled.hbs diff --git a/ui-v2/app/components/app-view/index.hbs b/ui-v2/app/components/app-view/index.hbs index e7e1a542d3..ae87ddec6b 100644 --- a/ui-v2/app/components/app-view/index.hbs +++ b/ui-v2/app/components/app-view/index.hbs @@ -82,7 +82,31 @@
{{#if (not enabled) }} - {{yield}} + + +

Welcome to ACLs

+
+ +

+ ACLs are not enabled in this Consul cluster. We strongly encourage the use of ACLs in production environments for the best security practices. +

+
+ + + + +
+ {{else if (not authorized)}} + {{else}} {{yield}} {{/if}} diff --git a/ui-v2/app/components/error-state/index.hbs b/ui-v2/app/components/error-state/index.hbs index d3a9af76b1..8ab3fe1537 100644 --- a/ui-v2/app/components/error-state/index.hbs +++ b/ui-v2/app/components/error-state/index.hbs @@ -1,5 +1,8 @@ {{#if (not-eq error.status "403")}} - +

{{or error.message "Consul returned an error"}}

@@ -23,7 +26,10 @@
{{else}} - +

You are not authorized

diff --git a/ui-v2/app/templates/dc/acls/-authorization.hbs b/ui-v2/app/templates/dc/acls/-authorization.hbs deleted file mode 100644 index ac570f3b2a..0000000000 --- a/ui-v2/app/templates/dc/acls/-authorization.hbs +++ /dev/null @@ -1,21 +0,0 @@ - - -

You are not authorized

-
- -

Error 403

-
- -

- You must be granted permissions to view this data. Login or ask your administrator if you think you should have access. -

-
- - - - -
diff --git a/ui-v2/app/templates/dc/acls/-disabled.hbs b/ui-v2/app/templates/dc/acls/-disabled.hbs deleted file mode 100644 index d680d8bf83..0000000000 --- a/ui-v2/app/templates/dc/acls/-disabled.hbs +++ /dev/null @@ -1,18 +0,0 @@ - - -

Welcome to ACLs

-
- -

- ACLs are not enabled in this Consul cluster. We strongly encourage the use of ACLs in production environments for the best security practices. -

-
- - - - -
diff --git a/ui-v2/app/templates/dc/acls/policies/edit.hbs b/ui-v2/app/templates/dc/acls/policies/edit.hbs index f8d6da7153..5184a111ba 100644 --- a/ui-v2/app/templates/dc/acls/policies/edit.hbs +++ b/ui-v2/app/templates/dc/acls/policies/edit.hbs @@ -14,12 +14,6 @@ {{partial 'dc/acls/policies/notifications'}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} -
  1. All Policies
  2. diff --git a/ui-v2/app/templates/dc/acls/policies/index.hbs b/ui-v2/app/templates/dc/acls/policies/index.hbs index b7fb63dca3..6d222d43a2 100644 --- a/ui-v2/app/templates/dc/acls/policies/index.hbs +++ b/ui-v2/app/templates/dc/acls/policies/index.hbs @@ -25,12 +25,6 @@ {{partial 'dc/acls/nav'}} {{/if}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} - Create diff --git a/ui-v2/app/templates/dc/acls/roles/edit.hbs b/ui-v2/app/templates/dc/acls/roles/edit.hbs index 5cc6c36ba8..6047cf4a60 100644 --- a/ui-v2/app/templates/dc/acls/roles/edit.hbs +++ b/ui-v2/app/templates/dc/acls/roles/edit.hbs @@ -14,12 +14,6 @@ {{partial 'dc/acls/roles/notifications'}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} -
    1. All Roles
    2. diff --git a/ui-v2/app/templates/dc/acls/roles/index.hbs b/ui-v2/app/templates/dc/acls/roles/index.hbs index 738d4f36fe..e6b374fe61 100644 --- a/ui-v2/app/templates/dc/acls/roles/index.hbs +++ b/ui-v2/app/templates/dc/acls/roles/index.hbs @@ -22,12 +22,6 @@ {{partial 'dc/acls/nav'}} {{/if}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} - Create diff --git a/ui-v2/app/templates/dc/acls/tokens/edit.hbs b/ui-v2/app/templates/dc/acls/tokens/edit.hbs index bc7bb1b6e3..408d3c2e2a 100644 --- a/ui-v2/app/templates/dc/acls/tokens/edit.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/edit.hbs @@ -14,12 +14,6 @@ {{partial 'dc/acls/tokens/notifications'}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} -
      1. All Tokens
      2. diff --git a/ui-v2/app/templates/dc/acls/tokens/index.hbs b/ui-v2/app/templates/dc/acls/tokens/index.hbs index f5dbad25e3..5968c9e9f4 100644 --- a/ui-v2/app/templates/dc/acls/tokens/index.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/index.hbs @@ -25,12 +25,6 @@ {{partial 'dc/acls/nav'}} {{/if}} - - {{partial 'dc/acls/disabled'}} - - - {{partial 'dc/acls/authorization'}} - Create