From bb33cc33a2af9fc4a3d7350a6d31a7eb9df5fd65 Mon Sep 17 00:00:00 2001 From: Neethika Prathigadapa Date: Wed, 18 Feb 2026 19:56:08 -0500 Subject: [PATCH] feat(workspace): enhance dashboard actions and workspace details (ref Sentinent-AI/Sentinent#4) --- src/app/components/dashboard/dashboard.css | 41 ++++++++++++++----- src/app/components/dashboard/dashboard.html | 20 ++++----- src/app/components/dashboard/dashboard.ts | 35 ++++++++++++++++ .../components/workspace/create-workspace.css | 5 ++- .../workspace/create-workspace.html | 10 +++++ .../components/workspace/create-workspace.ts | 3 +- src/app/services/workspace.ts | 21 +++++++++- 7 files changed, 109 insertions(+), 26 deletions(-) diff --git a/src/app/components/dashboard/dashboard.css b/src/app/components/dashboard/dashboard.css index ef75673..bc498af 100644 --- a/src/app/components/dashboard/dashboard.css +++ b/src/app/components/dashboard/dashboard.css @@ -55,17 +55,6 @@ place-items: center; } -nav { - display: flex; - align-items: center; - gap: 20px; -} - -.workspace-card-link { - text-decoration: none; - color: inherit; -} - .logout-btn { border: 1px solid rgba(255, 255, 255, 0.24); background: transparent; @@ -158,6 +147,36 @@ nav { letter-spacing: 0.04em; } +.card-actions { + margin-top: 14px; + display: flex; + gap: 8px; +} + +.action-btn { + border-radius: 8px; + border: 1px solid #d0d0d0; + padding: 7px 12px; + font-size: 13px; + cursor: pointer; + background: #fff; + color: #111; +} + +.edit-btn:hover { + background: #f3f3f3; +} + +.delete-btn { + border-color: #2b2b2b; + background: #111; + color: #fff; +} + +.delete-btn:hover { + background: #000; +} + .empty-state { border: 1px dashed #bcbcbc; border-radius: 12px; diff --git a/src/app/components/dashboard/dashboard.html b/src/app/components/dashboard/dashboard.html index e624684..01266c9 100644 --- a/src/app/components/dashboard/dashboard.html +++ b/src/app/components/dashboard/dashboard.html @@ -27,18 +27,16 @@

Your Workspaces

Create Workspace -
- -
-

{{ ws.name }}

-

{{ ws.description }}

- Created: {{ ws.createdDate | date }} +
- -
-

No workspaces found. Create one to get started!

+
diff --git a/src/app/components/dashboard/dashboard.ts b/src/app/components/dashboard/dashboard.ts index 453e81f..ccd9b38 100644 --- a/src/app/components/dashboard/dashboard.ts +++ b/src/app/components/dashboard/dashboard.ts @@ -25,6 +25,41 @@ export class Dashboard implements OnInit { }); } + editWorkspace(workspace: Workspace) { + const updatedName = window.prompt('Edit workspace name', workspace.name)?.trim(); + if (!updatedName) { + return; + } + + const updatedDescriptionInput = window.prompt('Edit workspace description', workspace.description ?? ''); + if (updatedDescriptionInput === null) { + return; + } + + const updatedDescription = updatedDescriptionInput.trim(); + + this.workspaceService.updateWorkspace(workspace.id, updatedName, updatedDescription).subscribe(updatedWorkspace => { + if (!updatedWorkspace) { + return; + } + this.workspaces = this.workspaces.map(ws => ws.id === updatedWorkspace.id ? updatedWorkspace : ws); + }); + } + + deleteWorkspace(workspace: Workspace) { + const confirmed = window.confirm(`Delete workspace "${workspace.name}"?`); + if (!confirmed) { + return; + } + + this.workspaceService.deleteWorkspace(workspace.id).subscribe(deleted => { + if (!deleted) { + return; + } + this.workspaces = this.workspaces.filter(ws => ws.id !== workspace.id); + }); + } + logout() { this.authService.logout(); this.router.navigate(['/login']); diff --git a/src/app/components/workspace/create-workspace.css b/src/app/components/workspace/create-workspace.css index e8cdb50..4de2a73 100644 --- a/src/app/components/workspace/create-workspace.css +++ b/src/app/components/workspace/create-workspace.css @@ -28,10 +28,13 @@ label { font-weight: 600; } -input { +input, +textarea { padding: 10px 12px; border: 1px solid #d0d7de; border-radius: 6px; + font: inherit; + resize: vertical; } .actions { diff --git a/src/app/components/workspace/create-workspace.html b/src/app/components/workspace/create-workspace.html index a02bd2e..b7725db 100644 --- a/src/app/components/workspace/create-workspace.html +++ b/src/app/components/workspace/create-workspace.html @@ -14,6 +14,16 @@

Create Workspace

placeholder="e.g. Product Team" /> + + +