diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index a5b62fc63..8fc40c152 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -23,7 +23,8 @@
- {{'GENERAL.ACTIONS.SHOW-MORE' | translate}} + + {{'GENERAL.ACTIONS.SHOW-MORE' | translate}}
- + +
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 82d2ef662..45133875e 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -264,11 +264,19 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn return; } case RecentActivityType.Dataset: { - this.router.navigate(["datasets/edit/" + id]); + if (this.isAuthenticated()) { + this.router.navigate(['../datasets/overview/' + id]); + } else { + this.router.navigate(['../explore/publicOverview', id]); + } return; } case RecentActivityType.Dmp: { - this.router.navigate(["plans/overview/" + id]); + if (this.isAuthenticated()) { + this.router.navigate(['../plans/overview/' + id]); + } else { + this.router.navigate(['../explore-plans/publicOverview', id]); + } return; } default: @@ -276,9 +284,29 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn } } - // navigateToUrl() { - // this.router.navigate(["plans/"]); - // } + navigateToUrl(id: string, type: RecentActivityType): string[] { + switch (type) { + case RecentActivityType.Grant: { + return ["grants/edit/" + id]; + } + case RecentActivityType.Dataset: { + if (this.isAuthenticated()) { + return ['../datasets/overview/' + id]; + } else { + return ['../explore/publicOverview', id]; + } + } + case RecentActivityType.Dmp: { + if (this.isAuthenticated()) { + return ['../plans/overview/' + id]; + } else { + return ['../explore-plans/publicOverview', id]; + } + } + default: + throw new Error("Unsupported Activity Type "); + } + } roleDisplay(value: any) { const principal: Principal = this.authentication.current(); @@ -492,22 +520,6 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn }); } - goToDMPOverview(id: string) { - if (this.isAuthenticated()) { - this.router.navigate(['../plans/overview/' + id]); - } else { - this.router.navigate(['../explore-plans/publicOverview', id]); - } - } - - goToDatasetOverview(id: string) { - if (this.isAuthenticated()) { - this.router.navigate(['../datasets/overview/' + id]); - } else { - this.router.navigate(['../explore/publicOverview', id]); - } - } - refresh(): void { const fields: Array = [((this.formGroup.get('order').value === 'status') || (this.formGroup.get('order').value === 'label') ? '+' : "-") + this.formGroup.get('order').value]; // const fields: Array = ["-modified"]; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html index 9373391bf..0770be123 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html @@ -22,7 +22,7 @@
- +
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index c28af1c2a..7c008836a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -159,11 +159,11 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id; } - goToOverview(id: string) { + goToOverview(id: string): string[] { if (this.isAuthenticated()) { - this.router.navigate(['../datasets/overview/' + id]); + return ['../datasets/overview/' + id]; } else { - this.router.navigate(['../explore/publicOverview', id]); + return ['../explore/publicOverview', id]; } } diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html index 484c368a7..72ef1cadf 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html @@ -22,7 +22,7 @@
- {{'GENERAL.ACTIONS.SHOW-MORE' | translate}} + {{'GENERAL.ACTIONS.SHOW-MORE' | translate}}
open_in_new{{'DMP-LISTING.ACTIONS.EXPORT' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index 5cfaf04cb..952686fba 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -95,7 +95,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O .subscribe(x => this.refresh()); this.formGroup.get('order').valueChanges .pipe(takeUntil(this._destroyed)) - .subscribe(x => this.refresh()); + .subscribe(x => this.refresh()); // const datasetDataTableRequest: DataTableRequest = new DataTableRequest(0, 5, { fields: fields }); // datasetDataTableRequest.criteria = new DatasetCriteria(); // datasetDataTableRequest.criteria.like = ""; @@ -173,14 +173,6 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O }); } - goToOverview(id: string) { - if (this.isAuthenticated()) { - this.router.navigate(['../plans/overview/' + id]); - } else { - this.router.navigate(['../explore-plans/publicOverview', id]); - } - } - openDeleteDialog(id: string) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { maxWidth: '300px', @@ -251,28 +243,21 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error); } - redirect(id: string, type: RecentActivityType) { - switch (type) { - case RecentActivityType.Grant: { - this.router.navigate(["grants/edit/" + id]); - return; - } - case RecentActivityType.Dataset: { - this.router.navigate(["datasets/edit/" + id]); - return; - } - case RecentActivityType.Dmp: { - this.router.navigate(["plans/overview/" + id]); - return; - } - default: - throw new Error("Unsupported Activity Type "); + redirect(id: string) { + if (this.isAuthenticated()) { + this.router.navigate(['../plans/overview/' + id]); + } else { + this.router.navigate(['../explore-plans/publicOverview', id]); } } - // navigateToUrl() { - // this.router.navigate(["plans/"]); - // } + navigateToUrl(id: string): string[] { + if (this.isAuthenticated()) { + return ['../plans/overview/' + id]; + } else { + return ['../explore-plans/publicOverview', id]; + } + } roleDisplay(value: any) { const principal: Principal = this.authentication.current(); diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html index f841fc3a4..27231dc6c 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html @@ -1,5 +1,5 @@