Files
threshold-ui/ui/admin/app/templates/scopes/scope/users/index.hbs
T
Cameron Perera eb9fe573b8 Icu 11937 foundation components retire rose typography styles (#2810)
* refactor: 💡 update _typography stylesheet

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

* refactor: 💡 update header margin styles into single rule

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

* refactor: 💡 add remove-header-margin class

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

* refactor: 💡 remove 'header' class

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

* test: 💍 fix failing tests for branded-card in desktop

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

* refactor: 💡 update style rule to use :where()

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

* refactor: 💡 rename remove-header-margin to remove-margin

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

* refactor: 💡 update style comment

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11937
2025-05-15 14:48:27 -05:00

116 lines
3.4 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<Breadcrumbs::Container />
</page.breadcrumbs>
<page.header>
<Hds::Text::Display @tag='h2' @size='400' @weight='bold'>
{{t 'resources.user.title_plural'}}
<DocLink @doc='user' />
</Hds::Text::Display>
{{#if @model.doUsersExist}}
<Hds::Text::Body @tag='p' @size='300' class='p'>
{{t 'resources.user.description'}}
</Hds::Text::Body>
{{/if}}
</page.header>
<page.actions>
{{#if (can 'create model' this.scope collection='users')}}
{{#if @model.doUsersExist}}
<Hds::Button
@route='scopes.scope.users.new'
@text={{t 'resources.user.titles.new'}}
/>
{{/if}}
{{/if}}
</page.actions>
<page.body class='search-filtering'>
{{#if @model.doUsersExist}}
<Hds::SegmentedGroup as |S|>
<S.TextInput
@value={{this.search}}
@type='search'
placeholder={{t 'actions.search'}}
aria-label={{t 'actions.search'}}
{{on 'input' this.handleSearchInput}}
/>
</Hds::SegmentedGroup>
{{#if @model.users}}
<Hds::Table
@model={{@model.users}}
@columns={{array
(hash label=(t 'form.name.label'))
(hash label=(t 'form.id.label'))
}}
@density='short'
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
{{#if (can 'read user' B.data)}}
<LinkTo @route='scopes.scope.users.user' @model={{B.data.id}}>
{{B.data.displayName}}
</LinkTo>
{{else}}
{{B.data.displayName}}
{{/if}}
{{#if B.data.accountName}}
<br /><Hds::Badge @text={{B.data.accountName}} />
{{/if}}
<Hds::Text::Body @tag='p' class='p'>
{{B.data.description}}
</Hds::Text::Body>
</B.Td>
<B.Td>
<Hds::Copy::Snippet
@textToCopy={{B.data.id}}
@color='secondary'
/>
</B.Td>
</B.Tr>
</:body>
</Hds::Table>
<Rose::Pagination
@totalItems={{@model.totalItems}}
@currentPage={{this.page}}
@currentPageSize={{this.pageSize}}
/>
{{else}}
<Hds::ApplicationState data-test-no-user-results as |A|>
<A.Header @title={{t 'titles.no-results-found'}} />
<A.Body
@text={{t
'descriptions.no-search-results'
query=this.search
resource=(t 'resources.user.title_plural')
}}
/>
</Hds::ApplicationState>
{{/if}}
{{else}}
<Hds::ApplicationState as |A|>
<A.Header @title={{t 'resources.user.messages.welcome.title'}} />
<A.Body @text={{this.messageDescription}} />
{{#if (can 'create model' this.scope collection='users')}}
<A.Footer as |F|>
<F.LinkStandalone
@icon='plus-circle'
@text={{t 'titles.new'}}
@route='scopes.scope.users.new'
/>
</A.Footer>
{{/if}}
</Hds::ApplicationState>
{{/if}}
</page.body>
</Rose::Layout::Page>