From 5f9c44d1fd3fc1593ca3b43d3dac768b06134f3f Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 2 Dec 2024 17:24:53 +0100 Subject: [PATCH] feat: Auto-select sessions in active session overview Often users only have one or two sessions and it's faster to unselect the sessions that are not needed. --- .../active-sessions.component.ts | 6 ++-- .../create-persistent-session.component.css | 13 ------- .../create-persistent-session.component.html | 34 +++++++++---------- .../create-persistent-session.component.ts | 1 - .../user-workspaces.component.html | 2 +- 5 files changed, 20 insertions(+), 36 deletions(-) delete mode 100644 frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.css diff --git a/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.component.ts b/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.component.ts index 046ce3da59..f88530dc25 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.component.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.component.ts @@ -64,14 +64,14 @@ export class ActiveSessionsComponent implements OnInit { ngOnInit(): void { this.userSessionService.sessions$.subscribe((sessions) => { - const selectedSessionIDs = new Set( - this.sessions.value?.filter((s) => s.selected).map((s) => s.id) ?? [], + const unselectedSessionIDs = new Set( + this.sessions.value?.filter((s) => !s.selected).map((s) => s.id) ?? [], ); this.sessions.next( sessions?.map((s) => ({ ...s, - selected: selectedSessionIDs.has(s.id), + selected: !unselectedSessionIDs.has(s.id), })), ); }); diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.css b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.css deleted file mode 100644 index f3134ad464..0000000000 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.css +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -form .mat-form-field { - width: 196px; -} - -.mat-card { - width: 450px; - max-width: 85vw; -} diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html index b02760b71a..622b9085a8 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html @@ -78,24 +78,22 @@

Persistent Workspace Session

} } -
- -
+ diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.ts index 8677383b96..30715c6d0f 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.ts @@ -33,7 +33,6 @@ import { CreateSessionHistoryComponent } from '../create-session-history/create- @Component({ selector: 'app-create-persistent-session', templateUrl: './create-persistent-session.component.html', - styleUrls: ['./create-persistent-session.component.css'], imports: [ FormsModule, ReactiveFormsModule, diff --git a/frontend/src/app/users/users-profile/user-workspaces/user-workspaces.component.html b/frontend/src/app/users/users-profile/user-workspaces/user-workspaces.component.html index 81c98b6526..84a299c9a7 100644 --- a/frontend/src/app/users/users-profile/user-workspaces/user-workspaces.component.html +++ b/frontend/src/app/users/users-profile/user-workspaces/user-workspaces.component.html @@ -16,7 +16,7 @@

User workspaces

} @else { @for (workspace of workspaces | async; track workspace.id) {