From d1cbe5f5a7a0c30eb960d24e8765cc508e9145e7 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Thu, 21 Oct 2021 11:22:35 -0600 Subject: [PATCH 1/2] adds divider to toolbars with destructive actions --- 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 + 13 files changed, 89 insertions(+), 84 deletions(-) diff --git a/ui/app/templates/components/alphabet-edit.hbs b/ui/app/templates/components/alphabet-edit.hbs index 0928343c9c28c..918962e44f102 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 990fe4e3b6c4f..10c8ed7aa4c06 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 2a3d429b7a116..e6799c89315f0 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 11c823ca491d5..736794144bb25 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 e30079a026d24..8a1b5018cbce7 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}} Date: Thu, 21 Oct 2021 12:38:15 -0600 Subject: [PATCH 2/2] adds changelog --- changelog/12895.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/12895.txt diff --git a/changelog/12895.txt b/changelog/12895.txt new file mode 100644 index 0000000000000..ff9a66e612a9d --- /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