From e0f9b8723bf1defc64e0725a2814c12a0cb5e216 Mon Sep 17 00:00:00 2001
From: Dharini Jeeva
Date: Mon, 14 Nov 2022 17:14:33 -0800
Subject: [PATCH] Migrate rest of the badges in admin UI (#1454)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* chore: 🤖 migrate rest of the badges in admin ui
---
.../addon/components/rose/dropdown/index.hbs | 2 +-
.../components/rose/dropdown-test.js | 2 +-
.../form/group/add-members/index.hbs | 2 +-
.../form/host-set/add-hosts/index.hbs | 2 +-
.../form/role/add-principals/index.hbs | 13 ++++++-------
.../form/user/add-accounts/index.hbs | 6 +++---
.../host-catalog-type-badge/index.hbs | 19 ++++---------------
.../host-catalog-type-badge/index.js | 15 +++++++++++++++
ui/admin/app/components/scope-badge/index.hbs | 13 ++++---------
.../credential-libraries/index.hbs | 6 ++++--
.../scopes/scope/credential-stores/index.hbs | 6 ++++--
.../scopes/scope/groups/group/members.hbs | 2 +-
.../scopes/scope/roles/role/principals.hbs | 13 ++++++-------
.../templates/scopes/scope/targets/index.hbs | 14 ++++++++------
14 files changed, 59 insertions(+), 56 deletions(-)
create mode 100644 ui/admin/app/components/host-catalog-type-badge/index.js
diff --git a/addons/rose/addon/components/rose/dropdown/index.hbs b/addons/rose/addon/components/rose/dropdown/index.hbs
index 0e5b8f2f7..e4f74a98b 100644
--- a/addons/rose/addon/components/rose/dropdown/index.hbs
+++ b/addons/rose/addon/components/rose/dropdown/index.hbs
@@ -20,7 +20,7 @@
{{@text}}
{{#if @count}}
- {{@count}}
+
{{/if}}
diff --git a/addons/rose/tests/integration/components/rose/dropdown-test.js b/addons/rose/tests/integration/components/rose/dropdown-test.js
index e18f951b5..505ee26c1 100644
--- a/addons/rose/tests/integration/components/rose/dropdown-test.js
+++ b/addons/rose/tests/integration/components/rose/dropdown-test.js
@@ -28,7 +28,7 @@ module('Integration | Component | rose/dropdown', function (hooks) {
test('it supports a count', async function (assert) {
await render(hbs``);
- 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) {
diff --git a/ui/admin/app/components/form/group/add-members/index.hbs b/ui/admin/app/components/form/group/add-members/index.hbs
index 466c9933a..de4f6de73 100644
--- a/ui/admin/app/components/form/group/add-members/index.hbs
+++ b/ui/admin/app/components/form/group/add-members/index.hbs
@@ -39,7 +39,7 @@
}}
- {{user.accountName}}
+
{{/if}}
{{user.id}}
diff --git a/ui/admin/app/components/form/host-set/add-hosts/index.hbs b/ui/admin/app/components/form/host-set/add-hosts/index.hbs
index 764da4ea4..9453be687 100644
--- a/ui/admin/app/components/form/host-set/add-hosts/index.hbs
+++ b/ui/admin/app/components/form/host-set/add-hosts/index.hbs
@@ -32,7 +32,7 @@
{{host.name}}
- {{host.type}}
+
{{/each}}
diff --git a/ui/admin/app/components/form/role/add-principals/index.hbs b/ui/admin/app/components/form/role/add-principals/index.hbs
index af8c5d242..a825b7731 100644
--- a/ui/admin/app/components/form/role/add-principals/index.hbs
+++ b/ui/admin/app/components/form/role/add-principals/index.hbs
@@ -39,25 +39,24 @@
or contextualization. This is a one-off.
}}
- {{principal.accountName}}
+
{{/if}}
{{principal.id}}
-
- {{t
+ @text={{t
(concat
'resources.role.principal.types.'
principal.constructor.modelName
)
}}
-
+ />
diff --git a/ui/admin/app/components/form/user/add-accounts/index.hbs b/ui/admin/app/components/form/user/add-accounts/index.hbs
index 8536a7b2e..6db72e4e2 100644
--- a/ui/admin/app/components/form/user/add-accounts/index.hbs
+++ b/ui/admin/app/components/form/user/add-accounts/index.hbs
@@ -33,9 +33,9 @@
{{account.accountName}}
-
- {{t (concat 'resources.auth-method.types.' account.type)}}
-
+
{{account.auth_method_id}}
diff --git a/ui/admin/app/components/host-catalog-type-badge/index.hbs b/ui/admin/app/components/host-catalog-type-badge/index.hbs
index 70f9c746b..f061ba6b3 100644
--- a/ui/admin/app/components/host-catalog-type-badge/index.hbs
+++ b/ui/admin/app/components/host-catalog-type-badge/index.hbs
@@ -1,15 +1,4 @@
-{{#if @model.isStatic}}
-
- {{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
-
-{{else if @model.isUnknown}}
-
- {{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
-
-{{else}}
-
- {{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
-
-{{/if}}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ui/admin/app/components/host-catalog-type-badge/index.js b/ui/admin/app/components/host-catalog-type-badge/index.js
new file mode 100644
index 000000000..881730b80
--- /dev/null
+++ b/ui/admin/app/components/host-catalog-type-badge/index.js
@@ -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`
+ );
+ }
+}
diff --git a/ui/admin/app/components/scope-badge/index.hbs b/ui/admin/app/components/scope-badge/index.hbs
index f763fea92..acd26a931 100644
--- a/ui/admin/app/components/scope-badge/index.hbs
+++ b/ui/admin/app/components/scope-badge/index.hbs
@@ -1,9 +1,4 @@
-
- {{@scope.displayName}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs
index cfb377c97..db11e401f 100644
--- a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs
+++ b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs
@@ -48,12 +48,14 @@
{{credentialLibrary.description}}
- {{t
+
+ }}
+ />
{{credentialStore.description}}
- {{t
+
+ }}
+ />
{{member.displayName}}
{{#if member.accountName}}
-
{{member.accountName}}
+
{{/if}}
diff --git a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs
index d413d7125..27c75899b 100644
--- a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs
+++ b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs
@@ -48,7 +48,7 @@
{{principal.displayName}}
{{#if principal.accountName}}
-
{{principal.accountName}}
+
{{/if}}
@@ -61,20 +61,19 @@
-
- {{t
+ @text={{t
(concat
'resources.role.principal.types.'
principal.constructor.modelName
)
}}
-
+ />
diff --git a/ui/admin/app/templates/scopes/scope/targets/index.hbs b/ui/admin/app/templates/scopes/scope/targets/index.hbs
index 94fb019e6..69d465a0e 100644
--- a/ui/admin/app/templates/scopes/scope/targets/index.hbs
+++ b/ui/admin/app/templates/scopes/scope/targets/index.hbs
@@ -55,9 +55,9 @@
{{#if target.type}}
-
- {{t (concat 'resources.target.types.' target.type)}}
-
+
{{/if}}
@@ -88,9 +88,11 @@
{{#if target.type}}
-
- {{t (concat 'resources.target.types.' target.type)}}
-
+
{{/if}}