Files
threshold-ui/ui/admin/app/templates/scopes/scope/storage-buckets/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

158 lines
5.1 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.storage-bucket.title_plural'}}
<DocLink @doc='storage-bucket' />
</Hds::Text::Display>
<Hds::Text::Body @tag='p' @size='300' class='p'>
{{t 'resources.storage-bucket.description'}}
</Hds::Text::Body>
</page.header>
<page.actions>
{{#if (can 'create scope' this.scope collection='storage-buckets')}}
{{#if @model}}
<Hds::Button
@route='scopes.scope.storage-buckets.new'
@text={{t 'resources.storage-bucket.titles.new'}}
/>
{{/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'))
(hash label=(t 'resources.storage-bucket.form.provider.label'))
(hash label=(t 'resources.storage-bucket.form.scope.label'))
(hash label=(t 'titles.actions') isVisuallyHidden=true)
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
{{#if (can 'read storage-bucket' B.data)}}
<LinkTo
@route='scopes.scope.storage-buckets.storage-bucket'
@model={{B.data.id}}
>
{{B.data.displayName}}
</LinkTo>
{{else}}
{{B.data.displayName}}
{{/if}}
{{#if B.data.description}}
<Hds::Text::Body @tag='p' class='p'>
{{B.data.description}}
</Hds::Text::Body>
{{/if}}
</B.Td>
<B.Td>
<Hds::Copy::Snippet
@textToCopy={{B.data.id}}
@color='secondary'
/>
</B.Td>
<B.Td>
{{#if B.data.isAWS}}
<Hds::Badge
@text={{t 'resources.storage-bucket.titles.amazon_s3'}}
@icon='aws-color'
/>
{{else if B.data.isMinIO}}
<Hds::Badge
@text={{t 'resources.storage-bucket.titles.minio'}}
@icon='cloud-upload'
/>
{{else}}
{{B.data.plugin.name}}
{{/if}}
</B.Td>
<B.Td>
{{#if B.data.scopeModel.isGlobal}}
<Hds::Badge @text={{t 'titles.global'}} @icon='globe' />
{{else}}
<Hds::Badge
@text={{B.data.scopeModel.displayName}}
@icon='org'
/>
{{/if}}
</B.Td>
<B.Td>
{{#let
(hash
canRead=(can 'read storage-bucket' B.data)
canDelete=(can 'delete storage-bucket' B.data)
)
as |perms|
}}
{{#if (or perms.canRead perms.canDelete)}}
<Hds::Dropdown as |dd|>
<dd.ToggleIcon
@icon='more-horizontal'
@text={{t 'actions.overflow-options'}}
@hasChevron={{false}}
@size='small'
/>
{{#if perms.canRead}}
<dd.Interactive
@route='scopes.scope.storage-buckets.storage-bucket'
@model={{B.data.id}}
>
{{t 'actions.edit'}}
</dd.Interactive>
{{/if}}
{{#if (and perms.canRead perms.canDelete)}}
<dd.Separator />
{{/if}}
{{#if perms.canDelete}}
<dd.Interactive
@color='critical'
{{on 'click' (fn this.delete B.data)}}
>
{{t 'resources.storage-bucket.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
{{/if}}
{{/let}}
</B.Td>
</B.Tr>
</:body>
</Hds::Table>
{{else}}
<Rose::Layout::Centered>
<Hds::ApplicationState as |A|>
<A.Header
@title={{t 'resources.storage-bucket.messages.none.title'}}
/>
<A.Body @text={{this.messageDescription}} />
{{#if (can 'create scope' this.scope collection='storage-buckets')}}
<A.Footer as |F|>
<F.LinkStandalone
@icon='plus-circle'
@text={{t 'resources.storage-bucket.messages.none.link'}}
@route='scopes.scope.storage-buckets.new'
/>
</A.Footer>
{{/if}}
</Hds::ApplicationState>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>