From 8cd8724589dc518fe29ea06d90dd3558bfdb28e7 Mon Sep 17 00:00:00 2001 From: NatashaKab <133793701+NatashaKab@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:49:37 -0400 Subject: [PATCH] Icu 10210 use hds table in principal list view (#1792) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 Retire rose form textarea ✅ Closes: ICU-9425 * refactor: 💡 Added the disabled feature requested by Dharini * refactor: 💡 Rose tables to HDS tables in Users * refactor: 💡 Removed implementation of rose tables in users * refactor: 💡 use hds table in groups list view * refactor: 💡 Removed the group list class Dharini mentioned * refactor: 💡 Resolved the conflicts in user list table and group * refactor: 💡 Use hds table in role list view * refactor: 💡 Use HDS tables for user accounts * refactor: 💡 Fixed the linting error * refactor: 💡 Use HDS tables in principal list view --------- Co-authored-by: Dharini Jeeva --- .../scopes/scope/roles/role/principals.hbs | 116 +++++++++--------- .../tests/acceptance/roles/principals-test.js | 11 +- 2 files changed, 63 insertions(+), 64 deletions(-) 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 bc90916ef..0d03ee4b9 100644 --- a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs @@ -37,67 +37,63 @@ {{#if @model.principals}} - - - - {{t 'form.name.label'}} - {{t 'form.id.label'}} - {{t 'form.type.label'}} - {{t 'resources.scope.title'}} - {{t 'titles.actions'}} - - - - {{#each @model.principals as |principal|}} - - - {{#if (can 'readPrincipal role' principal)}} - - {{else}} - {{principal.displayName}} - {{/if}} - {{#if principal.accountName}} -
- {{/if}} -
- - - {{principal.id}} - - - - - - - - - - {{#if (can 'removePrincipals role' @model.role)}} - + <:body as |B|> + + + {{#if (can 'readPrincipal role' B.data)}} + + {{else}} + {{B.data.displayName}} + {{/if}} + {{#if B.data.accountName}} +
+ {{/if}} +
+ + + {{B.data.id}} + + + + + + + + + + {{#if (can 'removePrincipals role' @model.role)}} + + - - {{t 'actions.remove'}} - -
- {{/if}} -
-
- {{/each}} -
-
+ @hasChevron={{false}} + /> + + + {{/if}} + + + + {{else}} diff --git a/ui/admin/tests/acceptance/roles/principals-test.js b/ui/admin/tests/acceptance/roles/principals-test.js index 4f8e2d8bd..e3e04fe52 100644 --- a/ui/admin/tests/acceptance/roles/principals-test.js +++ b/ui/admin/tests/acceptance/roles/principals-test.js @@ -71,7 +71,8 @@ module('Acceptance | roles | principals', function (hooks) { assert.expect(2); await visit(urls.rolePrincipals); assert.strictEqual(findAll('tbody tr').length, principalsCount); - 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(findAll('tbody tr').length, principalsCount - 1); }); @@ -82,7 +83,7 @@ module('Acceptance | roles | principals', function (hooks) { ); instances.role.update({ authorized_actions }); await visit(urls.rolePrincipals); - assert.notOk(find('tbody tr .rose-dropdown-button-danger')); + assert.notOk(find('tbody tr .hds-dropdown-list-item button')); }); test('shows error message on principal remove', async function (assert) { @@ -101,7 +102,8 @@ module('Acceptance | roles | principals', function (hooks) { }); await visit(urls.rolePrincipals); assert.strictEqual(findAll('tbody tr').length, principalsCount); - await click('tbody tr .rose-dropdown-button-danger'); + await click('.hds-dropdown-toggle-icon'); + await click('tbody tr .hds-dropdown-list-item button'); assert.ok(find('[role="alert"]')); }); @@ -136,7 +138,8 @@ module('Acceptance | roles | principals', function (hooks) { await visit(urls.rolePrincipals); assert.strictEqual(findAll('tbody tr').length, principalsCount); // Remove a principal to populate association view - 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(findAll('tbody tr').length, principalsCount - 1); await click('.rose-layout-page-actions a'); assert.strictEqual(currentURL(), urls.addPrincipals);