diff --git a/dmp-frontend/src/app/core/model/recent-activity/recent-activity.model.ts b/dmp-frontend/src/app/core/model/recent-activity/recent-activity.model.ts index 7bf5eecdb..871211661 100644 --- a/dmp-frontend/src/app/core/model/recent-activity/recent-activity.model.ts +++ b/dmp-frontend/src/app/core/model/recent-activity/recent-activity.model.ts @@ -2,7 +2,7 @@ import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { UserInfoListingModel } from '../user/user-info-listing'; export class RecentActivityModel { - id: String; + id: string; title: String; description: String; created: Date; 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 2245e95ac..0d6b6c1a0 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 @@ -51,9 +51,9 @@
open_in_new{{'DMP-LISTING.ACTIONS.EXPORT' | translate}} - add{{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}} - group_add{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}} - filter_none{{'DMP-LISTING.ACTIONS.CLONE' | translate}} + add{{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}} + group_add{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}} + filter_none{{'DMP-LISTING.ACTIONS.CLONE' | translate}} more_horiz
@@ -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 ee97bcd1e..394a33842 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 @@
open_in_new{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}} - group_add{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}} + group_add{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}} more_horiz
- - - - launch diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 673705876..e9c41df5e 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -138,7 +138,8 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { } getDatasetWizardModel(id: string) { - this.datasetWizardService.getSingle(id).pipe(takeUntil(this._destroyed)) + this.datasetWizardService.getSingle(id) + .pipe(takeUntil(this._destroyed)) .subscribe(data => { this.datasetWizardEditorModel = new DatasetWizardEditorModel().fromModel(data); this.datasetWizardModel = data; @@ -165,7 +166,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { } reloadPage(): void { - this.router.navigateByUrl('/datasets', { skipLocationChange: true }).then(() => { + this.router.navigateByUrl('/reload', { skipLocationChange: true }).then(() => { this.router.navigate([`/datasets/overview/${this.dataset.id}`]); }); } @@ -263,9 +264,11 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { editClicked(dataset: DatasetOverviewModel) { if (dataset.public) { - this.router.navigate(['/datasets/publicEdit/' + dataset.id]); + let url = this.router.createUrlTree(['/datasets/publicEdit/', dataset.id]) + window.open(url.toString(), '_blank') } else { - this.router.navigate(['/datasets/edit/' + dataset.id]); + let url = this.router.createUrlTree(['/datasets/edit/', dataset.id]) + window.open(url.toString(), '_blank') } } @@ -406,7 +409,8 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { .subscribe(result => { if (result && result.datasetProfileExist) { const newDmpId = result.formControl.value.id - this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } }); + let url = this.router.createUrlTree(['/datasets/copy/', result.datasetId, { newDmpId: newDmpId } ]) + window.open(url.toString(), '_blank') } }); } diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts index 8ea7419e5..97d2e8627 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts @@ -29,7 +29,6 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni public filteredUsers: DmpInvitationUser[]; public emails: string[] = []; public roles = Role; - public roleNames: string[]; visible = true; selectable = true; @@ -46,7 +45,6 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni @Inject(MAT_DIALOG_DATA) public data: any ) { super(); - this.roleNames = Object.keys(this.roles).filter(key => key.length > 1); } ngOnInit(): void { diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.html b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.html index a2c494b47..2d726af4b 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.html @@ -59,7 +59,8 @@ - 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) { 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}}
-
-
+
+
-
- -