From 3caf81fc477c4099b38912aa05c0c1a9385814da Mon Sep 17 00:00:00 2001 From: NatashaKab <133793701+NatashaKab@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:26:08 -0400 Subject: [PATCH] Icu 10504 use hds table in desktop sessions list (#1823) 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 table in desktop sessions list * refactor: 💡 Added back the commit Zed mentioned * refactor: 💡 Added a comment for the session status class --------- Co-authored-by: Cameron Perera --- .../scopes/scope/projects/sessions/index.hbs | 133 ++++++++++-------- .../acceptance/projects/sessions-test.js | 2 +- 2 files changed, 76 insertions(+), 59 deletions(-) diff --git a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs index fb53511f8..59a2daf15 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs @@ -115,37 +115,53 @@ {{#if this.sorted}} - - - - {{t 'form.id.label'}} - {{t 'resources.target.title'}} - {{t 'form.proxy.label'}} - {{t 'form.started.label'}} - {{t 'form.status.label'}} - - - - - {{#each this.sorted as |model|}} - - - + + <:body as |B|> + + + {{#if (can 'read model' B.data)}} + {{#if B.data.isActive}} + + {{else}} + + {{/if}} - {{model.id}} + {{B.data.id}} - - {{model.target.displayName}} - - {{! + {{/if}} + + + {{B.data.target.displayName}} + + {{! Two if's here because: 1) Local proxy info is only relevant if the session is active or pending (aka isCancelable). Once the session @@ -156,39 +172,40 @@ from other devices (or even another tab), in which case we won't have the local proxy info available here. }} - {{#if model.isCancelable}} - {{#if model.proxy}} - - {{model.proxy}} - - {{/if}} + + {{#if B.data.isCancelable}} + {{#if B.data.proxy}} + + {{B.data.proxy}} + {{/if}} - - - - - - - - - {{#if model.isCancelable}} - - {{/if}} - - - {{/each}} - - + {{/if}} + + + + + + + + + {{#if B.data.isCancelable}} + + {{/if}} + + + + + {{else if (has-resource-filter-selections 'scopes.scope.projects.sessions' 'status' 'project' )}} diff --git a/ui/desktop/tests/acceptance/projects/sessions-test.js b/ui/desktop/tests/acceptance/projects/sessions-test.js index 920bfadba..9205c98fe 100644 --- a/ui/desktop/tests/acceptance/projects/sessions-test.js +++ b/ui/desktop/tests/acceptance/projects/sessions-test.js @@ -192,7 +192,7 @@ module('Acceptance | projects | sessions', function (hooks) { assert.expect(1); await visit(urls.sessions); assert.ok( - find('tbody tr:first-child th:first-child .session-status-active') + find('tbody tr:first-child td:first-child .session-status-active') ); });