* refactor: 💡 use hds::applicationstate instead of rose::message ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15639
113 lines
3.0 KiB
Handlebars
113 lines
3.0 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
}}
|
|
|
|
{{page-title (t 'resources.user.messages.accounts.title')}}
|
|
<Breadcrumbs::Item
|
|
@text={{t 'resources.user.messages.accounts.title'}}
|
|
@route='scopes.scope.users.user.accounts'
|
|
/>
|
|
|
|
<Rose::Layout::Page as |page|>
|
|
|
|
<page.breadcrumbs>
|
|
<Breadcrumbs::Container />
|
|
</page.breadcrumbs>
|
|
|
|
<page.header>
|
|
<Users::User::Header @model={{@model.user}} />
|
|
</page.header>
|
|
|
|
<page.navigation>
|
|
<Users::User::Nav @model={{@model.user}} />
|
|
</page.navigation>
|
|
|
|
<page.actions>
|
|
<Users::User::Actions
|
|
@model={{@model.user}}
|
|
@delete={{this.users.delete}}
|
|
/>
|
|
</page.actions>
|
|
|
|
<page.body>
|
|
{{#if @model.accounts}}
|
|
|
|
<Hds::Table
|
|
@model={{@model.accounts}}
|
|
@columns={{array
|
|
(hash label=(t 'form.name.label'))
|
|
(hash label=(t 'form.type.label'))
|
|
(hash label=(t 'form.id.label'))
|
|
(hash label=(t 'titles.actions'))
|
|
}}
|
|
@valign='middle'
|
|
>
|
|
<:body as |B|>
|
|
<B.Tr>
|
|
<B.Td>
|
|
<span class='hds-font-weight-semibold'>{{#if
|
|
(can 'read accounts' B.data)
|
|
}}
|
|
{{B.data.accountName}}
|
|
{{else}}
|
|
{{B.data.displayName}}
|
|
{{/if}}
|
|
</span>
|
|
|
|
<p>{{B.data.description}}</p>
|
|
</B.Td>
|
|
<B.Td>
|
|
<Hds::Badge
|
|
@text={{t (concat 'resources.auth-method.types.' B.data.type)}}
|
|
/>
|
|
</B.Td>
|
|
<B.Td>
|
|
<Hds::Copy::Snippet
|
|
@textToCopy={{B.data.id}}
|
|
@color='secondary'
|
|
/>
|
|
</B.Td>
|
|
<B.Td>
|
|
|
|
{{#if (can 'removeAccount user' @model.user account=B.data)}}
|
|
<Hds::Dropdown as |dd|>
|
|
<dd.ToggleIcon
|
|
@icon='more-horizontal'
|
|
@text={{t 'actions.manage'}}
|
|
@hasChevron={{false}}
|
|
/>
|
|
<dd.Interactive
|
|
@color='critical'
|
|
{{on
|
|
'click'
|
|
(fn this.users.removeAccount @model.user B.data)
|
|
}}
|
|
>{{t 'actions.remove'}}</dd.Interactive>
|
|
</Hds::Dropdown>
|
|
{{/if}}
|
|
</B.Td>
|
|
</B.Tr>
|
|
</:body>
|
|
</Hds::Table>
|
|
|
|
{{else}}
|
|
|
|
<Rose::Layout::Centered>
|
|
<Hds::ApplicationState as |A|>
|
|
<A.Header @title={{t 'resources.user.messages.accounts.title'}} />
|
|
<A.Body @text={{t 'resources.user.messages.accounts.description'}} />
|
|
<A.Footer as |F|>
|
|
<F.LinkStandalone
|
|
@icon='plus-circle'
|
|
@text={{t 'resources.user.actions.add-accounts'}}
|
|
@route='scopes.scope.users.user.add-accounts'
|
|
/>
|
|
</A.Footer>
|
|
</Hds::ApplicationState>
|
|
</Rose::Layout::Centered>
|
|
|
|
{{/if}}
|
|
</page.body>
|
|
|
|
</Rose::Layout::Page> |