From 84bfd0bf741df5f0d72345577261ca1cd192f032 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Tue, 17 Dec 2024 03:11:57 +0000 Subject: [PATCH 01/20] DOCS: Update README with AWS deployment instructions and environment setup --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/README.md b/README.md index e627bd7..aa552f9 100644 --- a/README.md +++ b/README.md @@ -1 +1,54 @@ # BGSI-GeneticAnalysisSupportPlatformIndonesia-GASPI + +## AMI Details for AWS based deployment + +``` +al2023-ami-2023.6.20241212.0-kernel-6.1-x86_64 +``` + +## Setting up environment in EC2 (Amazon Linux 2023) + +Install necessary tools + +```bash +RUN dnf update -y +RUN dnf install -y git docker +``` + +Start docker deamon and build the container + +```bash +sudo service docker start +sudo usermod -a -G docker ec2-user +sudo docker build --build-arg PLATFORM=linux/amd64 -t gaspi .devcontainer +``` + +Start the container + +```bash +sudo docker run --init --rm --privileged \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v `pwd`:`pwd` \ + -w `pwd` \ + --platform linux/x86_64 \ + -it gaspi:latest \ + /bin/bash +``` + +## Clone Source Code + +```bash +git clone https://github.com/GSI-Xapiens-CSIRO/BGSI-GeneticAnalysisSupportPlatformIndonesia-GASPI.git +git submodule init +git submodule update +``` + +## Initialisation + +Please run `init.sh` scripts in `svep` and `sbeacon` directories. Then run `pnpm install` from `webgui/webapp` directory. + +## Deployment + +```bash +terraform apply +``` From 993bd3bf31f64af3824ce3930aff30510d84eef8 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Tue, 17 Dec 2024 06:15:15 +0000 Subject: [PATCH 02/20] MAINT: sync sbeacon --- sbeacon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbeacon b/sbeacon index 1939bf4..e10fda2 160000 --- a/sbeacon +++ b/sbeacon @@ -1 +1 @@ -Subproject commit 1939bf4e49ee981663f0af751caf703885c898e7 +Subproject commit e10fda23c14e06337e6949d2510984838fdc47e5 From 6852a66fb8d2b51f7c9904977de7f6ef9e3971e3 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Wed, 18 Dec 2024 02:10:17 +0000 Subject: [PATCH 03/20] FIX: remove unnecessary mat-dialog-close attribute from access keys dialog --- .../access-keys-dialog/access-keys-dialog.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-notebook-list/access-keys-dialog/access-keys-dialog.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-notebook-list/access-keys-dialog/access-keys-dialog.component.html index d0cdd59..2bcf8c9 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-notebook-list/access-keys-dialog/access-keys-dialog.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-notebook-list/access-keys-dialog/access-keys-dialog.component.html @@ -41,7 +41,6 @@

Access Keys

+ +

These folders are held by active users.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Given Name{{ element.given_name }}Family Name{{ element.family_name }}Email{{ element.email }}Action + +
+ +@if (inactiveIdentities.length) { +

Folders not tracked under users

+

+ These folders either belong to past users and currently does not belong to + anyone. +

+ +
+ @for (identity of inactiveIdentities; track identity) { +
+ +
{{ identity }}
+
+ } +
+} diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.scss b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.spec.ts new file mode 100644 index 0000000..79e2a8a --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AdminFolderListComponent } from './admin-folder-list.component'; + +describe('AdminFolderListComponent', () => { + let component: AdminFolderListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [AdminFolderListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(AdminFolderListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.ts new file mode 100644 index 0000000..6ed685b --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.ts @@ -0,0 +1,83 @@ +import { Component, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatTableModule } from '@angular/material/table'; +import { catchError, of } from 'rxjs'; +import { DportalService } from 'src/app/services/dportal.service'; + +@Component({ + selector: 'app-admin-folder-list', + standalone: true, + imports: [ + MatSnackBarModule, + MatTableModule, + MatButtonModule, + MatIconModule, + MatDialogModule, + ], + templateUrl: './admin-folder-list.component.html', + styleUrl: './admin-folder-list.component.scss', +}) +export class AdminFolderListComponent implements OnInit { + displayedColumns: string[] = ['given_name', 'family_name', 'email', 'action']; + dataSource: any[] = []; + inactiveIdentities: any[] = []; + + constructor( + private dps: DportalService, + private sb: MatSnackBar, + private dg: MatDialog, + ) {} + + ngOnInit(): void { + this.list(); + } + + list() { + this.dps + .adminGetUserFolders() + .pipe(catchError(() => of(null))) + .subscribe((data) => { + if (!data) { + this.sb.open('Error fetching folders', 'close', { + duration: 60000, + }); + } else { + this.dataSource = data.active; + this.inactiveIdentities = data.inactive; + } + }); + } + + async deleteFolder(folder: string) { + const { ActionConfirmationDialogComponent } = await import( + 'src/app/components/action-confirmation-dialog/action-confirmation-dialog.component' + ); + + const dialog = this.dg.open(ActionConfirmationDialogComponent, { + data: { + title: 'Delete User Folder', + message: 'Are you sure you want to delete this user folder?', + }, + }); + + dialog.afterClosed().subscribe((result) => { + if (result) { + this.dps + .adminDeleteUserFolder(folder) + .pipe(catchError(() => of(null))) + .subscribe((data) => { + if (!data) { + this.sb.open('Error deleting folder', 'close', { + duration: 60000, + }); + } else { + this.list(); + } + }); + } + }); + } +} diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.html index cdde9d7..93f4df6 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.html @@ -1,18 +1,16 @@ -

Project Management

- - + - + @@ -22,6 +20,11 @@

Project Management

+ + + + +
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.ts index f4d64e4..f798b29 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-section.component.ts @@ -5,6 +5,7 @@ import { MatTabsModule } from '@angular/material/tabs'; import { ProjectsListComponent } from './projects-list/projects-list.component'; import { NotebooksComponent } from './admin-notebooks-list/admin-notebooks-list.component'; import { Router } from '@angular/router'; +import { AdminFolderListComponent } from './admin-folder-list/admin-folder-list.component'; @Component({ selector: 'app-admin-section', @@ -15,6 +16,7 @@ import { Router } from '@angular/router'; MatTabsModule, ProjectsListComponent, NotebooksComponent, + AdminFolderListComponent, ], templateUrl: './admin-section.component.html', styleUrl: './admin-section.component.scss', diff --git a/webgui/webapp/src/app/services/auth.service.ts b/webgui/webapp/src/app/services/auth.service.ts index 10380b5..51bbf41 100644 --- a/webgui/webapp/src/app/services/auth.service.ts +++ b/webgui/webapp/src/app/services/auth.service.ts @@ -73,7 +73,8 @@ export class AuthService { try { const creds = await Auth.currentCredentials(); let user = await Auth.currentAuthenticatedUser(); - console.log(user); + console.log('User', user); + console.log('Identity', creds.identityId); if (user.attributes['custom:identity_id'] != creds.identityId) { console.log('Updating identity_id'); diff --git a/webgui/webapp/src/app/services/dportal.service.ts b/webgui/webapp/src/app/services/dportal.service.ts index b841309..af26382 100644 --- a/webgui/webapp/src/app/services/dportal.service.ts +++ b/webgui/webapp/src/app/services/dportal.service.ts @@ -9,6 +9,29 @@ import { environment } from 'src/environments/environment'; export class DportalService { constructor() {} + // data portal admin user file actions + adminGetUserFolders() { + console.log('get user folders'); + return from( + API.get( + environment.api_endpoint_sbeacon.name, + 'dportal/admin/folders', + {}, + ), + ); + } + + adminDeleteUserFolder(folder: string) { + console.log('delete user folder'); + return from( + API.del( + environment.api_endpoint_sbeacon.name, + `dportal/admin/folders/${folder}`, + {}, + ), + ); + } + // data portal admin project actions adminCreateProject(name: string, description: string) { console.log('create project'); From c0d185c4aa6b73b25da3b957e56112d0cccb3e2e Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Mon, 23 Dec 2024 05:12:41 +0000 Subject: [PATCH 10/20] DEV: implement project management aspects as dialogs --- .../project-assignments-dialog.component.html | 38 +++++ ...project-assignments-dialog.component.scss} | 0 ...ject-assignments-dialog.component.spec.ts} | 10 +- .../project-assignments-dialog.component.ts} | 21 ++- .../project-assignments.component.html | 38 ----- .../project-update-dialog.component.html | 144 ++++++++++++++++++ .../project-update-dialog.component.scss | 4 + .../project-update-dialog.component.spec.ts | 22 +++ .../project-update-dialog.component.ts} | 33 ++-- .../project-updates.component.html | 133 ---------------- .../project-updates.component.spec.ts | 22 --- .../project-users-dialog.component.html | 48 ++++++ .../project-users-dialog.component.scss} | 0 .../project-users-dialog.component.spec.ts | 22 +++ .../project-users-dialog.component.ts} | 25 +-- .../project-users.component.html | 56 ------- .../project-users.component.spec.ts | 22 --- .../projects-list.component.html | 69 +++++---- .../projects-list/projects-list.component.ts | 50 +++++- .../user-management-dialog.component.html | 1 + .../user-management-dialog.component.scss} | 0 .../user-management-dialog.component.spec.ts | 23 +++ .../user-management-dialog.component.ts | 12 ++ 23 files changed, 449 insertions(+), 344 deletions(-) create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.html rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-assignments/project-assignments.component.scss => project-assignments-dialog/project-assignments-dialog.component.scss} (100%) rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-assignments/project-assignments.component.spec.ts => project-assignments-dialog/project-assignments-dialog.component.spec.ts} (52%) rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-assignments/project-assignments.component.ts => project-assignments-dialog/project-assignments-dialog.component.ts} (71%) delete mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.html create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.html create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.scss create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.spec.ts rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-updates/project-updates.component.ts => project-update-dialog/project-update-dialog.component.ts} (91%) delete mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.html delete mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.spec.ts create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.html rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-updates/project-updates.component.scss => project-users-dialog/project-users-dialog.component.scss} (100%) create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.spec.ts rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-users/project-users.component.ts => project-users-dialog/project-users-dialog.component.ts} (82%) delete mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.html delete mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.spec.ts create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.html rename webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/{project-users/project-users.component.scss => user-management-dialog/user-management-dialog.component.scss} (100%) create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.spec.ts create mode 100644 webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.ts diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.html new file mode 100644 index 0000000..64e48d5 --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.html @@ -0,0 +1,38 @@ +

Add new user to: {{ data.project }}

+
+
+ + Email + + A valid email is required + +
+ + +
+
+
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.scss b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.scss similarity index 100% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.scss rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.scss diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.spec.ts similarity index 52% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.spec.ts rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.spec.ts index fce118e..bdc0e11 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.spec.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.spec.ts @@ -1,17 +1,17 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProjectAssignmentsComponent } from './project-assignments.component'; +import { ProjectAssignmentsDialogComponent } from './project-assignments-dialog.component'; describe('ProjectAssignmentsComponent', () => { - let component: ProjectAssignmentsComponent; - let fixture: ComponentFixture; + let component: ProjectAssignmentsDialogComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ProjectAssignmentsComponent], + imports: [ProjectAssignmentsDialogComponent], }).compileComponents(); - fixture = TestBed.createComponent(ProjectAssignmentsComponent); + fixture = TestBed.createComponent(ProjectAssignmentsDialogComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.ts similarity index 71% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.ts rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.ts index 6542f67..f70384f 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments-dialog/project-assignments-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Inject, Input, Output } from '@angular/core'; import { FormControl, FormGroup, @@ -7,6 +7,11 @@ import { Validators, } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; @@ -25,25 +30,28 @@ import { DportalService } from 'src/app/services/dportal.service'; MatButtonModule, MatIconModule, MatSnackBarModule, + MatDialogModule, ], - templateUrl: './project-assignments.component.html', - styleUrl: './project-assignments.component.scss', + templateUrl: './project-assignments-dialog.component.html', + styleUrl: './project-assignments-dialog.component.scss', }) -export class ProjectAssignmentsComponent { - @Input({ required: true }) project!: string; +export class ProjectAssignmentsDialogComponent { + project: string; emailForm: FormGroup; constructor( private dps: DportalService, private sb: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: { project: string }, ) { + this.project = data.project; this.emailForm = new FormGroup({ email: new FormControl('', [Validators.required, Validators.email]), }); } submit(email: string) { - console.log(this.project, email); this.dps .adminAddUserToProject(this.project, email) .pipe(catchError(() => of(null))) @@ -57,6 +65,7 @@ export class ProjectAssignmentsComponent { duration: 60000, }); this.emailForm.reset(); + this.dialogRef.close(); } }); } diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.html deleted file mode 100644 index 0ac2232..0000000 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-assignments/project-assignments.component.html +++ /dev/null @@ -1,38 +0,0 @@ -

Add new user

-
-
- - Email - - A valid email is required - -
- - -
-
-
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.html new file mode 100644 index 0000000..d7b8337 --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.html @@ -0,0 +1,144 @@ +

View and update: {{ data.project.name }}

+
+
+ @for (file of project.files; track file) { +
+ +
{{ file }}
+
+ } @empty { +

No files added to the project yet

+ } +
+
+
+

Ingested datasets from the project to sBeacon

+
+ @for (dataset of project.ingestedDatasets; track dataset) { +
+ +
{{ dataset }}
+
+ } @empty { +

No datasets ingested yet

+ } +
+
+
+

Change project description and add extra files

+
+
+
+ + Project description + + A description is required. + + +
+
+

Following files will be added

+ @for (file of addedFiles; track $index) { +
+ +
+ {{ file.name }} + + {{ file.size / (1024 * 1024) | number: "1.3-3" }} MB +
+
+ } @empty { + + Added files will appear here. Please use unique file names within each + project. + +
+ } +

Following files will be removed

+ @for (file of removedFiles; track $index) { +
+ +
+ {{ file }} +
+
+ } @empty { + + Removed files will appear here. + +
+ } +
+
+ + + + +
+
+
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.scss b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.scss new file mode 100644 index 0000000..33ff03c --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.scss @@ -0,0 +1,4 @@ +:host { + display: block; + width: 800px; +} diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.spec.ts new file mode 100644 index 0000000..94abe12 --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProjectUpdateDialogComponent } from './project-update-dialog.component'; + +describe('ProjectUpdateDialogComponent', () => { + let component: ProjectUpdateDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ProjectUpdateDialogComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(ProjectUpdateDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.ts similarity index 91% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.ts index e7d06b2..4f3aa4f 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-update-dialog/project-update-dialog.component.ts @@ -1,9 +1,7 @@ import { Component, - EventEmitter, - Input, + Inject, OnChanges, - Output, SimpleChanges, ViewChild, } from '@angular/core'; @@ -26,7 +24,12 @@ import { catchError, defaultIfEmpty, forkJoin, map, of, switchMap } from 'rxjs'; import { Storage } from 'aws-amplify'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatInputModule } from '@angular/material/input'; -import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; @Component({ selector: 'app-project-updates', @@ -44,13 +47,12 @@ import { MatDialog, MatDialogModule } from '@angular/material/dialog'; MatProgressSpinnerModule, MatDialogModule, ], - templateUrl: './project-updates.component.html', - styleUrl: './project-updates.component.scss', + templateUrl: './project-update-dialog.component.html', + styleUrl: './project-update-dialog.component.scss', }) -export class ProjectUpdatesComponent implements OnChanges { - @Input({ required: true }) project!: Project; - @Output() projectUpdated = new EventEmitter(); +export class ProjectUpdateDialogComponent { @ViewChild(FileDropperComponent) fileDroppper!: FileDropperComponent; + project: Project; dataSubmissionForm!: FormGroup; totalSize = 0; progress = 0; @@ -63,12 +65,13 @@ export class ProjectUpdatesComponent implements OnChanges { private dps: DportalService, private sb: MatSnackBar, private dg: MatDialog, - ) {} - - ngOnChanges(changes: SimpleChanges): void { + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: { project: Project }, + ) { + this.project = data.project; this.dataSubmissionForm = this.fb.group({ projectDescription: this.fb.control( - changes['project'].currentValue.description, + this.project.description, Validators.required, ), }); @@ -110,7 +113,6 @@ export class ProjectUpdatesComponent implements OnChanges { }, ); } - this.projectUpdated.emit(); }); } }); @@ -216,9 +218,8 @@ export class ProjectUpdatesComponent implements OnChanges { this.sb.open('Project update failed', 'Okay', { duration: 60000 }); } else { this.sb.open('Project updated', 'Okay', { duration: 60000 }); - this.reset(); - this.projectUpdated.emit(); } + this.reset(); }); } } diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.html deleted file mode 100644 index f93edc4..0000000 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.html +++ /dev/null @@ -1,133 +0,0 @@ -

View project content and update

-
- @for (file of project.files; track file) { -
- -
{{ file }}
-
- } @empty { -

No files added to the project yet

- } -
-
-
-

Ingested datasets from the project to sBeacon

-
- @for (dataset of project.ingestedDatasets; track dataset) { -
- -
{{ dataset }}
-
- } @empty { -

No datasets ingested yet

- } -
-
-
-

Change project description and add extra files

-
-
-
- - Project description - - A description is required. - - -
-
-

Following files will be added

- @for (file of addedFiles; track $index) { -
- -
- {{ file.name }} - - {{ file.size / (1024 * 1024) | number: "1.3-3" }} MB -
-
- } @empty { - - Added files will appear here. Please use unique file names within each - project. - -
- } -

Following files will be removed

- @for (file of removedFiles; track $index) { -
- -
- {{ file }} -
-
- } @empty { - - Removed files will appear here. - -
- } -
-
- - - -
-
-
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.spec.ts deleted file mode 100644 index 7acfe28..0000000 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ProjectUpdatesComponent } from './project-updates.component'; - -describe('ProjectUpdatesComponent', () => { - let component: ProjectUpdatesComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ProjectUpdatesComponent], - }).compileComponents(); - - fixture = TestBed.createComponent(ProjectUpdatesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.html new file mode 100644 index 0000000..b5b30a5 --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.html @@ -0,0 +1,48 @@ +

Current users of: {{ data.project }}

+
+ @if (dataSource.data.length > 0) { + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First Name{{ element.firstName }}Last Name{{ element.lastName }}Email{{ element.email }}Actions +
+ +
+
+ } @else { +

No users added to the project

+ } + +
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.scss b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.scss similarity index 100% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.scss rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.scss diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.spec.ts new file mode 100644 index 0000000..b805a81 --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProjectUsersDialogComponent } from './project-users-dialog.component'; + +describe('ProjectUsersDialogComponent', () => { + let component: ProjectUsersDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ProjectUsersDialogComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(ProjectUsersDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.ts similarity index 82% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.ts rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.ts index 53317eb..f28fb2e 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users-dialog/project-users-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, EventEmitter, + Inject, Input, OnChanges, OnInit, @@ -8,7 +9,12 @@ import { SimpleChanges, } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; @@ -30,13 +36,13 @@ interface User { MatTableModule, MatSnackBarModule, MatDialogModule, + MatDialogModule, ], - templateUrl: './project-users.component.html', - styleUrl: './project-users.component.scss', + templateUrl: './project-users-dialog.component.html', + styleUrl: './project-users-dialog.component.scss', }) -export class ProjectsUsersComponent implements OnChanges { - @Input({ required: true }) project!: string; - +export class ProjectUsersDialogComponent { + project: string; displayedColumns: string[] = ['firstName', 'lastName', 'email', 'actions']; dataSource = new MatTableDataSource(); @@ -44,9 +50,10 @@ export class ProjectsUsersComponent implements OnChanges { private dps: DportalService, private sb: MatSnackBar, private dg: MatDialog, - ) {} - - ngOnChanges(_: SimpleChanges): void { + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: { project: string }, + ) { + this.project = data.project; this.list(); } diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.html deleted file mode 100644 index 878d824..0000000 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.html +++ /dev/null @@ -1,56 +0,0 @@ -

Current users

-
- -
-
-@if (dataSource.data.length > 0) { - - - - - - - - - - - - - - - - - - - - - - - - - - - -
First Name{{ element.firstName }}Last Name{{ element.lastName }}Email{{ element.email }}Actions -
- -
-
-} @else { -

No users added to the project

-} -
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.spec.ts deleted file mode 100644 index 62f2684..0000000 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ProjectsUsersComponent } from './project-users.component'; - -describe('ProjectsUsersComponent', () => { - let component: ProjectsUsersComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ProjectsUsersComponent], - }).compileComponents(); - - fixture = TestBed.createComponent(ProjectsUsersComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.html index 9fa2d48..c03710f 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.html @@ -42,21 +42,51 @@ - Assignments + + Actions + -
+
- + + + -
@@ -83,24 +113,3 @@

No projects found

refresh
-
-@if (active) { -

Manage users of project: {{ active.name }}

- -
- - -
- - -
- -} diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.ts index 07a3caa..44bbd71 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/projects-list.component.ts @@ -5,12 +5,10 @@ import { MatTableDataSource, MatTableModule } from '@angular/material/table'; import { MatButtonModule } from '@angular/material/button'; import { SpinnerService } from 'src/app/services/spinner.service'; import { MatSnackBar } from '@angular/material/snack-bar'; -import { catchError, of, tap } from 'rxjs'; +import { catchError, of } from 'rxjs'; import { MatIconModule } from '@angular/material/icon'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { ProjectAssignmentsComponent } from './project-assignments/project-assignments.component'; -import { ProjectsUsersComponent } from './project-users/project-users.component'; -import { ProjectUpdatesComponent } from './project-updates/project-updates.component'; +import { MatTooltipModule } from '@angular/material/tooltip'; export interface Project { name: string; @@ -29,9 +27,7 @@ export interface Project { MatButtonModule, MatIconModule, MatDialogModule, - ProjectAssignmentsComponent, - ProjectsUsersComponent, - ProjectUpdatesComponent, + MatTooltipModule, ], templateUrl: './projects-list.component.html', styleUrl: './projects-list.component.scss', @@ -97,6 +93,22 @@ export class ProjectsListComponent { }); } + async updateProject(project: Project) { + const { ProjectUpdateDialogComponent } = await import( + './project-update-dialog/project-update-dialog.component' + ); + + const dialog = this.dg.open(ProjectUpdateDialogComponent, { + data: { + project, + }, + }); + + dialog.afterClosed().subscribe((result) => { + this.list(); + }); + } + async index() { const { ActionConfirmationDialogComponent } = await import( '../../../../../components/action-confirmation-dialog/action-confirmation-dialog.component' @@ -161,6 +173,30 @@ export class ProjectsListComponent { }); } + async addUserDialog(project: any) { + const { ProjectAssignmentsDialogComponent } = await import( + './project-assignments-dialog/project-assignments-dialog.component' + ); + + this.dg.open(ProjectAssignmentsDialogComponent, { + data: { + project: project.name, + }, + }); + } + + async manageUsersDialog(project: any) { + const { ProjectUsersDialogComponent } = await import( + './project-users-dialog/project-users-dialog.component' + ); + + this.dg.open(ProjectUsersDialogComponent, { + data: { + project: project.name, + }, + }); + } + async ingest(project: any) { const { BeaconIngestDialogComponent } = await import( './beacon-ingest-dialog/beacon-ingest-dialog.component' diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.html new file mode 100644 index 0000000..eaf4d7c --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.html @@ -0,0 +1 @@ +

user-management-dialog works!

diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.scss b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.scss similarity index 100% rename from webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-users/project-users.component.scss rename to webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.scss diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.spec.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.spec.ts new file mode 100644 index 0000000..ffa111b --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserManagementDialogComponent } from './user-management-dialog.component'; + +describe('UserManagementDialogComponent', () => { + let component: UserManagementDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [UserManagementDialogComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(UserManagementDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.ts new file mode 100644 index 0000000..650f95f --- /dev/null +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/user-management-dialog/user-management-dialog.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-user-management-dialog', + standalone: true, + imports: [], + templateUrl: './user-management-dialog.component.html', + styleUrl: './user-management-dialog.component.scss' +}) +export class UserManagementDialogComponent { + +} From 91300beb4fbd5703e61589fee358fb3a0ff1a1e7 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Mon, 23 Dec 2024 05:47:33 +0000 Subject: [PATCH 11/20] FIX: change button color from primary to warn for delete actions --- .../filter-editor/filter-editor.component.html | 6 +++--- .../admin-folder-list/admin-folder-list.component.html | 4 ++-- .../admin-notebook-item.component.html | 4 ++-- .../data-submission-form.component.html | 2 +- .../project-update-dialog.component.html | 6 +++--- .../project-users-dialog.component.html | 10 ++++++---- .../user-file-list/user-file-list.component.html | 3 +-- .../notebook-item/notebook-item.component.html | 4 ++-- .../components/query-tab/query-tab.component.html | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/webgui/webapp/src/app/components/filter-editor/filter-editor.component.html b/webgui/webapp/src/app/components/filter-editor/filter-editor.component.html index d764878..5a76bd0 100644 --- a/webgui/webapp/src/app/components/filter-editor/filter-editor.component.html +++ b/webgui/webapp/src/app/components/filter-editor/filter-editor.component.html @@ -61,12 +61,12 @@ Filter Value -
+
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.html index e0015bd..a578d7a 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-folder-list/admin-folder-list.component.html @@ -35,7 +35,7 @@

Folders tracked under users

{{ identity }}
diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-notebooks-list/admin-notebook-item/admin-notebook-item.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-notebooks-list/admin-notebook-item/admin-notebook-item.component.html index 8bfa0c8..cc74bc1 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-notebooks-list/admin-notebook-item/admin-notebook-item.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/admin-notebooks-list/admin-notebook-item/admin-notebook-item.component.html @@ -21,12 +21,12 @@ @if (cachedStatus) {
@if (cachedStatus.status == Status.IN_SERVICE) { - } @if (cachedStatus.status == Status.STOPPED) { - } diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.html index 730051a..1db1de6 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.html @@ -29,7 +29,7 @@
{{ file }}
@@ -20,7 +20,7 @@

Ingested datasets from the project to sBeacon

diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-file-list/user-file-list.component.html b/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-file-list/user-file-list.component.html index e981284..c5343d6 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-file-list/user-file-list.component.html +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/user-section/user-file-list/user-file-list.component.html @@ -23,7 +23,6 @@

My Data

- @for (file of myFiles; track file) {
{{ file.key }}
@@ -39,7 +38,7 @@

My Data

} @@ -24,7 +24,7 @@ play_circle - } diff --git a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.html b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.html index 4c904bb..d470237 100644 --- a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.html +++ b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.html @@ -115,7 +115,7 @@

Select on from saved queries

style="transform: scale(0.7)" mat-mini-fab [routerLink]="[]" - color="primary" + color="warn" (click)="deleteSavedQuery(i)" > delete From c359336221768fddc0200eeb8f43baaed367c616 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Tue, 24 Dec 2024 00:51:08 +0000 Subject: [PATCH 12/20] FIX: Fix colour of id copyable button text in result tables --- .../filters-result-viewer.component.html | 5 +++-- .../filters-result-viewer.component.scss | 3 +++ .../tabular-query-results-viewer.component.html | 5 +++-- .../tabular-query-results-viewer.component.scss | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.html b/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.html index a82dc7f..72302d4 100644 --- a/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.html +++ b/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.html @@ -63,9 +63,10 @@

Filters

mat-button cdkCopyToClipboard="{{ element[column] }}" matTooltip="Click to copy" + class="w-full" > -
{{ element[column] }}
- content_copy + content_copy +
{{ element[column] }}
} @else {
{{ element[column] }}
diff --git a/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.scss b/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.scss index e69de29..f72c434 100644 --- a/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.scss +++ b/webgui/webapp/src/app/pages/portal-page/filters-page/components/filters-result-viewer/filters-result-viewer.component.scss @@ -0,0 +1,3 @@ +[mat-button] { + justify-content: flex-start; +} diff --git a/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.html b/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.html index 742de80..bec1d12 100644 --- a/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.html +++ b/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.html @@ -10,9 +10,10 @@ mat-button cdkCopyToClipboard="{{ element[column] }}" matTooltip="Click to copy" + class="w-full" > -
{{ element[column] }}
- content_copy + content_copy +
{{ element[column] }}
} @else if ( _.isString(element[column]) || _.isNumber(element[column]) diff --git a/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.scss b/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.scss index e69de29..f72c434 100644 --- a/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.scss +++ b/webgui/webapp/src/app/pages/portal-page/query-page/components/tabular-query-results-viewer/tabular-query-results-viewer.component.scss @@ -0,0 +1,3 @@ +[mat-button] { + justify-content: flex-start; +} From 69892f8fbc29ed4063dbe168a775e6c588d71268 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Tue, 24 Dec 2024 01:40:07 +0000 Subject: [PATCH 13/20] FIX: filter selection to accept projects from query view --- .../filter-selection-dialog.component.html | 23 ++++++++++++++----- .../filter-selection-dialog.component.ts | 9 ++++++-- .../query-tab/query-tab.component.ts | 3 ++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html index d4f31fa..1ab827e 100644 --- a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html +++ b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html @@ -1,8 +1,6 @@ -
-

- Select {{ _.startCase(data.type) }} filters for - {{ _.startCase(data.scope) }} -

+ +

Select {{ _.startCase(data.type) }} filters for {{ _.startCase(data.scope) }}

+@if (data.projects.length > 0) {
@@ -64,4 +62,17 @@

-
+} @else { +
+

Please select some projects.

+ + +
+} diff --git a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.ts b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.ts index bf9e2a6..9e15b0a 100644 --- a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.ts +++ b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.ts @@ -89,17 +89,21 @@ export class FilterSelectionDialogComponent implements AfterViewInit { protected dataSourceFilters = new MatTableDataSource([]); protected displayedColumnsFilters = ['selected', 'id', 'label', 'type']; protected selected: { [key: string]: any } = {}; - protected filter = ''; + protected filter: string = ''; constructor( public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any, + @Inject(MAT_DIALOG_DATA) + public data: { scope: string; projects: string[]; type: string }, private fs: FilterService, private cd: ChangeDetectorRef, private sb: MatSnackBar, ) {} ngAfterViewInit(): void { + if (this.data.projects.length === 0) { + return; + } this.paginatorFilters.page .pipe( startWith({}), @@ -111,6 +115,7 @@ export class FilterSelectionDialogComponent implements AfterViewInit { .fetch_by_scope(this.data.scope, { skip: this.limit * this.paginatorFilters.pageIndex, limit: this.limit, + projects: this.data.projects.join(','), }) .pipe(catchError(() => of(null))); }), diff --git a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts index d3c8c92..b5e9e32 100644 --- a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts @@ -580,11 +580,12 @@ export class QueryTabComponent implements OnInit, AfterViewInit, OnDestroy { async searchFilters(filter: FormGroup, index: number) { const scope = filter.get('scope')!.value; const type = filter.get('type')!.value; + const projects = this.form.get('projects')!.value; const { FilterSelectionDialogComponent } = await import( 'src/app/components/filter-selection-dialog/filter-selection-dialog.component' ); const dialog = this.dg.open(FilterSelectionDialogComponent, { - data: { scope, type }, + data: { scope, type, projects }, }); dialog.afterClosed().subscribe((filters) => { From 989759d04987f7e3a5c93c032be760b566be1120 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Tue, 24 Dec 2024 02:07:35 +0000 Subject: [PATCH 14/20] FIX: enable ID with project list flowing to entity selection dialog --- .../entry-id-selection-dialog.component.html | 31 ++++++++++++------- .../entry-id-selection-dialog.component.ts | 11 ++++--- .../filter-selection-dialog.component.html | 1 - .../query-tab/query-tab.component.ts | 5 +-- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.html b/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.html index a86ccc9..047ae12 100644 --- a/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.html +++ b/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.html @@ -1,11 +1,10 @@ -
-

- Select a {{ _.startCase(data.scope) }} entry -

+ +

Select a {{ _.startCase(data.scope) }} entry

+@if (data.projects.length > 0) {
- +
@for (column of displayedColumnsEntries; track column) {
) {
{{ element[column] }}
} @else { - #showJSON;| - } - - + } } @case ("selected") { @@ -55,12 +51,13 @@


- @if (!entries.length && !loading) { + @if (!dataSourceEntries.data.length && !loading) {

No entries available in the selected scope

}
@@ -75,4 +72,16 @@

- +} @else { +
+

Please select some projects.

+ +
+} diff --git a/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.ts b/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.ts index ac3cfdd..d1f2647 100644 --- a/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.ts +++ b/webgui/webapp/src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component.ts @@ -57,19 +57,21 @@ export class EntryIdSelectionDialogComponent { protected skip = 0; protected limit = 0; protected total = 0; - protected entries: any = []; protected dataSourceEntries = new MatTableDataSource([]); protected displayedColumnsEntries: string[] = []; protected selected: string | null = null; constructor( public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any, + @Inject(MAT_DIALOG_DATA) public data: { scope: string; projects: string[] }, private qs: QueryService, private cd: ChangeDetectorRef, ) {} ngAfterViewInit(): void { + if (this.data.projects.length === 0) { + return; + } this.paginator.page .pipe( startWith({}), @@ -79,6 +81,7 @@ export class EntryIdSelectionDialogComponent { this.limit = this.paginator.pageSize; return this.qs .fetch(this.data.scope, { + projects: this.data.projects, query: { filters: [], requestedGranularity: 'record', @@ -109,7 +112,7 @@ export class EntryIdSelectionDialogComponent { ? results.response.collections : results.response.resultSets[0].results; - if (this.entries.length && _.isEmpty(resultsArray)) { + if (this.dataSourceEntries.data.length && _.isEmpty(resultsArray)) { this.paginator.pageIndex -= 1; console.log('page out of bounds'); } else { @@ -121,7 +124,7 @@ export class EntryIdSelectionDialogComponent { idName, ..._.filter(_.keys(resultsArray[0]), (item) => item != idName), ]; - this.entries = resultsArray; + this.dataSourceEntries = new MatTableDataSource(resultsArray); } }); } diff --git a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html index 1ab827e..7ddb8a3 100644 --- a/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html +++ b/webgui/webapp/src/app/components/filter-selection-dialog/filter-selection-dialog.component.html @@ -73,6 +73,5 @@

Select {{ _.startCase(data.type) }} filters for Cancel - } diff --git a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts index b5e9e32..3b7371a 100644 --- a/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/query-page/components/query-tab/query-tab.component.ts @@ -580,7 +580,7 @@ export class QueryTabComponent implements OnInit, AfterViewInit, OnDestroy { async searchFilters(filter: FormGroup, index: number) { const scope = filter.get('scope')!.value; const type = filter.get('type')!.value; - const projects = this.form.get('projects')!.value; + const projects = this.form.value.projects; const { FilterSelectionDialogComponent } = await import( 'src/app/components/filter-selection-dialog/filter-selection-dialog.component' ); @@ -610,6 +610,7 @@ export class QueryTabComponent implements OnInit, AfterViewInit, OnDestroy { async searchEntries() { const scope = this.form.value.scope; + const projects = this.form.value.projects; if (scope === ScopeTypes.GENOMIC_VARIANTS) { alert( @@ -621,7 +622,7 @@ export class QueryTabComponent implements OnInit, AfterViewInit, OnDestroy { 'src/app/components/entry-id-selection-dialog/entry-id-selection-dialog.component' ); const dialog = this.dg.open(EntryIdSelectionDialogComponent, { - data: { scope }, + data: { scope, projects }, }); dialog.afterClosed().subscribe((entry) => { From ae61febcc1ff5b2daeaf43252e537babc62b4480 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Thu, 2 Jan 2025 00:12:55 +0000 Subject: [PATCH 15/20] FIX: enable preloading of all modules in router configuration --- webgui/webapp/src/app/app.config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webgui/webapp/src/app/app.config.ts b/webgui/webapp/src/app/app.config.ts index 7760484..f0bdf4c 100644 --- a/webgui/webapp/src/app/app.config.ts +++ b/webgui/webapp/src/app/app.config.ts @@ -4,6 +4,8 @@ import { DetachedRouteHandle, RouteReuseStrategy, provideRouter, + withPreloading, + PreloadAllModules, } from '@angular/router'; import { routes } from './app.routes'; @@ -64,7 +66,7 @@ export class CustomReuseStrategy implements RouteReuseStrategy { export const appConfig: ApplicationConfig = { providers: [ - provideRouter(routes), + provideRouter(routes, withPreloading(PreloadAllModules)), provideAnimations(), { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, From f44688c7a67cf0ccc68c6d2e3d9a83ccd47a0046 Mon Sep 17 00:00:00 2001 From: NickEdwards7502 Date: Tue, 7 Jan 2025 03:05:34 +0000 Subject: [PATCH 16/20] DEV: Upload project files with staging prefix from frontend * Sync with sbeacon upstream --- sbeacon | 2 +- .../data-submission-form/data-submission-form.component.ts | 2 +- .../projects-list/project-updates/project-updates.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sbeacon b/sbeacon index b6aa1cd..b6ce582 160000 --- a/sbeacon +++ b/sbeacon @@ -1 +1 @@ -Subproject commit b6aa1cd6c6e51ad4c02ea1851c7cb339724917a4 +Subproject commit b6ce582bd7e012673d266344e5a1b415a4e69380 diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts index 41b332f..269f244 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts @@ -62,7 +62,7 @@ export class DataSubmissionFormComponent { async uploadFile(path: string, file: File): Promise { this.fileProgress.set(file.name, 0); try { - await Storage.put(`projects/${path}/${file.name}`, file, { + await Storage.put(`/staging/projects/${path}/${file.name}`, file, { customPrefix: { public: '' }, progressCallback: (progress: { loaded: number; total: number }) => { this.fileProgress.set(file.name, progress.loaded); diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts index e7d06b2..14c8050 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/projects-list/project-updates/project-updates.component.ts @@ -166,7 +166,7 @@ export class ProjectUpdatesComponent implements OnChanges { async uploadFile(path: string, file: File): Promise { this.fileProgress.set(file.name, 0); try { - await Storage.put(`projects/${path}/${file.name}`, file, { + await Storage.put(`staging/projects/${path}/${file.name}`, file, { customPrefix: { public: '' }, progressCallback: (progress: { loaded: number; total: number }) => { this.fileProgress.set(file.name, progress.loaded); From 6a552062dfe4bf2693b07588c6224f2a2883df15 Mon Sep 17 00:00:00 2001 From: NickEdwards7502 Date: Fri, 10 Jan 2025 00:22:05 +0000 Subject: [PATCH 17/20] MAINT: Sync with sBeacon upstream --- sbeacon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbeacon b/sbeacon index b6ce582..c683636 160000 --- a/sbeacon +++ b/sbeacon @@ -1 +1 @@ -Subproject commit b6ce582bd7e012673d266344e5a1b415a4e69380 +Subproject commit c6836369c6122e1b7663f35363fde19c4aa775ab From bbd38f9b858fa7dea5dc7e7a870aa952047fe336 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Fri, 10 Jan 2025 01:13:20 +0000 Subject: [PATCH 18/20] MAINT: Update subproject commit reference in sbeacon --- sbeacon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbeacon b/sbeacon index c683636..5df56d5 160000 --- a/sbeacon +++ b/sbeacon @@ -1 +1 @@ -Subproject commit c6836369c6122e1b7663f35363fde19c4aa775ab +Subproject commit 5df56d553073c34fa80e00d164b40dbdb3243a48 From 1dbd75cf9d0c2d2f7986763966cca88dcbc1186d Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Fri, 10 Jan 2025 01:21:27 +0000 Subject: [PATCH 19/20] FIX: Add managers field to admin user click dialog form --- .../admin-user-click-dialog.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webgui/webapp/src/app/pages/admin-page/components/admin-user-click-dialog/admin-user-click-dialog.component.ts b/webgui/webapp/src/app/pages/admin-page/components/admin-user-click-dialog/admin-user-click-dialog.component.ts index 7ce2471..bc5b86d 100644 --- a/webgui/webapp/src/app/pages/admin-page/components/admin-user-click-dialog/admin-user-click-dialog.component.ts +++ b/webgui/webapp/src/app/pages/admin-page/components/admin-user-click-dialog/admin-user-click-dialog.component.ts @@ -74,6 +74,7 @@ export class AdminUserClickDialogComponent implements OnInit { ) { this.form = this.fb.group({ administrators: [false], + managers: [false], quotaSize: ['', [Validators.required, Validators.min(0)]], quotaQueryCount: ['', [Validators.required, Validators.min(0)]], }); @@ -204,7 +205,7 @@ export class AdminUserClickDialogComponent implements OnInit { } updateUser() { - const groups = _.pick(this.form.value, ['administrators']); + const groups = _.pick(this.form.value, ['administrators', 'managers']); return this.as .updateUsersGroups(this.data.email, groups) .pipe(catchError(() => of(null))); From 6ba252eb4f953b15a2abb0a2fdad11663991e58a Mon Sep 17 00:00:00 2001 From: NickEdwards7502 Date: Fri, 10 Jan 2025 03:58:46 +0000 Subject: [PATCH 20/20] FIX: Correct staging prefix for file upload on project creation * Sync with sbeacon upstream --- sbeacon | 2 +- .../data-submission-form/data-submission-form.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbeacon b/sbeacon index 5df56d5..6eaff40 160000 --- a/sbeacon +++ b/sbeacon @@ -1 +1 @@ -Subproject commit 5df56d553073c34fa80e00d164b40dbdb3243a48 +Subproject commit 6eaff40d91c737f14169971027f8d2e9ec56271c diff --git a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts index 16f85e1..65c5db2 100644 --- a/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts +++ b/webgui/webapp/src/app/pages/portal-page/dportal-page/admin-section/data-submission-form/data-submission-form.component.ts @@ -63,7 +63,7 @@ export class DataSubmissionFormComponent { async uploadFile(path: string, file: File): Promise { this.fileProgress.set(file.name, 0); try { - await Storage.put(`/staging/projects/${path}/${file.name}`, file, { + await Storage.put(`staging/projects/${path}/${file.name}`, file, { customPrefix: { public: '' }, progressCallback: (progress: { loaded: number; total: number }) => { this.fileProgress.set(file.name, progress.loaded);