Files
threshold-ui/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs
T
Lisbet AlvarezandZhihe Li a20483d1af update breadcrumbs to use hds::breadcrumbs (#1934)
* refactor: 💡 initial changes for updating breadcrumbs to use hds

* refactor: 💡 add breadcrumbs to all paths

* refactor: 💡 add more hds breadcrumbs to remaining paths

* refactor: 💡 remove BreadCrumbs from templates

* refactor: 💡 remove breadcrumb only controller files

* test: 💍 remove unnused test files & add missing tests

* test: 💍 update tests

* test: 💍 add missing scope in test

* test: 💍 fix test

* refactor: 💡 remove icons

* refactor: 💡 remove addon and use service instead

* docs: ✏️ add comment to breadcrumb service

* test: 💍 update service unit test

* docs: ✏️ add comments to breadcrumb components

* Update ui/admin/app/components/breadcrumbs/container/index.js

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>

---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
2023-10-17 09:45:34 -07:00

113 lines
3.3 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{page-title (t 'resources.target.host-source.title_plural')}}
<Breadcrumbs::Item
@text={{t 'resources.target.host-source.title_plural'}}
@route='scopes.scope.targets.target.host-sources'
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<Breadcrumbs::Container />
</page.breadcrumbs>
<page.header>
<Targets::Target::Header @model={{@model}} />
</page.header>
<page.navigation>
<Targets::Target::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<Targets::Target::Actions @model={{@model}} />
</page.actions>
<page.body>
{{#if @model.hostSets}}
<Hds::Table
@model={{@model.hostSets}}
@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>
{{#if (can 'read host-set' B.data.model)}}
<LinkTo
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set'
@models={{array B.data.model.host_catalog_id B.data.model.id}}
>
{{B.data.model.displayName}}
</LinkTo>
{{else}}
{{B.data.model.displayName}}
{{/if}}
<p>{{B.data.model.description}}</p>
</B.Td>
<B.Td>
<HostCatalogTypeBadge @model={{B.data.model}} />
</B.Td>
<B.Td>
<Copyable
@text={{B.data.model.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{B.data.model.id}}</code>
</Copyable>
</B.Td>
<B.Td>
{{#if (can 'removeHostSources target' @model)}}
<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 'removeHostSource' @model B.data.model)
}}
/>
</Hds::Dropdown>
{{/if}}
</B.Td>
</B.Tr>
</:body>
</Hds::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.target.host-source.messages.welcome.title'}}
as |message|
>
<message.description>
{{t 'resources.target.host-source.messages.welcome.description'}}
</message.description>
<message.link @route='scopes.scope.targets.target.add-host-sources'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.target.actions.add-host-sources'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>