* refactor: 💡 Adopt HDS copy snippet
Adopt HDS copy snippet and delete usage of Copyable custom component
within Admin UI.
112 lines
3.0 KiB
Handlebars
112 lines
3.0 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: MPL-2.0
|
|
}}
|
|
|
|
{{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}} />
|
|
</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'
|
|
@text={{t 'actions.remove'}}
|
|
{{on
|
|
'click'
|
|
(route-action 'removeAccount' @model.user B.data)
|
|
}}
|
|
/>
|
|
</Hds::Dropdown>
|
|
{{/if}}
|
|
</B.Td>
|
|
</B.Tr>
|
|
</:body>
|
|
</Hds::Table>
|
|
|
|
{{else}}
|
|
|
|
<Rose::Layout::Centered>
|
|
<Rose::Message
|
|
@title={{t 'resources.user.messages.accounts.title'}}
|
|
as |message|
|
|
>
|
|
<message.description>
|
|
{{t 'resources.user.messages.accounts.description'}}
|
|
</message.description>
|
|
<message.link @route='scopes.scope.users.user.add-accounts'>
|
|
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
|
|
{{t 'resources.user.actions.add-accounts'}}
|
|
</message.link>
|
|
</Rose::Message>
|
|
</Rose::Layout::Centered>
|
|
|
|
{{/if}}
|
|
</page.body>
|
|
|
|
</Rose::Layout::Page> |