Skip to content

Commit

Permalink
cannot call capabilities service directly inside template because its…
Browse files Browse the repository at this point in the history
… an unresolved promise
  • Loading branch information
Monkeychip committed Oct 2, 2024
1 parent aa313d2 commit be3a183
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ui/app/components/alphabet-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{#if (eq this.mode "show")}}
<Toolbar>
<ToolbarActions>
{{#if this.capabilities.canDelete}}
{{#if this.model.updatePath.canDelete}}
<Hds::Button
@text="Delete alphabet"
@color="secondary"
Expand All @@ -40,7 +40,7 @@
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if this.capabilities.canUpdate}}
{{#if this.model.updatePath.canUpdate}}
<ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}}
@mode="edit"
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/transform-role-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{#if (eq this.mode "show")}}
<Toolbar>
<ToolbarActions>
{{#if this.capabilities.canDelete}}
{{#if this.model.updatePath.canDelete}}
<ConfirmAction
@buttonText="Delete role"
class="toolbar-button"
Expand All @@ -41,7 +41,7 @@
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if this.capabilities.canUpdate}}
{{#if this.model.updatePath.canUpdate}}
<ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}}
@mode="edit"
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/transform-template-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{#if (eq this.mode "show")}}
<Toolbar>
<ToolbarActions>
{{#if this.capabilities.canDelete}}
{{#if this.model.updatePath.canDelete}}
<Hds::Button
@text="Delete template"
@color="secondary"
Expand All @@ -40,7 +40,7 @@
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if this.capabilities.canUpdate}}
{{#if this.model.updatePath.canUpdate}}
<ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}}
@mode="edit"
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/vault/cluster/policy/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
</h1>
</p.levelLeft>
</PageHeader>
{{#if (and (not-eq this.model.id "root") (or this.capabilities.canUpdate this.capabilities.canDelete))}}
{{#if (and (not-eq this.model.id "root") (or this.model.updatePath.canUpdate this.model.updatePath.canDelete))}}
<Toolbar>
<ToolbarActions>
{{#if (and (not-eq this.model.id "default") this.capabilities.canDelete)}}
{{#if (and (not-eq this.model.id "default") this.model.updatePath.canDelete)}}
<ConfirmAction
@buttonText="Delete policy"
class="toolbar-button"
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/vault/cluster/policy/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@extension={{if (eq this.policyType "acl") this.model.format "sentinel"}}
@text="Download policy"
/>
{{#if (and (not-eq this.model.id "root") (or this.capabilities.canUpdate this.capabilities.canDelete))}}
{{#if (and (not-eq this.model.id "root") (or this.model.updatePath.canUpdate this.model.updatePath.canDelete))}}
<ToolbarLink
@route="vault.cluster.policy.edit"
@models={{array this.policyType this.model.id}}
Expand Down

0 comments on commit be3a183

Please sign in to comment.