refactor: 💡 Migrate host-sets-list in host catalog to Hds (#2057)
* refactor: 💡 Migrate host-sets-list in host catalog to `Hds` Migrate `host-catalog` `host-sets` list to use `Hds::Table` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11727 * refactor: 💡 refactor incorrect use of `Hds::Code::Snippet` Revactor incorrect use of `Hds::Code::Snippet` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11727 * Update index.hbs color for text should be `secondary` * Update index.hbs lint error * refactor: 💡 quick lint fix quick lint fix ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11727
This commit is contained in:
1 parent
659067dd08
commit
01d4a329ab
1 file changed
+38
-39
+38
-39
@@ -22,47 +22,46 @@
|
||||
|
||||
<page.body>
|
||||
{{#if @model.hostSets}}
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
|
||||
<table.body as |body|>
|
||||
{{#each @model.hostSets as |hostSet|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
{{#if (can 'read model' hostSet)}}
|
||||
<LinkTo
|
||||
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set'
|
||||
@model={{hostSet.id}}
|
||||
>
|
||||
{{hostSet.displayName}}
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
{{hostSet.displayName}}
|
||||
{{/if}}
|
||||
<p>{{hostSet.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<HostCatalogTypeBadge @model={{hostSet}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{hostSet.id}}
|
||||
@buttonText={{t 'actions.copy-to-clipboard'}}
|
||||
@acknowledgeText={{t 'states.copied'}}
|
||||
<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'))
|
||||
}}
|
||||
>
|
||||
<:body as |B|>
|
||||
<B.Tr>
|
||||
<B.Td>
|
||||
{{#if (can 'read model' B.data)}}
|
||||
<LinkTo
|
||||
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set'
|
||||
@model={{B.data.id}}
|
||||
>
|
||||
<code>{{hostSet.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
{{B.data.displayName}}
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
<Hds::Text::Body @tag='p'>
|
||||
{{B.data.displayName}}
|
||||
</Hds::Text::Body>
|
||||
{{/if}}
|
||||
<Hds::Text::Body @tag='p'>
|
||||
{{B.data.description}}
|
||||
</Hds::Text::Body>
|
||||
</B.Td>
|
||||
<B.Td>
|
||||
<HostCatalogTypeBadge @model={{B.data}} />
|
||||
</B.Td>
|
||||
<B.Td>
|
||||
<Hds::Copy::Snippet
|
||||
@color='secondary'
|
||||
@textToCopy={{B.data.id}}
|
||||
/>
|
||||
</B.Td>
|
||||
</B.Tr>
|
||||
</:body>
|
||||
</Hds::Table>
|
||||
|
||||
{{else}}
|
||||
<Rose::Layout::Centered>
|
||||
|
||||
Reference in new issue
Block a user