diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts
index 70fce0ebe..7bc040ece 100644
--- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts
+++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts
@@ -22,6 +22,7 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
+import { Location } from '@angular/common';
@Component({
selector: 'app-drafts',
@@ -55,7 +56,8 @@ export class DraftsComponent extends BaseComponent implements OnInit {
public dialog: MatDialog,
private datasetWizardService: DatasetWizardService,
public enumUtils: EnumUtils,
- private uiNotificationService: UiNotificationService
+ private uiNotificationService: UiNotificationService,
+ private location: Location
) {
super();
}
@@ -170,8 +172,8 @@ export class DraftsComponent extends BaseComponent implements OnInit {
this.datasetWizardService.delete(id)
.pipe(takeUntil(this._destroyed))
.subscribe(
- complete => this.onCallbackSuccess(),
- error => this.onCallbackError(error)
+ complete => this.onDeleteCallbackSuccess(),
+ error => this.onDeleteCallbackError(error)
);
}
});
@@ -198,6 +200,22 @@ export class DraftsComponent extends BaseComponent implements OnInit {
// this.setErrorModel(error.error);
}
+ reloadPage(): void {
+ const path = this.location.path();
+ this.router.navigateByUrl('/reload', { skipLocationChange: true }).then(() => {
+ this.router.navigate([path]);
+ });
+ }
+
+ onDeleteCallbackSuccess(): void {
+ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
+ this.reloadPage();
+ }
+
+ onDeleteCallbackError(error) {
+ this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
+ }
+
downloadPDF(dataset: DatasetListingModel): void {
this.datasetWizardService.downloadPDF(dataset.id as string)
.pipe(takeUntil(this._destroyed))
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 0d6b6c1a0..59e1b2f75 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
@@ -82,7 +82,7 @@
-