From e5a026ed3403aa19d1b66b0bfc182ee559881ec6 Mon Sep 17 00:00:00 2001 From: NatashaKab <133793701+NatashaKab@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:27:56 -0400 Subject: [PATCH] Icu 10367 use hds table in target host sources (#1806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 Use HDS tables in user accounts * refactor: 💡 Use HDS tables in target host sources --- .../scope/targets/target/host-sources.hbs | 121 +++++++++--------- .../acceptance/targets/host-sources-test.js | 9 +- 2 files changed, 63 insertions(+), 67 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs b/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs index bf5d91104..73bd69289 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs @@ -26,72 +26,65 @@ {{#if @model.hostSets}} - - - - {{t 'form.name.label'}} - {{t 'form.type.label'}} - {{t 'form.id.label'}} - {{t 'titles.actions'}} - - - - {{#each @model.hostSets as |hostSet|}} - - - {{#if (can 'read host-set' hostSet.model)}} - - {{hostSet.model.displayName}} - - {{else}} - {{hostSet.model.displayName}} - {{/if}} -

{{hostSet.model.description}}

-
- - - - - + <:body as |B|> + + + {{#if (can 'read host-set' B.data.model)}} + - {{hostSet.model.id}} - - - - {{#if (can 'removeHostSources target' @model)}} - + {{else}} + {{B.data.model.displayName}} + {{/if}} +

{{B.data.model.description}}

+ + + + + + + {{B.data.model.id}} + + + + {{#if (can 'removeHostSources target' @model)}} + + - - {{t 'actions.remove'}} - -
- {{/if}} -
-
- {{/each}} -
-
+ @hasChevron={{false}} + /> + + + {{/if}} + + + + {{else}} diff --git a/ui/admin/tests/acceptance/targets/host-sources-test.js b/ui/admin/tests/acceptance/targets/host-sources-test.js index c3c58c33b..cdf6213c0 100644 --- a/ui/admin/tests/acceptance/targets/host-sources-test.js +++ b/ui/admin/tests/acceptance/targets/host-sources-test.js @@ -128,7 +128,8 @@ module('Acceptance | targets | host-sources', function (hooks) { await visit(urls.target); await click(`[href="${urls.targetHostSources}"]`); - await click('tbody tr .rose-dropdown-button-danger'); + await click('.hds-dropdown-toggle-icon'); + await click('tbody tr .hds-dropdown-list-item button'); assert.strictEqual(getTargetHostSetCount(), targetHostSetCount - 1); assert.dom('tbody tr').exists({ count: targetHostSetCount - 1 }); @@ -165,7 +166,8 @@ module('Acceptance | targets | host-sources', function (hooks) { await visit(urls.target); await click(`[href="${urls.targetHostSources}"]`); - await click('tbody tr .rose-dropdown-button-danger'); + await click('.hds-dropdown-toggle-icon'); + await click('tbody tr .hds-dropdown-list-item button'); assert.dom('tbody tr').exists({ count: targetHostSetCount }); assert.dom('[role="alert"] div').hasText('The request was invalid.'); @@ -217,7 +219,8 @@ module('Acceptance | targets | host-sources', function (hooks) { assert.dom('tbody tr').exists({ count: targetHostSetCount }); // first, remove a target host set (otherwise none would be available to add) - await click('tbody tr .rose-dropdown-button-danger'); + await click('.hds-dropdown-toggle-icon'); + await click('tbody tr .hds-dropdown-list-item button'); assert.dom('tbody tr').exists({ count: targetHostSetCount - 1 }); await click('.rose-layout-page-actions a');