Files
threshold-ui/ui/admin/app/components/form/target/add-host-sets/index.hbs
T
Lisbet AlvarezandDharini Jeeva ff2e320267 refactor: 💡 use hds checkbox field instead of rose checkbox (#1754)
* refactor: 💡 use hds checkbox field instead of rose checkbox

✅ Closes: ICU-9423

* Update ui/admin/app/components/form/auth-method/oidc/index.hbs

Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>

* Update ui/desktop/app/controllers/scopes/scope/projects/sessions/index.js

Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>

* fix: 🐛 remove isInvalid arg

* refactor: 💡 move array conversion to model hook

---------

Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>
2023-07-11 12:56:30 -07:00

65 lines
1.8 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{#if this.hasAvailableHostSets}}
<Rose::Form
class='full-width'
@onSubmit={{this.submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
<form.actions
@submitText={{t 'resources.target.actions.add-host-sources'}}
@cancelText={{t 'actions.cancel'}}
/>
<Hds::Table
@model={{this.filteredHostSets}}
@columns={{array
(hash label=(t 'form.id.label'))
(hash label=(t 'form.name.label'))
(hash label=(t 'form.type.label'))
(hash label=(t 'resources.host-catalog.title'))
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
<Hds::Form::Checkbox::Field
{{on 'change' (fn this.toggleHostSet B.data.id)}}
as |F|
>
<F.Label>{{B.data.id}}</F.Label>
<F.HelperText>{{B.data.description}}</F.HelperText>
</Hds::Form::Checkbox::Field>
</B.Td>
<B.Td>{{B.data.name}}</B.Td>
<B.Td><HostCatalogTypeBadge @model={{B.data}} /></B.Td>
<B.Td><code>{{B.data.host_catalog_id}}</code></B.Td>
</B.Tr>
</:body>
</Hds::Table>
</Rose::Form>
{{/if}}
{{#unless this.hasAvailableHostSets}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.target.host-source.messages.none.title'}}
as |message|
>
<message.description>
{{t 'resources.target.host-source.messages.none.description'}}
</message.description>
<message.link @route='scopes.scope.targets.target.host-sources'>
<Rose::Icon @name='flight-icons/svg/chevron-left-16' />
{{t 'actions.back'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}