Files
threshold-ui/ui/admin/app/templates/scopes/scope/groups/index.hbs
T
NatashaKabandDharini Jeeva e60d11eddd Icu 10178 use hds table in groups list view (#1768)
* chore: 🤖 Retire rose form textarea

✅ Closes: ICU-9425

* refactor: 💡 Added the disabled feature requested by Dharini

* refactor: 💡 Rose tables to HDS tables in Users

* refactor: 💡 Removed implementation of rose tables in users

* refactor: 💡 use hds table in groups list view

* refactor: 💡 Removed the group list class Dharini mentioned

* refactor: 💡 Resolved the conflicts in user list table and group

---------

Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>
2023-07-14 15:39:57 -04:00

105 lines
2.9 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>
{{t 'resources.group.title_plural'}}
<DocLink @doc='group' @iconSize='large' />
</h2>
<p>{{t 'resources.group.description'}}</p>
</page.header>
<page.actions>
{{#if (can 'create model' this.scope collection='groups')}}
{{#if @model}}
<Rose::LinkButton @route='scopes.scope.groups.new' @style='primary'>{{t
'resources.group.titles.new'
}}</Rose::LinkButton>
{{/if}}
{{/if}}
</page.actions>
<page.body>
{{#if @model}}
<Hds::Table
@model={{@model}}
@columns={{array
(hash label=(t 'form.name.label'))
(hash label=(t 'form.id.label'))
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
{{#if (can 'read group' B.data)}}
<LinkTo @route='scopes.scope.groups.group' @model={{B.data.id}}>
{{B.data.displayName}}
</LinkTo>
{{else}}
{{B.data.displayName}}
{{/if}}
<p>{{B.data.description}}</p>
</B.Td>
<B.Td>
<Copyable
@text={{B.data.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{B.data.id}}</code>
</Copyable>
</B.Td>
</B.Tr>
</:body>
</Hds::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.group.messages.welcome.title'}}
as |message|
>
<message.description>
{{#if (can 'list model' this.scope collection='groups')}}
{{! can list (at least): show default welcome message}}
{{t 'resources.group.description'}}
{{else if (can 'create model' this.scope collection='groups')}}
{{! can create (only): show create-but-not-list welcome message}}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.group.title_plural')
}}
{{else}}
{{! can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.group.title_plural')
}}
{{/if}}
</message.description>
{{#if (can 'create model' this.scope collection='groups')}}
<message.link @route='scopes.scope.groups.new'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'titles.new'}}
</message.link>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>