Files
threshold-ui/ui/admin/app/components/form/user/add-accounts/index.hbs
T

67 lines
2.0 KiB
Handlebars

{{#if this.hasAvailableAccounts}}
<Rose::Form
class='full-width'
@onSubmit={{fn this.submit @submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@error={{@model.errors.base}}
as |form|
>
<form.actions
@submitText={{t 'resources.user.actions.add-accounts'}}
@cancelText={{t 'actions.cancel'}}
/>
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'resources.auth-method.title'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each this.filteredAccounts as |account|}}
<body.row as |row|>
<row.cell>
<form.checkbox
@label={{account.id}}
@description={{account.description}}
onChange={{fn this.toggleAccount account}}
/>
</row.cell>
<row.cell>{{account.accountName}}</row.cell>
<row.cell>
<Rose::Badge>
{{t (concat 'resources.auth-method.types.' account.type)}}
</Rose::Badge>
</row.cell>
<row.cell>
<code>{{account.auth_method_id}}</code>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
</Rose::Form>
{{/if}}
{{#unless this.hasAvailableAccounts}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.user.messages.no-accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.user.messages.no-accounts.description'}}
</message.description>
<message.link @route='scopes.scope.users.user.accounts'>
<Rose::Icon @name='flight-icons/chevron-left-16' />
{{t 'actions.back'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}