From ade1601d8d533d620feddba6469b69df431a2315 Mon Sep 17 00:00:00 2001 From: Devon Anderson Date: Thu, 14 Dec 2023 17:27:09 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Refactor=20`sessions?= =?UTF-8?q?-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 699de8ac1..3dd3daa5d 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 604dee22e..a12b0f71a 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')