Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8ec8598
feat: make configurable action buttons shared component
martin-trajanovski Aug 25, 2025
b562e62
more general naming in the component inputs and add new action type xhr
martin-trajanovski Aug 26, 2025
f5093d7
Merge branch 'master' into SWAP-4889-configurable-action-buttons
martin-trajanovski Aug 26, 2025
6f16350
add the configurable buttons in the dataset selection view
martin-trajanovski Aug 26, 2025
3f4de3f
Merge branch 'master' into SWAP-4889-configurable-action-buttons
martin-trajanovski Aug 29, 2025
fdcc888
Resolved conflicts after merging master
nitrosx Sep 10, 2025
ffc3bcb
WIP of the day
nitrosx Sep 11, 2025
b31492a
work of the day
nitrosx Sep 15, 2025
08ce450
Merge branch 'master' of https://github.com/SciCatProject/frontend in…
martin-trajanovski Sep 16, 2025
aace2ef
Merge branch 'SWAP-4889-configurable-action-buttons' of https://githu…
nitrosx Sep 16, 2025
575ecac
first draft of configurable actions
nitrosx Oct 9, 2025
f7b044d
saving work done so far
nitrosx Nov 6, 2025
4816ee8
fixed linting
nitrosx Nov 12, 2025
af2d7fe
merged with master
nitrosx Nov 12, 2025
e6d5f49
solving conflicts and fixing tests
nitrosx Nov 13, 2025
89d790a
fixing tests
nitrosx Nov 13, 2025
66a76eb
added data file for testing configurable actions
nitrosx Nov 13, 2025
1567cc6
resolving merge issues
nitrosx Nov 13, 2025
a7b12cf
fixed all issues with standalone properties
nitrosx Nov 13, 2025
1b6c5c5
Fixed all the tests for configurable actions
nitrosx Nov 18, 2025
3c396df
fixing linting
nitrosx Nov 18, 2025
53a95fe
completed linting
nitrosx Nov 19, 2025
738210a
solved conflicts and merged master
nitrosx Nov 19, 2025
4b57a5e
Fixed test for actions
nitrosx Nov 19, 2025
c9a6fd3
Added AI generated documentation
nitrosx Nov 19, 2025
edede4b
Added notes about AI generation
nitrosx Nov 19, 2025
752ba77
import missing model and remove incorrect bindings
Junjiequan Nov 19, 2025
97a620a
include fallback for sortedActionsConfig() function
Junjiequan Nov 19, 2025
efcfc5a
minor fix
Junjiequan Nov 19, 2025
0d100af
resolve budget exceeding error
Junjiequan Nov 19, 2025
f1b7ea3
fix unit test
Junjiequan Nov 20, 2025
1077303
restored original actions on datasets list and selection
nitrosx Nov 20, 2025
672fbf6
Fixed CI configurable actions config, fixed errors from configuration
nitrosx Nov 21, 2025
f97d85b
fixed linting
nitrosx Nov 21, 2025
1a989b7
fix published-data e2e flaky selector
Junjiequan Nov 24, 2025
892c98d
fix published-data flaky selector
Junjiequan Nov 24, 2025
66d4598
Merge branch 'master' into SWAP-4889-configurable-action-buttons
Junjiequan Nov 24, 2025
fc642ea
enable cypress video
Junjiequan Nov 24, 2025
479cf1c
fix published-data e2e test
Junjiequan Nov 24, 2025
11d2017
fix unit test
Junjiequan Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"name": "Debug SciCat frontend in Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceFolder}"
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"trace": true
},
{
"name": "ng test",
Expand Down
81 changes: 80 additions & 1 deletion CI/e2e/frontend.config.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"ingestManual": null,
"jobsEnabled": true,
"jsonMetadataEnabled": true,
"jupyterHubUrl": "",
"landingPage": "doi.ess.eu/detail/",
"lbBaseURL": "http://localhost:3000",
"logbookEnabled": true,
Expand Down Expand Up @@ -106,6 +105,86 @@
"authorization": ["#datasetAccess", "#datasetPublic"]
}
],
"datasetDetailsActionsEnabled": true,
"datasetDetailsActions": [
{
"id": "01",
"order": 1,
"type": "xhr",
"method": "PATCH",
"description": "Publish dataset",
"label": "Publish",
"hidden": "#isPublished",
"mat_icon": "",
"url": "/api/v3/datasets/{{id}}",
"payload": "{\"isPublished\": true}"
},
{
"id": "02",
"order": 2,
"type": "xhr",
"method": "PATCH",
"description": "Unpublish published dataset",
"label": "Unpublish",
"hidden": "#!isPublished",
"mat_icon": "",
"url": "/api/v3/datasets/{{id}}",
"payload": "{\"isPublished\": false}"
},
{
"id": "03",
"order": 3,
"type": "form",
"method": "GET",
"description": "Jupyter hub",
"label": "Jupyter hub",
"mat_icon": "",
"url": "https://jupyterhub.esss.lu.se/",
"target": "_blank"
}
],
"datasetSelectionActionsEnabled": true,
"datasetSelectionActions": [
{
"id": "01",
"order": 1,
"type": "link",
"description": "Publish datasets",
"label": "Publish",
"mat_icon": "school",
"url": "/datasets/batch/publish"
},
{
"id": "02",
"order": 2,
"type": "link",
"description": "Share datasets",
"label": "Share",
"mat_icon": "share",
"url": "/datasets/batch?share=true"
},
{
"id": "03",
"order": 3,
"type": "link",
"hidden": "!archiveWorkflowEnabled",
"description": "Retrieve datasets",
"label": "Retrieve",
"mat_icon": "cloud_download",
"url": "/datasets/batch?retrieve=true"
}
],
"labelMaps": {
"filters": {
"LocationFilter": "Location",
"PidFilter": "Pid",
"GroupFilter": "Group",
"TypeFilter": "Type",
"KeywordFilter": "Keyword",
"DateRangeFilter": "Start Date - End Date",
"TextFilter": "Text"
}
},
"defaultDatasetsListSettings": {
"columns": [
{
Expand Down
54 changes: 8 additions & 46 deletions src/app/app-config.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,52 +77,14 @@ const appConfig: AppConfigInterface = {
datasetDetailsShowMissingProposalId: true,
helpMessages: new HelpMessages(),
notificationInterceptorEnabled: true,
datafilesActionsEnabled: true,
datafilesActions: [
{
id: "eed8efec-4354-11ef-a3b5-d75573a5d37f",
order: 4,
label: "Download All",
files: "all",
mat_icon: "download",
url: "",
target: "_blank",
enabled: "#SizeLimit",
authorization: ["#datasetAccess", "#datasetPublic"],
},
{
id: "3072fafc-4363-11ef-b9f9-ebf568222d26",
order: 3,
label: "Download Selected",
files: "selected",
mat_icon: "download",
url: "",
target: "_blank",
enabled: "#Selected && #SizeLimit",
authorization: ["#datasetAccess", "#datasetPublic"],
},
{
id: "4f974f0e-4364-11ef-9c63-03d19f813f4e",
order: 2,
label: "Notebook All",
files: "all",
icon: "/assets/icons/jupyter_logo.png",
url: "",
target: "_blank",
authorization: ["#datasetAccess", "#datasetPublic"],
},
{
id: "fa3ce6ee-482d-11ef-95e9-ff2c80dd50bd",
order: 1,
label: "Notebook Selected",
files: "selected",
icon: "/assets/icons/jupyter_logo.png",
url: "",
target: "_blank",
enabled: "#Selected",
authorization: ["#datasetAccess", "#datasetPublic"],
},
],
datasetActionsEnabled: false,
datasetActions: [],
datasetDetailsActionsEnabled: false,
datasetDetailsActions: [],
datafilesActionsEnabled: false,
datafilesActions: [],
datasetSelectionActionsEnabled: false,
datasetSelectionActions: [],
defaultDatasetsListSettings: {
columns: [
{
Expand Down
6 changes: 6 additions & 0 deletions src/app/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ export interface AppConfigInterface {
datasetJsonScientificMetadata: boolean;
datasetReduceEnabled: boolean;
datasetDetailsShowMissingProposalId: boolean;
datasetActionsEnabled: boolean;
datasetActions: any[];
datafilesActionsEnabled: boolean;
datafilesActions: any[];
datasetDetailsActionsEnabled: boolean;
datasetDetailsActions: any[];
datasetSelectionActionsEnabled: boolean;
datasetSelectionActions: any[];
editDatasetEnabled: boolean;
editDatasetSampleEnabled: boolean;
editMetadataEnabled: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/app/app-routing/redirecting.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ import { Component } from "@angular/core";
}
`,
],
standalone: false,
})
export class RedirectingComponent {}
94 changes: 9 additions & 85 deletions src/app/datasets/batch-view/batch-view.component.html
Original file line number Diff line number Diff line change
@@ -1,93 +1,17 @@
<div style="margin-top: 1em">
<div *ngIf="hasBatch; else empty_batch">
<div style="text-align: right; margin-bottom: 1em">
<div *ngIf="editingPublishedDataDoi">
You are currently editing
<a (click)="onCancelEdit()">{{ editingPublishedDataDoi }}</a>
dataset list.
</div>
<button
*ngIf="editingPublishedDataDoi"
mat-button
id="changeSelectionButton"
(click)="onChangeSelection()"
class="button"
color="primary"
>
<mat-icon> edit </mat-icon>
Select new datasets
</button>
<button
*ngIf="editingPublishedDataDoi"
mat-button
id="saveChangesButton"
(click)="onSaveChanges()"
class="button"
color="primary"
>
<mat-icon> save </mat-icon>
Save Changes
</button>
<button
*ngIf="editingPublishedDataDoi"
mat-button
id="cancelButton"
(click)="onCancelEdit()"
class="button"
color="warn"
>
<mat-icon> close </mat-icon>
Cancel
</button>
<button
*ngIf="!editingPublishedDataDoi"
(click)="onEmpty()"
mat-button
class="button"
color="primary"
>
<div class="batch-actions" fxLayout="row" fxLayoutAlign="end center">
<!--
<configurable-actions
[actionsConfig]="appConfig.datasetSelectionActions"
[actionItems]="datasetList"
[visible]="appConfig.datasetSelectionActionsEnabled"
></configurable-actions>
-->
<button (click)="onEmpty()" mat-button class="button" color="primary">
<mat-icon> remove_shopping_cart </mat-icon>
Empty Cart
</button>
<button
*ngIf="!editingPublishedDataDoi"
mat-button
id="publishButton"
(click)="onPublish()"
class="button"
color="primary"
>
<mat-icon> school </mat-icon>
Publish
</button>
<ng-container *ngIf="shareEnabled">
<button
*ngIf="!editingPublishedDataDoi"
mat-button
(click)="onShare()"
id="shareButton"
class="button"
color="primary"
>
<mat-icon> share </mat-icon>
Share
</button>
</ng-container>
<ng-container *ngIf="appConfig.archiveWorkflowEnabled">
<button mat-button (click)="onArchive()" class="button" color="primary">
<mat-icon> archive </mat-icon>
Archive
</button>
<button
mat-button
(click)="onRetrieve()"
class="button"
color="primary"
>
<mat-icon> cloud_download </mat-icon>
Retrieve
</button>
</ng-container>
</div>

<mat-table
Expand Down
32 changes: 31 additions & 1 deletion src/app/datasets/batch-view/batch-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Message, MessageType } from "state-management/models";
import { showMessageAction } from "state-management/actions/user.actions";
import { DialogComponent } from "shared/modules/dialog/dialog.component";

import { Router } from "@angular/router";
import { ActivatedRoute, Router } from "@angular/router";
import { ArchivingService } from "../archiving.service";
import { Observable, Subscription, combineLatest } from "rxjs";
import { MatDialog } from "@angular/material/dialog";
Expand All @@ -39,6 +39,7 @@ export class BatchViewComponent implements OnInit, OnDestroy {
);
userProfile$ = this.store.select(selectProfile);
isAdmin$ = this.store.select(selectIsAdmin);
params$ = this.route.queryParams;
isAdmin = false;
userProfile: any = {};
subscriptions: Subscription[] = [];
Expand All @@ -57,6 +58,7 @@ export class BatchViewComponent implements OnInit, OnDestroy {
private store: Store,
private archivingSrv: ArchivingService,
private router: Router,
private route: ActivatedRoute,
) {}

private clearBatch() {
Expand All @@ -83,6 +85,13 @@ export class BatchViewComponent implements OnInit, OnDestroy {
this.router.navigate(["datasets", "selection", "publish"]);
}

onShareClick() {
this.router.navigate([], {
queryParams: { share: "true" },
queryParamsHandling: "merge",
});
}

onShare() {
const shouldHaveInfoMessage =
!this.isAdmin &&
Expand Down Expand Up @@ -157,6 +166,11 @@ export class BatchViewComponent implements OnInit, OnDestroy {
);
this.store.dispatch(showMessageAction({ message }));
}

this.router.navigate([], {
queryParams: { share: null },
queryParamsHandling: "merge",
});
});
}

Expand Down Expand Up @@ -208,6 +222,11 @@ export class BatchViewComponent implements OnInit, OnDestroy {
),
);
}

this.router.navigate([], {
queryParams: { retrieve: null },
queryParamsHandling: "merge",
});
});
}

Expand Down Expand Up @@ -267,6 +286,17 @@ export class BatchViewComponent implements OnInit, OnDestroy {
}
}),
);

this.subscriptions.push(
combineLatest([this.params$]).subscribe(([queryParams]) => {
if (queryParams["share"] === "true") {
this.onShare();
}
if (queryParams["retrieve"] === "true") {
this.onRetrieve();
}
}),
);
}

ngOnDestroy() {
Expand Down
Loading