Files
threshold-ui/ui/admin/app/components/form/group/add-members/index.hbs
T
2024-12-04 14:16:05 -08:00

69 lines
1.9 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#if this.availableUsers}}
<Rose::Form
class='full-width'
@onSubmit={{fn this.submit @submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
<form.actions
@submitText={{t 'resources.group.actions.add-members'}}
@cancelText={{t 'actions.cancel'}}
/>
<Hds::Table
@model={{this.availableUsers}}
@columns={{array
(hash label=(t 'form.name.label'))
(hash label=(t 'form.id.label'))
(hash label=(t 'resources.scope.title'))
(hash label=(t 'form.description.label'))
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
<Hds::Form::Checkbox::Field
{{on 'change' (fn this.toggleMember B.data)}}
as |F|
>
<F.Label>{{B.data.displayName}}</F.Label>
{{#if B.data.accountName}}
<F.HelperText>
<Hds::Badge @text={{B.data.accountName}} />
</F.HelperText>
{{/if}}
</Hds::Form::Checkbox::Field>
</B.Td>
<B.Td><code>{{B.data.id}}</code></B.Td>
<B.Td><ScopeBadge @scope={{B.data.scopeModel}} /></B.Td>
<B.Td>{{B.data.description}}</B.Td>
</B.Tr>
</:body>
</Hds::Table>
</Rose::Form>
{{/if}}
{{#unless this.availableUsers}}
<Rose::Layout::Centered>
<Hds::ApplicationState as |A|>
<A.Header @title={{t 'resources.group.messages.no-members.title'}} />
<A.Body @text={{t 'resources.group.messages.no-members.description'}} />
<A.Footer as |F|>
<F.LinkStandalone
@icon='arrow-left'
@text={{t 'actions.back'}}
@route='scopes.scope.groups.group.members'
/>
</A.Footer>
</Hds::ApplicationState>
</Rose::Layout::Centered>
{{/unless}}