From 20cd23ee351cb89a267c30b9cbe7cd3f80901b47 Mon Sep 17 00:00:00 2001 From: gpapavgeri Date: Wed, 22 Jul 2020 11:19:25 +0300 Subject: [PATCH 1/3] dmp-overview: show-more deleted & dataset-label changed & clone-edit-newVersion urls open in new tab --- .../dmp/overview/dmp-overview.component.html | 21 +++++++------------ .../dmp/overview/dmp-overview.component.scss | 5 +++-- .../ui/dmp/overview/dmp-overview.component.ts | 11 ++++++---- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 63ffdc00d..dfc4e5db0 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -27,8 +27,10 @@ {{'DMP-OVERVIEW.PRIVATE' | translate}} -
- lock_outline + +
+ . + lock_outline {{'DMP-OVERVIEW.LOCKED' | translate}}
. @@ -85,24 +87,17 @@
{{'DMP-OVERVIEW.DATASETS-USED' | translate}}
-
-
+
+
-
- -
@@ -82,7 +82,7 @@ - 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 0a0b78a12..56ac02dd2 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 @@ -138,7 +138,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn } cloneClicked(dmp: DmpListingModel) { - this.router.navigate(['/plans/clone/' + dmp.id]); + let url = this.router.createUrlTree(['/plans/clone/', dmp.id]); + window.open(url.toString(), '_blank'); } deleteClicked(dmp: DmpListingModel) { 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 0e9e23882..820227c41 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 @@ -46,15 +46,15 @@
- -
- - + diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index 940dc2ff5..bca7cedb5 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -16,6 +16,7 @@ import * as FileSaver from 'file-saver'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import { Role } from '@app/core/common/enum/role'; +import { LockService } from '@app/core/services/lock/lock.service'; @Component({ selector: 'app-dmp-listing-item-component', @@ -32,6 +33,7 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { isDraft: boolean; isFinalized: boolean; isPublished: boolean; + lockStatus: Boolean; constructor( private router: Router, @@ -40,7 +42,8 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { public enumUtils: EnumUtils, private dmpService: DmpService, private language: TranslateService, - private uiNotificationService: UiNotificationService) { + private uiNotificationService: UiNotificationService, + private lockService: LockService) { super(); } @@ -49,15 +52,22 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { this.isDraft = true; this.isFinalized = false; this.isPublished = false; + this.checkLockStatus(this.dmp.id); } else if (this.dmp.status == DmpStatus.Finalized) { this.isDraft = false; this.isFinalized = true; this.isPublished = false; + this.checkLockStatus(this.dmp.id); if (this.dmp.public == true) { this.isPublished = true } } } + checkLockStatus(id: string) { + this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed)) + .subscribe(lockStatus => this.lockStatus = lockStatus); + } + openShareDialog(rowId: any, rowName: any) { const dialogRef = this.dialog.open(DmpInvitationDialogComponent, { // height: '250px', @@ -204,7 +214,7 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { this.dmpService.delete(dmp.id) .pipe(takeUntil(this._destroyed)) .subscribe( - complete => { this.onCallbackSuccess() }, + complete => this.onDeleteCallbackSuccess(), error => this.onDeleteCallbackError(error) ); } @@ -215,9 +225,15 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { return activity.status == DmpStatus.Draft; } - onCallbackSuccess(): void { - this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - this.router.navigate(['/plans']); + reloadPage(): void { + this.router.navigateByUrl('/reload', { skipLocationChange: true }).then(() => { + this.router.navigate(['/plans']); + }); + } + + onDeleteCallbackSuccess(): void { + this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success); + this.reloadPage(); } onDeleteCallbackError(error) {