From 3c2caee679e9753bcc7403fb876f9000946290a5 Mon Sep 17 00:00:00 2001 From: gpapavgeri Date: Thu, 23 Jul 2020 16:24:34 +0300 Subject: [PATCH] update of users actions (edit, delete, etc) according to their role --- .../ui/dashboard/drafts/drafts.component.html | 8 ++++---- .../recent-edited-activity.component.html | 12 ++++++------ ...ecent-edited-dataset-activity.component.html | 8 ++++---- .../recent-edited-dmp-activity.component.html | 4 ++-- .../dataset-listing-item.component.html | 12 ++++++------ .../dataset-listing-item.component.ts | 13 +++++++++++++ .../overview/dataset-overview.component.html | 11 +++++------ .../dmp-listing-item.component.html | 10 +++++----- .../listing-item/dmp-listing-item.component.ts | 17 +++++++++++++++++ .../ui/dmp/overview/dmp-overview.component.html | 10 +++++----- .../ui/dmp/overview/dmp-overview.component.scss | 2 +- 11 files changed, 68 insertions(+), 39 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index 9d70216c8..6a45a9359 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -39,11 +39,11 @@ {{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{activity.grant}}
-
{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}} -
{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}
+
{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}} +
{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}
-
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}
+
{{activity.dmp}}
@@ -56,7 +56,7 @@ - -
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{ getDmp(activity) }}
+
{{ getDmp(activity) }}
@@ -127,7 +127,7 @@ - -
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}
+
{{activity.dmp}}
@@ -56,7 +56,7 @@ - -
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{dataset.dmp}}
+
{{dataset.dmp}}
@@ -34,7 +34,7 @@ -
launch @@ -92,7 +91,7 @@
-
+
{{dmp.label}}
- {{ roleDisplay(dmp.users) }} - . + {{ roleDisplay(dmp.users) }} + . public{{'TYPES.DMP-VISIBILITY.PUBLIC' | translate}} done{{ enumUtils.toDmpStatusString(dmp.status) }} create{{ enumUtils.toDmpStatusString(dmp.status) }} @@ -30,9 +30,9 @@ 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 c7cddea40..f41c73873 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 @@ -64,6 +64,10 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { } } + public isAuthenticated(): boolean { + return !(!this.authentication.current()); + } + checkLockStatus(id: string) { this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed)) .subscribe(lockStatus => this.lockStatus = lockStatus); @@ -130,6 +134,19 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { } } + isUserDMPRelated() { + const principal: Principal = this.authentication.current(); + let isRelated: boolean = false; + if (this.dmp && principal) { + this.dmp.users.forEach(element => { + if (element.id === principal.id) { + isRelated = true; + } + }) + } + return isRelated; + } + cloneClicked(dmp: DmpListingModel) { this.router.navigate(['/plans/clone/' + dmp.id]); } 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 dfc4e5db0..fb3457e6d 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 @@ -16,8 +16,8 @@

{{ roleDisplayFromList(dmp.users) }}

- . -
+ . +
public {{'DMP-OVERVIEW.PUBLIC' | translate}} @@ -100,7 +100,7 @@
-
-
+

{{ 'DMP-LISTING.ACTIONS.DEPOSIT' | translate }}

-