From 4550cd0965ea849eb0f1f065d6adf576e433417d Mon Sep 17 00:00:00 2001 From: Devon Anderson Date: Thu, 14 Dec 2023 14:48:10 -0500 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Migrate=20`host-?= =?UTF-8?q?catalog/host-list`=20to=20use=20`Hds`=20(#2044)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 Migrate `host-catalog/host-list` to use `Hds` Migrate `host-catalog/host-list` to use `Hds::Table` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11729 * refactor: 💡 `Hds::Text` refactor Refactored `code` and `p` tag elements to use new `HDS::Text` elements ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11729 --- .../host-catalog/hosts/index.hbs | 85 +++++++++---------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs index a0fa8163d7..37b6978f2e 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs @@ -22,52 +22,49 @@ {{#if @model.hosts}} - - - - {{t 'form.name.label'}} - {{t 'form.type.label'}} - {{t 'form.id.label'}} - {{t 'form.address.label'}} - - - - {{#each @model.hosts as |host|}} - - - {{#if (can 'read model' host)}} - - {{host.displayName}} - - {{else}} - {{host.displayName}} - {{/if}} -

{{host.description}}

-
- - - - - + <:body as |B|> + + + {{#if (can 'read model' B.data)}} + - {{host.id}} - - - - - {{host.address}} - -
- {{/each}} -
-
+ {{B.data.displayName}} + + {{else}} + {{B.data.displayName}} + {{/if}} + {{B.data.description}} + + + + + + + {{B.data.id}} + + + + {{B.data.address}} + + + + {{else}} From ade1601d8d533d620feddba6469b69df431a2315 Mon Sep 17 00:00:00 2001 From: Devon Anderson Date: Thu, 14 Dec 2023 17:27:09 -0500 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Refactor=20`sess?= =?UTF-8?q?ions-list`=20to=20use=20`Hds::Table`=20(#2043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 Refactor `sessions-list` to use `Hds::Table` Refactor `sessions-list` to use `Hds::Table` instead of `Rose::table` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11732 * refactor: 💡 Use `Hds::Text` component for `code` elements Refactor `code` elements to use `Hds::Text::Code` component for text. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11732 * Update ui/admin/app/templates/scopes/scope/sessions/index.hbs Co-authored-by: Cameron Perera * refactor: 💡 Refactor the condition around the `cancelSession` route-action, to use the `SessionAbility` for permssion to cancel session. Upgrade `Rose::Button` to `Hds::Button`. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11732 --------- Co-authored-by: Cameron Perera --- ui/admin/app/styles/app.scss | 3 +- .../templates/scopes/scope/sessions/index.hbs | 125 ++++++++---------- 2 files changed, 58 insertions(+), 70 deletions(-) diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss index 699de8ac18..3dd3daa5d8 100644 --- a/ui/admin/app/styles/app.scss +++ b/ui/admin/app/styles/app.scss @@ -740,7 +740,8 @@ } .auth-methods-list-table, -.workers-list-table { +.workers-list-table, +.sessions-list-table { margin-top: 1rem; } diff --git a/ui/admin/app/templates/scopes/scope/sessions/index.hbs b/ui/admin/app/templates/scopes/scope/sessions/index.hbs index 604dee22e3..a12b0f71a1 100644 --- a/ui/admin/app/templates/scopes/scope/sessions/index.hbs +++ b/ui/admin/app/templates/scopes/scope/sessions/index.hbs @@ -68,76 +68,63 @@ {{#if @model}} - - - - {{t 'form.id.label'}} - {{t 'resources.user.title'}} - {{t 'resources.target.title'}} - {{t 'form.started.label'}} - {{t 'form.status.label'}} - {{t 'titles.actions'}} - - - - {{#each @model as |sessionAggregate|}} - - - + <:body as |B|> + + + + + {{B.data.session.id}} + + + + {{B.data.user.id}} + {{#if B.data.user.accountName}} +
+ + {{/if}} +
+ {{B.data.target.displayName}} + + + + + + + + {{#if (can 'cancel session' B.data.session)}} + - - {{sessionAggregate.session.id}} - -
- - {{sessionAggregate.user.id}} - {{#if sessionAggregate.user.accountName}} -
- - {{/if}} -
- {{sessionAggregate.target.displayName}} - - - - - - - - {{#if sessionAggregate.session.isAvailable}} - - {{t 'actions.cancel'}} - - {{/if}} - -
- {{/each}} -
-
+ {{/if}} + + + + {{else if (has-resource-filter-selections 'scopes.scope.sessions' 'status')