Migrate rest of the badges in admin UI (#1454)

* chore: 🤖 migrate rest of the badges in admin ui
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2022-11-14 17:14:33 -08:00
1 parent b3a02a3d6e
commit e0f9b8723b
14 files changed
+59 -56

No files matched your search

@@ -20,7 +20,7 @@
<span class='rose-dropdown-trigger-text'>
{{@text}}
{{#if @count}}
<Rose::Badge>{{@count}}</Rose::Badge>
<Hds::BadgeCount @text={{@count}} @size='small' />
{{/if}}
</span>
@@ -28,7 +28,7 @@ module('Integration | Component | rose/dropdown', function (hooks) {
test('it supports a count', async function (assert) {
await render(hbs`<Rose::Dropdown @text="Click me" @count="2" />`);
assert.strictEqual(find('.rose-badge').textContent.trim(), '2');
assert.strictEqual(find('.hds-badge-count').textContent.trim(), '2');
});
test('it supports an icon', async function (assert) {
@@ -39,7 +39,7 @@
}}
<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<Rose::Badge>{{user.accountName}}</Rose::Badge>
<Hds::Badge @text={{user.accountName}} />
{{/if}}
</row.headerCell>
<row.cell><code>{{user.id}}</code></row.cell>
@@ -32,7 +32,7 @@
</row.cell>
<row.cell>{{host.name}}</row.cell>
<row.cell>
<Rose::Badge>{{host.type}}</Rose::Badge>
<Hds::Badge @text={{host.type}} />
</row.cell>
</body.row>
{{/each}}
@@ -39,25 +39,24 @@
or contextualization. This is a one-off.
}}
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<Rose::Badge>{{principal.accountName}}</Rose::Badge>
<Hds::Badge @text={{principal.accountName}} />
{{/if}}
</row.headerCell>
<row.cell>{{principal.id}}</row.cell>
<row.cell>
<Rose::Badge
<Hds::Badge
@icon={{if
(eq principal.constructor.modelName 'group')
'flight-icons/svg/folder-users-16'
'flight-icons/svg/user-16'
'folder-users'
'user'
}}
>
{{t
@text={{t
(concat
'resources.role.principal.types.'
principal.constructor.modelName
)
}}
</Rose::Badge>
/>
</row.cell>
<row.cell>
<ScopeBadge @scope={{principal.scopeModel}} />
@@ -33,9 +33,9 @@
</row.cell>
<row.cell>{{account.accountName}}</row.cell>
<row.cell>
<Rose::Badge>
{{t (concat 'resources.auth-method.types.' account.type)}}
</Rose::Badge>
<Hds::Badge
@text={{t (concat 'resources.auth-method.types.' account.type)}}
/>
</row.cell>
<row.cell>
<code>{{account.auth_method_id}}</code>
@@ -1,15 +1,4 @@
{{#if @model.isStatic}}
<Rose::Badge>
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
</Rose::Badge>
{{else if @model.isUnknown}}
<Rose::Badge>
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
</Rose::Badge>
{{else}}
<Rose::Badge
@icon={{concat 'flight-icons/svg/' @model.compositeType '-color-16'}}
>
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
</Rose::Badge>
{{/if}}
<Hds::Badge
@icon={{this.icon}}
@text={{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
/>
@@ -0,0 +1,15 @@
import Component from '@glimmer/component';
const types = ['aws', 'azure'];
export default class HostCatalogTypeComponent extends Component {
/**
* Display icons only for plugin compositeTypes.
* @type {string}
*/
get icon() {
return (
types.includes(this.args.model.compositeType) &&
`${this.args.model.compositeType}-color`
);
}
}
@@ -1,9 +1,4 @@
<Rose::Badge
@icon={{if
@scope.isProject
'flight-icons/svg/grid-16'
(if @scope.isOrg 'flight-icons/svg/org-16' 'flight-icons/svg/globe-16')
}}
>
{{@scope.displayName}}
</Rose::Badge>
<Hds::Badge
@icon={{if @scope.isProject 'grid' (if @scope.isOrg 'org' 'globe')}}
@text={{@scope.displayName}}
/>
@@ -48,12 +48,14 @@
<p>{{credentialLibrary.description}}</p>
</row.headerCell>
<row.cell>
<Rose::Badge>{{t
<Hds::Badge
@text={{t
(concat
'resources.credential-library.types.'
credentialLibrary.type
)
}}</Rose::Badge>
}}
/>
</row.cell>
<row.cell>
<Copyable
@@ -55,11 +55,13 @@
<p>{{credentialStore.description}}</p>
</row.headerCell>
<row.cell>
<Rose::Badge>{{t
<Hds::Badge
@text={{t
(concat
'resources.credential-store.types.' credentialStore.type
)
}}</Rose::Badge>
}}
/>
</row.cell>
<row.cell>
<Copyable
@@ -36,7 +36,7 @@
<row.headerCell>
{{member.displayName}}
{{#if member.accountName}}
<br /><Rose::Badge>{{member.accountName}}</Rose::Badge>
<br /><Hds::Badge @text={{member.accountName}} />
{{/if}}
</row.headerCell>
<row.cell>
@@ -48,7 +48,7 @@
<row.headerCell>
{{principal.displayName}}
{{#if principal.accountName}}
<br /><Rose::Badge>{{principal.accountName}}</Rose::Badge>
<br /><Hds::Badge @text={{principal.accountName}} />
{{/if}}
</row.headerCell>
<row.cell>
@@ -61,20 +61,19 @@
</Copyable>
</row.cell>
<row.cell>
<Rose::Badge
<Hds::Badge
@icon={{if
(eq principal.constructor.modelName 'group')
'flight-icons/svg/folder-users-16'
'flight-icons/svg/user-16'
'folder-users'
'user'
}}
>
{{t
@text={{t
(concat
'resources.role.principal.types.'
principal.constructor.modelName
)
}}
</Rose::Badge>
/>
</row.cell>
<row.cell>
<ScopeBadge @scope={{principal.scopeModel}} />
@@ -55,9 +55,9 @@
</row.headerCell>
<row.cell>
{{#if target.type}}
<Rose::Badge>
{{t (concat 'resources.target.types.' target.type)}}
</Rose::Badge>
<Hds::Badge
@text={{t (concat 'resources.target.types.' target.type)}}
/>
{{/if}}
</row.cell>
<row.cell>
@@ -88,9 +88,11 @@
</row.headerCell>
<row.cell>
{{#if target.type}}
<Rose::Badge>
{{t (concat 'resources.target.types.' target.type)}}
</Rose::Badge>
<Hds::Badge
@text={{t
(concat 'resources.target.types.' target.type)
}}
/>
{{/if}}
</row.cell>
<row.cell>