From 4d4b37bf829e10824cbdcc154ac539a3995d2b44 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Fri, 22 Oct 2021 08:11:14 -0600 Subject: [PATCH] adds divider to toolbars with destructive actions (#12895) * adds divider to toolbars with destructive actions * adds changelog --- changelog/12895.txt | 3 + ui/app/templates/components/alphabet-edit.hbs | 1 + .../components/database-role-edit.hbs | 56 +++++++++---------- .../templates/components/generated-item.hbs | 17 ++++-- ui/app/templates/components/role-aws-edit.hbs | 20 +++---- ui/app/templates/components/role-pki-edit.hbs | 22 ++++---- ui/app/templates/components/role-ssh-edit.hbs | 20 +++---- .../components/secret-delete-menu.hbs | 3 +- .../components/transform-role-edit.hbs | 1 + .../components/transform-template-edit.hbs | 1 + .../components/transformation-edit.hbs | 4 +- .../templates/vault/cluster/policy/edit.hbs | 14 ++--- .../kmip/addon/templates/credentials/show.hbs | 13 +++-- ui/lib/kmip/addon/templates/role.hbs | 1 + 14 files changed, 92 insertions(+), 84 deletions(-) create mode 100644 changelog/12895.txt diff --git a/changelog/12895.txt b/changelog/12895.txt new file mode 100644 index 000000000000..ff9a66e612a9 --- /dev/null +++ b/changelog/12895.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Standardizes toolbar presentation of destructive actions +``` \ No newline at end of file diff --git a/ui/app/templates/components/alphabet-edit.hbs b/ui/app/templates/components/alphabet-edit.hbs index 0928343c9c28..918962e44f10 100644 --- a/ui/app/templates/components/alphabet-edit.hbs +++ b/ui/app/templates/components/alphabet-edit.hbs @@ -33,6 +33,7 @@ > Delete alphabet +
{{/if}} {{#if capabilities.canUpdate }} {{#if @model.canDelete}} - - Delete role - -
+ + Delete role + +
{{/if}} {{#if @model.canGenerateCredentials}} - + {{/if}} {{#if @model.canEditRole}} - - Edit role - + + Edit role + {{/if}} diff --git a/ui/app/templates/components/generated-item.hbs b/ui/app/templates/components/generated-item.hbs index 990fe4e3b6c4..10c8ed7aa4c0 100644 --- a/ui/app/templates/components/generated-item.hbs +++ b/ui/app/templates/components/generated-item.hbs @@ -32,14 +32,21 @@ {{#if (eq mode "show")}} - + Delete {{itemType}} - +
+ Edit {{singularize itemType}} diff --git a/ui/app/templates/components/role-aws-edit.hbs b/ui/app/templates/components/role-aws-edit.hbs index 2a3d429b7a11..e6799c89315f 100644 --- a/ui/app/templates/components/role-aws-edit.hbs +++ b/ui/app/templates/components/role-aws-edit.hbs @@ -18,6 +18,15 @@ {{#if (eq mode "show")}} + {{#if model.canDelete}} + + Delete role + +
+ {{/if}} {{#if model.canGenerate}} {{/if}} - {{#if (and model.canGenerate (or model.canDelete model.canEdit))}} -
- {{/if}} - {{#if model.canDelete}} - - Delete role - - {{/if}} {{#if model.canEdit}} + {{#if model.canDelete}} + + Delete role + +
+ {{/if}} {{#if model.canGenerate}} {{/if}} - {{#if (and (or model.canGenerate model.canSign) (or model.canDelete model.canEdit))}} -
- {{/if}} - {{#if model.canDelete}} - - Delete role - - {{/if}} {{#if model.canEdit}} + {{#if model.canDelete}} + + Delete role + +
+ {{/if}} {{#if (eq model.keyType "otp")}} {{/if}} - {{#if (or model.canUpdate model.canDelete)}} -
- {{/if}} - {{#if model.canDelete}} - - Delete role - - {{/if}} {{#if (or model.canUpdate model.canDelete)}} Delete +
{{/if}} {{else}} {{#if (and this.canUndeleteVersion @modelForData.deleted)}} @@ -26,7 +27,7 @@ +
{{/if}} {{#if capabilities.canUpdate }} - {{#if (or capabilities.canUpdate capabilities.canDelete)}} -
- {{/if}} {{#if capabilities.canDelete}} {{#if (gt model.allowed_roles.length 0)}} {{/if}} +
{{/if}} {{#if capabilities.canUpdate }} {{#if (gt model.allowed_roles.length 0)}} diff --git a/ui/app/templates/vault/cluster/policy/edit.hbs b/ui/app/templates/vault/cluster/policy/edit.hbs index 11c823ca491d..736794144bb2 100644 --- a/ui/app/templates/vault/cluster/policy/edit.hbs +++ b/ui/app/templates/vault/cluster/policy/edit.hbs @@ -23,13 +23,6 @@ {{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}} - - Back to policy - -
{{#if (and (not-eq model.id "default") capabilities.canDelete)}} Delete +
{{/if}} + + Back to policy + {{/if}} diff --git a/ui/lib/kmip/addon/templates/credentials/show.hbs b/ui/lib/kmip/addon/templates/credentials/show.hbs index e30079a026d2..8a1b5018cbce 100644 --- a/ui/lib/kmip/addon/templates/credentials/show.hbs +++ b/ui/lib/kmip/addon/templates/credentials/show.hbs @@ -10,12 +10,6 @@ - - Back to role - {{#if model.deletePath.canDelete}} +
{{/if}} + + Back to role + +
{{/if}} {{#if model.updatePath.canUpdate}}