Files
threshold-ui/ui/admin/app/components/form/role/grants/index.hbs
T
Devon AndersonandLisbet Alvarez a574023c05 chore: 🤖 Upgrade addons/rose dependencies (#1973)
* chore: 🤖 Upgrade addons/rose dependencies

Upgraded `addons/rose` dependencies to match other addons. Lint fixes,
and fixed scripts for concurrently

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11587

* v4.4.1...v4.12.2

* Update ember-try.js

change scenarios to match 4.12.2

* Update addons/rose/tests/integration/components/rose/button-test.js

Co-authored-by: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com>

* Update ember-try.js

originally had the right scenarios for 4.
12.2

* chore: 🤖 upgrade ember-cli-babel

Upgrade ember-cli-babel to match other addons

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11587

* Update button-test.js

fix test declaration statement

---------

Co-authored-by: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com>
2023-11-01 15:52:00 -04:00

106 lines
2.7 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{#if (can 'setGrants role' @model)}}
<Rose::Form
@onSubmit={{fn this.createGrant @addGrant}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
<Rose::List::KeyValue as |list|>
{{! Add grant field (only one per form) }}
<list.item as |item|>
<form.input
@contextual={{true}}
@name='grant'
@type='text'
@value={{this.newGrantString}}
as |input|
>
<item.key>
<input.label>{{t
'resources.role.grant.actions.create'
}}</input.label>
</item.key>
<item.cell>
<input.field title={{t 'form.grant.help'}} />
</item.cell>
<item.cell>
<Rose::Button
@onSubmit={{true}}
@disabled={{this.cannotSave}}
@style='secondary'
title={{t 'actions.add'}}
>
{{t 'actions.add'}}
</Rose::Button>
</item.cell>
</form.input>
</list.item>
</Rose::List::KeyValue>
</Rose::Form>
{{/if}}
<Rose::Form
@onSubmit={{fn @submit this.grantStrings}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
{{!--
{{#if @model.errors.grants}}
<input.errors as |errors|>
{{#each @model.errors.grants as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</input.errors>
{{/if}}
--}}
<Rose::List::KeyValue as |list|>
{{#each this.grants as |grant|}}
<list.item as |item|>
<form.input
@contextual={{true}}
@name='grant'
@type='text'
@value={{grant.value}}
@disabled={{if (can 'setGrants role' @model) false true}}
@error={{@model.errors.grant_strings}}
as |input|
>
<item.key>
<input.label>{{t 'form.grant.label'}}</input.label>
</item.key>
<item.cell>
<input.field title={{t 'form.grant.help'}} />
</item.cell>
</form.input>
<item.cell>
{{#if (can 'setGrants role' @model)}}
<Rose::Button
@style='secondary'
@iconOnly='flight-icons/svg/trash-16'
title={{t 'actions.remove'}}
{{on 'click' (fn @removeGrant grant.value)}}
>
{{t 'actions.remove'}}
</Rose::Button>
{{/if}}
</item.cell>
</list.item>
{{/each}}
</Rose::List::KeyValue>
{{#if (can 'setGrants role' @model)}}
<form.actions
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}
</Rose::Form>