Adds Collaborators panel on DMP Overview.

This commit is contained in:
gkolokythas 2019-12-19 12:10:16 +02:00
parent c8600b315e
commit 61a7f0b809
4 changed files with 46 additions and 8 deletions

View File

@ -81,7 +81,7 @@
<div class="col-12 d-flex flex-row flex-wrap ml-3">
<div class="d-flex">
<mat-icon matTooltip="{{'DMP-OVERVIEW.TOOLTIP.LEVEL-OF-ACCESS' | translate}}" class="gray-icon pt-2">settings</mat-icon>
<p class="mt-2 ml-1 mr-3 p-1">{{ roleDisplay(dmp.users) }}</p>
<p class="mt-2 ml-1 mr-3 p-1">{{ roleDisplayFromList(dmp.users) }}</p>
</div>
<div class="datasets-counter" *ngIf="!isPublishedDMP(dmp)">
@ -110,6 +110,11 @@
<p class="mt-2 ml-1 p-1">{{ dmp.researchers.length }}</p>
<p class="mt-2 mr-3 p-1">{{ 'DMP-EDITOR.FIELDS.RESEARCHERS' | translate }}</p>
</div>
<div class="d-flex" *ngIf="!isPublicView">
<mat-icon matTooltip="{{'DMP-OVERVIEW.COLLABORATORS' | translate}}" class="gray-icon pt-2">person</mat-icon>
<p class="mt-2 ml-1 p-1">{{ dmp.users.length }}</p>
<p class="mt-2 mr-3 p-1">{{ 'DMP-EDITOR.FIELDS.COLLABORATORS' | translate }}</p>
</div>
</div>
</div>
<div class="row">
@ -157,6 +162,12 @@
<div matTooltip="{{ researcher.name }}" class="avatar">{{ researcher.name }}</div>
</div>
</div>
<div class="collaborators">
<h6 class="collaborators-title">{{'DMP-OVERVIEW.COLLABORATORS' | translate}}</h6>
<div *ngFor="let user of dmp.users">
<div matTooltip="{{ roleDisplay(user) }}" class="avatar">{{ user.name }}</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -66,6 +66,25 @@
text-transform: uppercase;
}
.collaborators {
display: flex;
flex-direction: column;
border: 2px solid #f2f2f2;
margin-right: 2em;
margin-top: 2em;
padding: 0.5em;
}
.collaborators-title {
width: 135px;
color: #089dbb;
background-color: white;
padding: 0px 10px;
margin-top: -16px;
cursor: default;
text-transform: uppercase;
}
.container-header {
display: flex;
align-items: baseline;

View File

@ -12,7 +12,7 @@ import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { DmpFinalizeDialogComponent, DmpFinalizeDialogInput, DmpFinalizeDialogOutput } from '@app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { BaseComponent } from '@common/base/base.component';
@ -219,7 +219,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
return filename;
}
roleDisplay(value: UserInfoListingModel[]) {
roleDisplayFromList(value: UserInfoListingModel[]) {
const principal: Principal = this.authentication.current();
let role: number;
if (principal) {
@ -229,13 +229,19 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
}
});
}
if (role === 0) {
if (role === Role.Owner) {
return this.translate.instant('DMP-LISTING.OWNER');
} else if (role === Role.Member) {
return this.translate.instant('DMP-LISTING.MEMBER');
} else {
return this.translate.instant('DMP-LISTING.OWNER');
}
else if (role === 1) {
}
roleDisplay(value: UserInfoListingModel) {
if (value.role === Role.Member) {
return this.translate.instant('DMP-LISTING.MEMBER');
}
else {
} else {
return this.translate.instant('DMP-LISTING.OWNER');
}
}

View File

@ -489,6 +489,7 @@
},
"DMP-OVERVIEW": {
"RESEARCHERS": "Researchers",
"COLLABORATORS": "Collaborators",
"TOOLTIP": {
"LEVEL-OF-ACCESS": "Level of Access",
"INVOLVED-DATASETS": "Involved Dataset Descriptions",
@ -662,7 +663,8 @@
"GRANT": "Grant",
"FUNDER": "Funder",
"STATUS": "DMP Status",
"EXTERNAL-SOURCE-HINT": "List of values provided by external source(s)"
"EXTERNAL-SOURCE-HINT": "List of values provided by external source(s)",
"COLLABORATORS": "Collaborators"
},
"ACTIONS": {
"GO-TO-GRANT": "Go To DMP Grant",