rename dmp to plan frontend changes

This commit is contained in:
amentis 2024-07-08 13:11:29 +03:00
parent d0fccbfcd2
commit fe26af8055
39 changed files with 178 additions and 179 deletions

View File

@ -252,7 +252,7 @@ export class AppComponent implements OnInit, AfterViewInit {
return this.authentication.currentAccountIsAuthenticated(); return this.authentication.currentAccountIsAuthenticated();
} }
goToDMPs() { //not used goToPlans() { //not used
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } }); this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
} }

View File

@ -13,11 +13,11 @@ export enum ResponseErrorCode {
DescriptionTemplateNewVersionConflict = 113, DescriptionTemplateNewVersionConflict = 113,
DescriptionTemplateIsNotFinalized = 114, DescriptionTemplateIsNotFinalized = 114,
MultipleDescriptionTemplateVersionsNotSupported = 115, MultipleDescriptionTemplateVersionsNotSupported = 115,
DmpNewVersionConflict = 116, PlanNewVersionConflict = 116,
DmpIsNotFinalized = 117, PlanIsNotFinalized = 117,
MultipleDmpVersionsNotSupported = 118, MultiplePlanVersionsNotSupported = 118,
DmpIsFinalized = 119, PlanIsFinalized = 119,
DmpCanNotChange = 120, PlanCanNotChange = 120,
PlanDescriptionTemplateCanNotChange = 121, PlanDescriptionTemplateCanNotChange = 121,
InvalidDescriptionTemplate = 122, InvalidDescriptionTemplate = 122,
DescriptionIsFinalized = 123, DescriptionIsFinalized = 123,
@ -28,11 +28,11 @@ export enum ResponseErrorCode {
TenantConfigurationTypeCanNotChange = 128, TenantConfigurationTypeCanNotChange = 128,
MultipleTenantConfigurationTypeNotAllowed = 129, MultipleTenantConfigurationTypeNotAllowed = 129,
TenantCodeExists = 130, TenantCodeExists = 130,
DmpNewVersionAlreadyCreatedDraft = 131, PlanNewVersionAlreadyCreatedDraft = 131,
DescriptionTemplateInactiveUser = 132, DescriptionTemplateInactiveUser = 132,
DescriptionTemplateMissingUserContactInfo = 133, DescriptionTemplateMissingUserContactInfo = 133,
DmpInactiveUser = 134, PlanInactiveUser = 134,
DmpMissingUserContactInfo = 135, PlanMissingUserContactInfo = 135,
ImportDescriptionWithoutPlanDescriptionTemplate = 136, ImportDescriptionWithoutPlanDescriptionTemplate = 136,
DuplicatePlanUser = 137, DuplicatePlanUser = 137,
DescriptionTemplateNewVersionAlreadyCreatedDraft = 138, DescriptionTemplateNewVersionAlreadyCreatedDraft = 138,
@ -79,15 +79,15 @@ export class ResponseErrorCodeHelper {
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-IS-NOT-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-IS-NOT-FINALIZED");
case ResponseErrorCode.MultipleDescriptionTemplateVersionsNotSupported: case ResponseErrorCode.MultipleDescriptionTemplateVersionsNotSupported:
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DESCRIPTION-TEMPLATE-VERSIONS-NOT-SUPPORTED"); return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DESCRIPTION-TEMPLATE-VERSIONS-NOT-SUPPORTED");
case ResponseErrorCode.DmpNewVersionConflict: case ResponseErrorCode.PlanNewVersionConflict:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-CONFLICT"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-CONFLICT");
case ResponseErrorCode.DmpIsNotFinalized: case ResponseErrorCode.PlanIsNotFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED");
case ResponseErrorCode.MultipleDmpVersionsNotSupported: case ResponseErrorCode.MultiplePlanVersionsNotSupported:
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-PLAN-VERSIONS-NOT-SUPPORTED"); return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-PLAN-VERSIONS-NOT-SUPPORTED");
case ResponseErrorCode.DmpIsFinalized: case ResponseErrorCode.PlanIsFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED");
case ResponseErrorCode.DmpCanNotChange: case ResponseErrorCode.PlanCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE");
case ResponseErrorCode.PlanDescriptionTemplateCanNotChange: case ResponseErrorCode.PlanDescriptionTemplateCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE");
@ -109,15 +109,15 @@ export class ResponseErrorCodeHelper {
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-TENANT-CONFIGURATION-TYPE-NOT-ALLOWED"); return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-TENANT-CONFIGURATION-TYPE-NOT-ALLOWED");
case ResponseErrorCode.TenantCodeExists: case ResponseErrorCode.TenantCodeExists:
return language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS"); return language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS");
case ResponseErrorCode.DmpNewVersionAlreadyCreatedDraft: case ResponseErrorCode.PlanNewVersionAlreadyCreatedDraft:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-ALREADY-CREATED-DRAFT"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-ALREADY-CREATED-DRAFT");
case ResponseErrorCode.DescriptionTemplateInactiveUser: case ResponseErrorCode.DescriptionTemplateInactiveUser:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-INACTIVE-USER"); return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-INACTIVE-USER");
case ResponseErrorCode.DescriptionTemplateMissingUserContactInfo: case ResponseErrorCode.DescriptionTemplateMissingUserContactInfo:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-MISSING-USER-CONTACT-INFO"); return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-MISSING-USER-CONTACT-INFO");
case ResponseErrorCode.DmpInactiveUser: case ResponseErrorCode.PlanInactiveUser:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER");
case ResponseErrorCode.DmpMissingUserContactInfo: case ResponseErrorCode.PlanMissingUserContactInfo:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO");
case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate: case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate:
return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE"); return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE");

View File

@ -72,7 +72,7 @@ export interface UserCredentialData {
email: String; email: String;
} }
export interface DmpAssociatedUser { export interface PlanAssociatedUser {
id: Guid; id: Guid;
name: string; name: string;
email: string; email: string;

View File

@ -1,7 +1,7 @@
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user'; import { PlanAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user';
import { UserLookup } from '@app/core/query/user.lookup'; import { UserLookup } from '@app/core/query/user.lookup';
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
@ -31,9 +31,9 @@ export class UserService {
return this.http.post<QueryResult<User>>(url, q).pipe(catchError((error: any) => throwError(error))); return this.http.post<QueryResult<User>>(url, q).pipe(catchError((error: any) => throwError(error)));
} }
queryDmpAssociated(q: UserLookup): Observable<QueryResult<DmpAssociatedUser>> { queryPlanAssociated(q: UserLookup): Observable<QueryResult<PlanAssociatedUser>> {
const url = `${this.apiBase}/plan-associated/query`; const url = `${this.apiBase}/plan-associated/query`;
return this.http.post<QueryResult<DmpAssociatedUser>>(url, q).pipe(catchError((error: any) => throwError(error))); return this.http.post<QueryResult<PlanAssociatedUser>>(url, q).pipe(catchError((error: any) => throwError(error)));
} }
getSingle(id: Guid, reqFields: string[] = []): Observable<User> { getSingle(id: Guid, reqFields: string[] = []): Observable<User> {
@ -178,14 +178,14 @@ export class UserService {
valueAssign: (item: User) => item.id, valueAssign: (item: User) => item.id,
}; };
singleAutoCompleteDmpAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { singleAutoCompletePlanAssociatedUserConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)), initialItems: (data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DmpAssociatedUser) => item.name, displayFn: (item: PlanAssociatedUser) => item.name,
subtitleFn: (item: DmpAssociatedUser) => item.email, subtitleFn: (item: PlanAssociatedUser) => item.email,
titleFn: (item: DmpAssociatedUser) => item.name, titleFn: (item: PlanAssociatedUser) => item.name,
valueAssign: (item: DmpAssociatedUser) => item.id, valueAssign: (item: PlanAssociatedUser) => item.id,
}; };
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[]): UserLookup { public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[]): UserLookup {

View File

@ -53,7 +53,7 @@ export class AnnotationDialogComponent extends BaseComponent {
private formBuilder: FormBuilder = new FormBuilder(); private formBuilder: FormBuilder = new FormBuilder();
public annotationStatusFormGroup: UntypedFormGroup; public annotationStatusFormGroup: UntypedFormGroup;
public listingStatuses: Status[] = []; public listingStatuses: Status[] = [];
public dmpUsersMentionNames: string[] = []; public planUsersMentionNames: string[] = [];
@ViewChild('annotationStatus') annotationStatus: MatSelectionList; @ViewChild('annotationStatus') annotationStatus: MatSelectionList;
@ -76,7 +76,7 @@ export class AnnotationDialogComponent extends BaseComponent {
this.entityId = data.entityId; this.entityId = data.entityId;
this.anchor = data.anchor; this.anchor = data.anchor;
this.entityType = data.entityType; this.entityType = data.entityType;
this.dmpUsersMentionNames = data.planUsers.map(x => x.user.name); this.planUsersMentionNames = data.planUsers.map(x => x.user.name);
dialogRef.backdropClick().pipe(takeUntil(this._destroyed)).subscribe(() => dialogRef.close(this.changesMade)); dialogRef.backdropClick().pipe(takeUntil(this._destroyed)).subscribe(() => dialogRef.close(this.changesMade));
} }

View File

@ -25,26 +25,26 @@
</div> </div>
</div> </div>
<div class="card col-auto mt-0" [style.display]="isIntroCardVisible ? 'block' : 'none'"> <div class="card col-auto mt-0" [style.display]="isIntroCardVisible ? 'block' : 'none'">
<a *ngIf="this.hasDmps()" class="col-auto d-flex" (click)="dismissIntroCard()"><span class="ml-auto mt-3 material-icons clear-icon">clear</span></a> <a *ngIf="this.hasPlans()" class="col-auto d-flex" (click)="dismissIntroCard()"><span class="ml-auto mt-3 material-icons clear-icon">clear</span></a>
<p *ngIf="!this.hasDmps()" class="card-title mb-0 pt-4">{{'DASHBOARD.PLAN-QUESTION' | translate}}</p> <p *ngIf="!this.hasPlans()" class="card-title mb-0 pt-4">{{'DASHBOARD.PLAN-QUESTION' | translate}}</p>
<p *ngIf="!this.hasDmps()" class="card-content mb-0">{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}</p> <p *ngIf="!this.hasPlans()" class="card-content mb-0">{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}</p>
<p *ngIf="!this.hasDmps()" class="card-content pt-3 mb-0"> <p *ngIf="!this.hasPlans()" class="card-content pt-3 mb-0">
{{'DASHBOARD.NEW-QUESTION' | translate}} <a href="https://www.openaire.eu/how-to-create-a-data-management-plan" target="_blank"><u>{{'DASHBOARD.OPEN-AIR-GUIDE' | translate}}</u></a> {{'DASHBOARD.LEARN-MORE' | translate}} {{'DASHBOARD.NEW-QUESTION' | translate}} <a href="https://www.openaire.eu/how-to-create-a-data-management-plan" target="_blank"><u>{{'DASHBOARD.OPEN-AIR-GUIDE' | translate}}</u></a> {{'DASHBOARD.LEARN-MORE' | translate}}
</p> </p>
<p *ngIf="this.hasDmps()" class="card-content mb-0 pt-0">{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}} <p *ngIf="this.hasPlans()" class="card-content mb-0 pt-0">{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}}
<b>{{'DASHBOARD.DESCRIPTIONS-DASHBOARD-TEXT' | translate}}</b> <b>{{'DASHBOARD.DESCRIPTIONS-DASHBOARD-TEXT' | translate}}</b>
{{'DASHBOARD.PLAN-ABOUT-END' | translate}} {{'DASHBOARD.PLAN-ABOUT-END' | translate}}
</p> </p>
<div class="row d-flex align-items-center"> <div class="row d-flex align-items-center">
<div *ngIf="!this.hasDmps()" class="col-auto p-0 add-description-btn d-flex"> <div *ngIf="!this.hasPlans()" class="col-auto p-0 add-description-btn d-flex">
<div class="pr-2"> <div class="pr-2">
<button type="button" class="align-self-center normal-btn" (click)="openNewPlanDialog()">{{'DASHBOARD.START-YOUR-FIRST-PLAN' | translate}}</button> <button type="button" class="align-self-center normal-btn" (click)="openNewPlanDialog()">{{'DASHBOARD.START-YOUR-FIRST-PLAN' | translate}}</button>
</div> </div>
</div> </div>
<div *ngIf="this.hasDmps()" class="col-auto p-0 new-description-tour add-description-btn col-auto d-flex"> <div *ngIf="this.hasPlans()" class="col-auto p-0 new-description-tour add-description-btn col-auto d-flex">
<div class="pr-2"> <div class="pr-2">
<button mat-raised-button type="button" class="align-self-center yellow-btn" (click)="addNewDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button> <button mat-raised-button type="button" class="align-self-center yellow-btn" (click)="addNewDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button>
</div> </div>
@ -55,26 +55,26 @@
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="this.hasDmps()" class="col"> <div *ngIf="this.hasPlans()" class="col">
<div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div> <div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div>
<mat-tab-group color="#00000" mat-stretch-tabs="false" mat-align-tabs="start" class="my-mat-tab remove-border-bottom" [selectedIndex]="indexFromCurrentType" (selectedTabChange)="currentType = $event.tab.ariaLabel"> <mat-tab-group color="#00000" mat-stretch-tabs="false" mat-align-tabs="start" class="my-mat-tab remove-border-bottom" [selectedIndex]="indexFromCurrentType" (selectedTabChange)="currentType = $event.tab.ariaLabel">
<mat-tab aria-label="recent" label="{{'DASHBOARD.ALL' | translate}}"> <mat-tab aria-label="recent" label="{{'DASHBOARD.ALL' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'recent'" [includeDmps]="true" [includeDescriptions]="true"></app-recent-edited-activity> <app-recent-edited-activity [isActive]="currentType == 'recent'" [includePlans]="true" [includeDescriptions]="true"></app-recent-edited-activity>
</mat-tab> </mat-tab>
<mat-tab aria-label="drafts" label="{{'DASHBOARD.DRAFTS' | translate}}"> <mat-tab aria-label="drafts" label="{{'DASHBOARD.DRAFTS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'drafts'" [includeDmps]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity> <app-recent-edited-activity [isActive]="currentType == 'drafts'" [includePlans]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
</mat-tab>> </mat-tab>>
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}"> <mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'plans'" [includeDmps]="true" type="plans" [selectedType]="currentType"></app-recent-edited-activity> <app-recent-edited-activity [isActive]="currentType == 'plans'" [includePlans]="true" type="plans" [selectedType]="currentType"></app-recent-edited-activity>
</mat-tab> </mat-tab>
<mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}"> <mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasDmps]="this.hasDmps()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity> <app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasPlans]="this.hasPlans()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
</div> </div>
</div> </div>
<!-- Right Sidebar --> <!-- Right Sidebar -->
<div *ngIf="!this.hasDmps()" class="col-12 col-xl-2 mb-4 stats"> <div *ngIf="!this.hasPlans()" class="col-12 col-xl-2 mb-4 stats">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="personal-usage" style="width: fit-content;"> <div class="personal-usage" style="width: fit-content;">
@ -101,7 +101,7 @@
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="this.hasDmps()" class="col-12 col-xl-2 mb-4 stats"> <div *ngIf="this.hasPlans()" class="col-12 col-xl-2 mb-4 stats">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="personal-usage" style="width: fit-content;"><span>{{'DASHBOARD.PERSONAL-USAGE' | translate}}</span></div> <div class="personal-usage" style="width: fit-content;"><span>{{'DASHBOARD.PERSONAL-USAGE' | translate}}</span></div>
@ -162,7 +162,7 @@
</div> </div>
</div> </div>
<div class="col-12 col-xl-auto mb-4 stats"> <div class="col-12 col-xl-auto mb-4 stats">
<div *ngIf="!hasDmps()" class="row flex-xl-column"> <div *ngIf="!hasPlans()" class="row flex-xl-column">
<div class="col-12"> <div class="col-12">
<div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div> <div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div>
</div> </div>
@ -184,7 +184,7 @@
</div> </div>
</div> </div>
<div *ngIf="hasDmps()" class="row flex-xl-column"> <div *ngIf="hasPlans()" class="row flex-xl-column">
<div class="col-12"> <div class="col-12">
<div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div> <div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div>
</div> </div>

View File

@ -126,7 +126,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
} }
} }
public hasDmps(): boolean { public hasPlans(): boolean {
if (this.dashboardStatistics) { if (this.dashboardStatistics) {
return this.dashboardStatistics.planCount !== 0 return this.dashboardStatistics.planCount !== 0
|| this.dashboardStatistics.descriptionCount !== 0 || this.dashboardStatistics.descriptionCount !== 0
@ -199,10 +199,10 @@ export class DashboardComponent extends BaseComponent implements OnInit {
] ]
}; };
public setDashboardTourDmpText(): void { public setDashboardTourPlanText(): void {
const dmpText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' + const planText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' +
this.language.instant('DASHBOARD.TOUR-GUIDE.START-NEW'); this.language.instant('DASHBOARD.TOUR-GUIDE.START-NEW');
this.dashboardTour.steps[0].title = dmpText; this.dashboardTour.steps[0].title = planText;
} }
public setDashboardImportFileText(): void { public setDashboardImportFileText(): void {
@ -222,7 +222,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
} }
openDashboardTour() { openDashboardTour() {
this.setDashboardTourDmpText(); this.setDashboardTourPlanText();
this.setDashboardImportFileText(); this.setDashboardImportFileText();
this.setDashboardStartWizardText(); this.setDashboardStartWizardText();
this.setDescriptionText(); this.setDescriptionText();

View File

@ -38,7 +38,7 @@
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}} {{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
</div> </div>
<div class="row justify-content-center mt-5" *ngIf="listingItems?.length == 0 && onlyDescriptions && hasDmps"> <div class="row justify-content-center mt-5" *ngIf="listingItems?.length == 0 && onlyDescriptions && hasPlans">
<div class="col-auto p-0 add-description"> <div class="col-auto p-0 add-description">
<button mat-raised-button type="button" class="yellow-btn" (click)="addDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button> <button mat-raised-button type="button" class="yellow-btn" (click)="addDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button>
</div> </div>

View File

@ -44,18 +44,18 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
@Input() type: string; @Input() type: string;
@Input() selectedType: string; @Input() selectedType: string;
@Input() includeDescriptions: boolean = false; @Input() includeDescriptions: boolean = false;
@Input() includeDmps: boolean = false; @Input() includePlans: boolean = false;
@Input() onlyDrafts: boolean = false; @Input() onlyDrafts: boolean = false;
@Input() hasDmps: boolean = false; @Input() hasPlans: boolean = false;
@Output() addNewDescription: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); @Output() addNewDescription: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
get onlyPlans(): boolean { get onlyPlans(): boolean {
return this.includeDmps && !this.includeDescriptions; return this.includePlans && !this.includeDescriptions;
} }
get onlyDescriptions(): boolean { get onlyDescriptions(): boolean {
return !this.includeDmps && this.includeDescriptions; return !this.includePlans && this.includeDescriptions;
} }
pageLessSize= this.pageSize; pageLessSize= this.pageSize;
@ -166,7 +166,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
this.lookup.like = this.formGroup.get('like').value; this.lookup.like = this.formGroup.get('like').value;
this.lookup.project = { this.lookup.project = {
fields : [ fields : [
...(this.includeDmps ? this._getPlanLookup() : []), ...(this.includePlans ? this._getPlanLookup() : []),
...(this.includeDescriptions ? this._getDescriptionLookup() : []) ...(this.includeDescriptions ? this._getDescriptionLookup() : [])
] ]
}; };

View File

@ -7,7 +7,7 @@
<div class="row mt-3"> <div class="row mt-3">
<div class="col-12"> <div class="col-12">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<app-single-auto-complete [formControl]="data.formGroup.get('planId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-PLAN' | translate}}" [configuration]="dmpAutoCompleteConfiguration"> <app-single-auto-complete [formControl]="data.formGroup.get('planId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-PLAN' | translate}}" [configuration]="planAutoCompleteConfiguration">
</app-single-auto-complete> </app-single-auto-complete>
</mat-form-field> </mat-form-field>
</div> </div>

View File

@ -26,10 +26,9 @@ import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition,
}) })
export class DescriptionCopyDialogComponent { export class DescriptionCopyDialogComponent {
dmpModel: Plan;
sections: PlanBlueprintDefinitionSection[] = []; sections: PlanBlueprintDefinitionSection[] = [];
descriptionDescriptionTemplateLabel: String; descriptionDescriptionTemplateLabel: String;
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group. planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group.
initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
@ -83,16 +82,16 @@ export class DescriptionCopyDialogComponent {
ngOnInit() { ngOnInit() {
} }
findSection(dmp: Plan){ findSection(plan: Plan){
const availableSectionIds = dmp.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId); const availableSectionIds = plan.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId);
this.sections = dmp.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || []; this.sections = plan.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || [];
if(this.sections.length == 1){ if(this.sections.length == 1){
this.data.formGroup.get('sectionId').setValue(this.sections[0].id); this.data.formGroup.get('sectionId').setValue(this.sections[0].id);
}else { }else {
this.data.formGroup.get('sectionId').setValue(null); this.data.formGroup.get('sectionId').setValue(null);
} }
return dmp.id return plan.id
} }
cancel() { cancel() {

View File

@ -178,7 +178,7 @@
[validationErrorModel]="editorModel.validationErrorModel" [validationErrorModel]="editorModel.validationErrorModel"
[isNew]="isNew || isCopy" [isNew]="isNew || isCopy"
[canReview]="canReview" [canReview]="canReview"
[dmpUsers]="item?.plan?.planUsers ?? []" [planUsers]="item?.plan?.planUsers ?? []"
></app-description-form> ></app-description-form>
</div> </div>
</div> </div>

View File

@ -140,7 +140,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
const planSectionId = params['planSectionId']; const planSectionId = params['planSectionId'];
const isPublicDescription = params['public']; const isPublicDescription = params['public'];
const newDmpId = params['newDmpId']; const newPlanId = params['newPlanId'];
this.scrollToField = this.route.snapshot.data['scrollToField'] ?? false this.scrollToField = this.route.snapshot.data['scrollToField'] ?? false
this.anchorFieldsetId = params['fieldsetId'] ?? null; this.anchorFieldsetId = params['fieldsetId'] ?? null;
@ -151,7 +151,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.viewOnly = isPublicDescription; this.viewOnly = isPublicDescription;
//Regular Editor case //Regular Editor case
if (itemId != null && newDmpId == null) { if (itemId != null && newPlanId == null) {
this.checkLock(this.item.id, LockTargetType.Description, 'DESCRIPTION-EDITOR.LOCKED-DIALOG.TITLE', 'DESCRIPTION-EDITOR.LOCKED-DIALOG.MESSAGE'); this.checkLock(this.item.id, LockTargetType.Description, 'DESCRIPTION-EDITOR.LOCKED-DIALOG.TITLE', 'DESCRIPTION-EDITOR.LOCKED-DIALOG.MESSAGE');
} }

View File

@ -35,7 +35,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
@Input() hideAnnotations: boolean = false; @Input() hideAnnotations: boolean = false;
@Input() canReview: boolean = false; @Input() canReview: boolean = false;
@Input() numbering: string; @Input() numbering: string;
@Input() dmpUsers: PlanUser[] = []; @Input() planUsers: PlanUser[] = [];
get isMultiplicityEnabled() { get isMultiplicityEnabled() {
return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null; return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null;
@ -186,7 +186,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
entityId: this.descriptionId, entityId: this.descriptionId,
anchor: fieldSetId, anchor: fieldSetId,
entityType: AnnotationEntityType.Description, entityType: AnnotationEntityType.Description,
planUsers: this.dmpUsers planUsers: this.planUsers
} }
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(changesMade => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(changesMade => {

View File

@ -25,7 +25,7 @@
[isChild]="false" [isChild]="false"
[hideAnnotations]="isNew" [hideAnnotations]="isNew"
[canReview]="canReview" [canReview]="canReview"
[dmpUsers]="dmpUsers" [planUsers]="planUsers"
></app-description-form-field-set> ></app-description-form-field-set>
</div> </div>
</div> </div>

View File

@ -26,7 +26,7 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On
@Input() visibilityRulesService: VisibilityRulesService; @Input() visibilityRulesService: VisibilityRulesService;
@Input() path: string; @Input() path: string;
@Input() descriptionId: Guid; @Input() descriptionId: Guid;
@Input() dmpUsers: PlanUser[] = []; @Input() planUsers: PlanUser[] = [];
// @Input() descriptionTemplateId: String; // @Input() descriptionTemplateId: String;

View File

@ -15,7 +15,7 @@
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-container *ngFor="let section of page.sections; let i = index;"> <ng-container *ngFor="let section of page.sections; let i = index;">
<div class="row" *ngIf="visibilityRulesService.isVisibleMap[section.id]"> <div class="row" *ngIf="visibilityRulesService.isVisibleMap[section.id]">
<app-description-form-section class="col-12" [section]="section" [canReview]="canReview" [path]="(z+1)+'.'+(i+1)" [pathName]="'pages.'+z+'.sections.'+i" [propertiesFormGroup]="propertiesFormGroup" [descriptionId]="descriptionId" [visibilityRulesService]="visibilityRulesService" (askedToScroll)="onAskedToScroll(expansionPanel, $event)" [linkToScroll]="linkToScroll" [validationErrorModel]="validationErrorModel" [isNew]="isNew" [dmpUsers]="dmpUsers"></app-description-form-section> <app-description-form-section class="col-12" [section]="section" [canReview]="canReview" [path]="(z+1)+'.'+(i+1)" [pathName]="'pages.'+z+'.sections.'+i" [propertiesFormGroup]="propertiesFormGroup" [descriptionId]="descriptionId" [visibilityRulesService]="visibilityRulesService" (askedToScroll)="onAskedToScroll(expansionPanel, $event)" [linkToScroll]="linkToScroll" [validationErrorModel]="validationErrorModel" [isNew]="isNew" [planUsers]="planUsers"></app-description-form-section>
</div> </div>
</ng-container> </ng-container>
</mat-expansion-panel> </mat-expansion-panel>

View File

@ -27,7 +27,7 @@ export class DescriptionFormComponent extends BaseComponent implements OnInit, O
@Input() datasetDescription: String; @Input() datasetDescription: String;
@Input() linkToScroll: LinkToScroll; @Input() linkToScroll: LinkToScroll;
@Input() validationErrorModel: ValidationErrorModel; @Input() validationErrorModel: ValidationErrorModel;
@Input() dmpUsers: PlanUser[] = []; @Input() planUsers: PlanUser[] = [];
@Output() formChanged: EventEmitter<any> = new EventEmitter(); @Output() formChanged: EventEmitter<any> = new EventEmitter();

View File

@ -31,7 +31,7 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
prefillSelected: boolean = false; prefillSelected: boolean = false;
prefillForm: UntypedFormGroup; prefillForm: UntypedFormGroup;
dmp: Plan; plan: Plan;
planSectionId: Guid; planSectionId: Guid;
availableDescriptionTemplates: DescriptionTemplate[] = []; availableDescriptionTemplates: DescriptionTemplate[] = [];
@ -43,13 +43,13 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
@Inject(MAT_DIALOG_DATA) public data: any) { @Inject(MAT_DIALOG_DATA) public data: any) {
super(); super();
this.dmp = data.plan; this.plan = data.plan;
this.planSectionId = data.planSectionId; this.planSectionId = data.planSectionId;
this.availableDescriptionTemplates = this.dmp.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate); this.availableDescriptionTemplates = this.plan.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
} }
ngOnInit() { ngOnInit() {
const availablePrefillingSourcesIds = this.dmp.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null; const availablePrefillingSourcesIds = this.plan.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null;
this.singlePrefillingSourceAutoCompleteConfiguration = this.prefillingSourceService.getSingleAutocompleteConfiguration(availablePrefillingSourcesIds); this.singlePrefillingSourceAutoCompleteConfiguration = this.prefillingSourceService.getSingleAutocompleteConfiguration(availablePrefillingSourcesIds);
this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {

View File

@ -34,7 +34,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
public static lookupFields(): string[] { public static lookupFields(): string[] {
return [ return [
...DescriptionEditorEntityResolver.descriptionLookupFields(), ...DescriptionEditorEntityResolver.descriptionLookupFields(),
...DescriptionEditorEntityResolver.dmpLookupFields(nameof<Description>(x => x.plan)), ...DescriptionEditorEntityResolver.planLookupFields(nameof<Description>(x => x.plan)),
...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(), ...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(),
] ]
} }
@ -115,7 +115,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
] ]
} }
public static dmpLookupFields(prefix?: string): string[] { public static planLookupFields(prefix?: string): string[] {
return [ return [
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.label)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.label)].join('.'),
@ -176,20 +176,20 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
} }
return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(d => this.breadcrumbService.addIdResolvedValue(d.id.toString(), d.label))); return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(d => this.breadcrumbService.addIdResolvedValue(d.id.toString(), d.label)));
} else if (planId != null && planSectionId != null && copyPlanId == null) { } else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields()) return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addExcludedParam(planId, true); this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
}), takeUntil(this._destroyed), map(dmp => { }), takeUntil(this._destroyed), map(plan => {
const description: Description = {}; const description: Description = {};
description.plan = dmp; description.plan = plan;
description.planDescriptionTemplate = { description.planDescriptionTemplate = {
sectionId: Guid.parse(planSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;
})); }));
} else if (copyPlanId != null && id != null && planSectionId != null) { } else if (copyPlanId != null && id != null && planSectionId != null) {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => { return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => {
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields()) return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addExcludedParam(copyPlanId, true) this.breadcrumbService.addExcludedParam(copyPlanId, true)
@ -200,9 +200,9 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
description.id = null; description.id = null;
description.hash = null; description.hash = null;
description.status = DescriptionStatus.Draft; description.status = DescriptionStatus.Draft;
description.plan = dmp; description.plan = plan;
description.planDescriptionTemplate = { description.planDescriptionTemplate = {
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(planSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;

View File

@ -46,13 +46,13 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
})); }));
} else if (planId != null && planSectionId != null && copyPlanId == null) { } else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields()) return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addExcludedParam(planId, true); this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
}), takeUntil(this._destroyed), map(dmp => { }), takeUntil(this._destroyed), map(plan => {
const description: Description = {}; const description: Description = {};
description.plan = dmp; description.plan = plan;
description.planDescriptionTemplate = { description.planDescriptionTemplate = {
sectionId: Guid.parse(planSectionId) sectionId: Guid.parse(planSectionId)
} }
@ -67,7 +67,7 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed)); return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
})); }));
} else if (copyPlanId != null && id != null && planSectionId != null) { } else if (copyPlanId != null && id != null && planSectionId != null) {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => { return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => {
//TODO //TODO
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields()) return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
@ -79,9 +79,9 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
description.id = null; description.id = null;
description.hash = null; description.hash = null;
description.status = DescriptionStatus.Draft; description.status = DescriptionStatus.Draft;
description.plan = dmp; description.plan = plan;
description.planDescriptionTemplate = { description.planDescriptionTemplate = {
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(planSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;

View File

@ -207,7 +207,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
protected setupColumns() { } protected setupColumns() { }
public dashboardTour: GuidedTour = { public dashboardTour: GuidedTour = {
tourId: 'dmp-description-tour', tourId: 'plan-description-tour',
useOrb: true, useOrb: true,
steps: [ steps: [
{ {
@ -290,12 +290,12 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
} }
public restartTour(): void { public restartTour(): void {
this.setDashboardTourDmpText(); this.setDashboardTourPlanText();
this.setDashboardTourDescriptionText(); this.setDashboardTourDescriptionText();
this.guidedTourService.startTour(this.dashboardTour); this.guidedTourService.startTour(this.dashboardTour);
} }
public setDashboardTourDmpText(): void { public setDashboardTourPlanText(): void {
this.planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' + this.planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' + this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' + this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
@ -392,7 +392,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
} else lookup.descriptionTemplateSubQuery = null; } else lookup.descriptionTemplateSubQuery = null;
// Dmps // Dmps
let plans = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = plans && plans?.length > 0; let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addDmps = plans && plans?.length > 0;
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0; let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0;
if (addDmps || addRoles) { if (addDmps || addRoles) {
lookup.planSubQuery = DescriptionFilterService.initializePlanLookup(); lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
@ -434,7 +434,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null], status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
role: lookup.planSubQuery?.planUserSubQuery?.userRoles ? lookup.planSubQuery?.planUserSubQuery?.userRoles[0] : [], role: lookup.planSubQuery?.planUserSubQuery?.userRoles ? lookup.planSubQuery?.planUserSubQuery?.userRoles[0] : [],
descriptionTemplates: lookup.descriptionTemplateSubQuery?.ids ? [lookup.descriptionTemplateSubQuery?.ids] : [], descriptionTemplates: lookup.descriptionTemplateSubQuery?.ids ? [lookup.descriptionTemplateSubQuery?.ids] : [],
associatedDmpIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [], associatedPlanIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [],
tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [], tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [],
}); });
} }

View File

@ -13,7 +13,7 @@ const routes: Routes = [
}, },
}, },
{ {
path: 'dmp/:planId', path: 'plan/:planId',
component: DescriptionListingComponent, component: DescriptionListingComponent,
canActivate: [AuthGuard], canActivate: [AuthGuard],
data: { data: {

View File

@ -37,7 +37,7 @@
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.NAME' | translate}}</h6> <h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.NAME' | translate}}</h6>
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.PLACEHOLDER' | translate }}</mat-label> <mat-label>{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.PLACEHOLDER' | translate }}</mat-label>
<app-multiple-auto-complete [formControl]="formGroup.get('associatedDmpIds')" [configuration]="dmpAutoCompleteConfiguration"></app-multiple-auto-complete> <app-multiple-auto-complete [formControl]="formGroup.get('associatedPlanIds')" [configuration]="planAutoCompleteConfiguration"></app-multiple-auto-complete>
</mat-form-field> </mat-form-field>
<hr> <hr>
</div> </div>

View File

@ -45,7 +45,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
options: UntypedFormGroup; options: UntypedFormGroup;
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
dmpAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; planAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
tagAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; tagAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration; referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration;
referenceAutocompleteConfiguration: Map<string, MultipleAutoCompleteConfiguration>; referenceAutocompleteConfiguration: Map<string, MultipleAutoCompleteConfiguration>;
@ -71,7 +71,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
if (changes['filterFormGroup']) { if (changes['filterFormGroup']) {
this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildMultipleAutocompleteConfiguration(); this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildMultipleAutocompleteConfiguration();
this.dmpAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration; this.planAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration;
this.tagAutoCompleteConfiguration = this.tagService.multipleAutocompleteConfiguration; this.tagAutoCompleteConfiguration = this.tagService.multipleAutocompleteConfiguration;
this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration(); this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration();
this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>(); this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>();

View File

@ -308,11 +308,11 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
}); });
} }
dmpClicked(dmp: Plan) { dmpClicked(plan: Plan) {
if (this.isPublicView) { if (this.isPublicView) {
this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id.toString()])]); this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id.toString()])]);
} else { } else {
this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', dmp.id.toString()])]); this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', plan.id.toString()])]);
} }
} }

View File

@ -26,7 +26,7 @@ import { nameof } from 'ts-simple-nameof';
}) })
export class PlanDepositDropdown extends BaseComponent implements OnInit { export class PlanDepositDropdown extends BaseComponent implements OnInit {
@Input() inputRepos: DepositConfiguration[]; @Input() inputRepos: DepositConfiguration[];
@Input() dmp: Plan; @Input() plan: Plan;
outputRepos = []; outputRepos = [];
logos: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>(); logos: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>();
@Output() outputReposEmitter: EventEmitter<EntityDoi[]> = new EventEmitter<EntityDoi[]>(); @Output() outputReposEmitter: EventEmitter<EntityDoi[]> = new EventEmitter<EntityDoi[]>();
@ -49,8 +49,8 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
for (var i = 0; i < this.dmp?.entityDois?.length; i++) { for (var i = 0; i < this.plan?.entityDois?.length; i++) {
this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.dmp.entityDois, i)); this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.plan.entityDois, i));
} }
this.inputRepos.forEach(repo => { this.inputRepos.forEach(repo => {
if (repo.hasLogo) { if (repo.hasLogo) {
@ -76,12 +76,12 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
switch (result) { switch (result) {
case 0: case 0:
this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.dmp); this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.plan);
break; break;
case 1: case 1:
const depositRequest: DepositRequest = { const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId, repositoryId: repo.repositoryId,
planId: this.dmp.id, planId: this.plan.id,
authorizationCode: null, authorizationCode: null,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };
@ -99,7 +99,7 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
} else if (repo.depositType == DepositConfigurationStatus.System) { } else if (repo.depositType == DepositConfigurationStatus.System) {
const depositRequest: DepositRequest = { const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId, repositoryId: repo.repositoryId,
planId: this.dmp.id, planId: this.plan.id,
authorizationCode: null, authorizationCode: null,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };
@ -121,14 +121,14 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('PLAN-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error); this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('PLAN-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
} }
showOauth2Dialog(url: string, repo: DepositConfiguration, dmp: Plan) { showOauth2Dialog(url: string, repo: DepositConfiguration, plan: Plan) {
this.depositOauth2DialogService.login(url) this.depositOauth2DialogService.login(url)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(code => { .subscribe(code => {
if (code !== undefined) { if (code !== undefined) {
const depositRequest: DepositRequest = { const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId, repositoryId: repo.repositoryId,
planId: dmp.id, planId: plan.id,
authorizationCode: code, authorizationCode: code,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };

View File

@ -1,13 +1,13 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpInvitationService } from '@app/core/services/plan/dmp-invitation.service'; import { DmpInvitationService } from '@app/core/services/plan/plan-invitation.service';
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
selector: 'app-dmp-invitation-accepted-component', selector: 'app-plan-invitation-accepted-component',
templateUrl: 'dmp-invitation-accepted.component.html', templateUrl: 'plan-invitation-accepted.component.html',
}) })
export class InvitationAcceptedComponent extends BaseComponent implements OnInit { export class InvitationAcceptedComponent extends BaseComponent implements OnInit {

View File

@ -150,11 +150,11 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
} }
public dashboardTour: GuidedTour = { public dashboardTour: GuidedTour = {
tourId: 'dmp-description-tour', tourId: 'plan-description-tour',
useOrb: true, useOrb: true,
steps: [ steps: [
{ {
selector: '.dmp-tour', selector: '.plan-tour',
content: 'Step 1', content: 'Step 1',
orientation: Orientation.Right, orientation: Orientation.Right,
isStepUnique: false isStepUnique: false
@ -299,12 +299,12 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
return document.getElementById("main-page").scrollHeight > document.documentElement.clientHeight return document.getElementById("main-page").scrollHeight > document.documentElement.clientHeight
} }
public setDashboardTourDmpText(): void { public setDashboardTourPlanText(): void {
const dmpText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' + const planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' + this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' + this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
this.language.instant('PLAN-LISTING.GET-IDEA'); this.language.instant('PLAN-LISTING.GET-IDEA');
this.dashboardTour.steps[0].title = dmpText; this.dashboardTour.steps[0].title = planText;
} }
public setDashboardTourDescriptionText(): void { public setDashboardTourDescriptionText(): void {
@ -315,7 +315,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
} }
public restartTour(): void { public restartTour(): void {
this.setDashboardTourDmpText(); this.setDashboardTourPlanText();
this.setDashboardTourDescriptionText(); this.setDashboardTourDescriptionText();
this.guidedTourService.startTour(this.dashboardTour); this.guidedTourService.startTour(this.dashboardTour);
} }
@ -417,8 +417,8 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
} }
private _filterDmp(plans: BasePlan[]): BasePlan[] { private _filterDmp(plans: BasePlan[]): BasePlan[] {
plans.forEach((dmp: BasePlan) => { plans.forEach((plan: BasePlan) => {
dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? []; plan.descriptions = plan.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
}) })
return plans; return plans;
} }

View File

@ -52,7 +52,7 @@
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-NEW-VERSION-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox> <mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-NEW-VERSION-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
</mat-card-header> </mat-card-header>
<mat-selection-list #selectedItems (selectionChange)="descriptionSelectionChanged($event)"> <mat-selection-list #selectedItems (selectionChange)="descriptionSelectionChanged($event)">
<ng-container *ngFor="let description of dmp.descriptions;"> <ng-container *ngFor="let description of plan.descriptions;">
<mat-list-option [value]="description.id" [selected]="isDefaultSelected(formGroup.get('descriptions'), description.id)" class="h-auto"> <mat-list-option [value]="description.id" [selected]="isDefaultSelected(formGroup.get('descriptions'), description.id)" class="h-auto">
<div class="mat-mdc-form-field-bottom-align w-100"></div> <div class="mat-mdc-form-field-bottom-align w-100"></div>
<mat-form-field class="w-100" (click)="selectTemplate($event)" floatLabel="never"> <mat-form-field class="w-100" (click)="selectTemplate($event)" floatLabel="never">

View File

@ -32,7 +32,7 @@ import { Description } from '@app/core/model/description/description';
}) })
export class NewVersionPlanDialogComponent extends BaseComponent { export class NewVersionPlanDialogComponent extends BaseComponent {
dmp: Plan; plan: Plan;
editorModel: DmpNewVersionDialogEditorModel; editorModel: DmpNewVersionDialogEditorModel;
formGroup: UntypedFormGroup; formGroup: UntypedFormGroup;
selectedBlueprintSections: PlanBlueprintDefinitionSection[]; selectedBlueprintSections: PlanBlueprintDefinitionSection[];
@ -83,8 +83,8 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
@Inject(MAT_DIALOG_DATA) public data: any @Inject(MAT_DIALOG_DATA) public data: any
) { ) {
super(); super();
this.dmp = data.plan; this.plan = data.plan;
this.dmp.planDescriptionTemplates = this.dmp.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active); this.plan.planDescriptionTemplates = this.plan.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active);
} }
get allDescriptionsNo(): number{ get allDescriptionsNo(): number{
@ -109,15 +109,15 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
ngOnInit() { ngOnInit() {
this.selectedBlueprintSections = this.dmp.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null; this.selectedBlueprintSections = this.plan.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null;
this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.dmp, this.dmp.blueprint); this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint);
this.formGroup = this.editorModel.buildForm(); this.formGroup = this.editorModel.buildForm();
} }
selectedBlueprintChanged(item: PlanBlueprint): void{ selectedBlueprintChanged(item: PlanBlueprint): void{
this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null; this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null;
if(this.selectedBlueprintSections && this.hasDescriptions()) { if(this.selectedBlueprintSections && this.hasDescriptions()) {
this.formGroup = this.editorModel.fromModel(this.dmp, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm(); this.formGroup = this.editorModel.fromModel(this.plan, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm();
} }
} }
@ -170,7 +170,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
} }
hasDescriptions() { hasDescriptions() {
return this.dmp.descriptions?.length > 0; return this.plan.descriptions?.length > 0;
} }
close() { close() {
@ -188,7 +188,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
formData.descriptions = formData.descriptions.filter(x => x.blueprintSectionId != null) formData.descriptions = formData.descriptions.filter(x => x.blueprintSectionId != null)
} }
this.planService.newVersion(formData, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe( this.planService.newVersion(formData, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
dmp => this.dialogRef.close(dmp), plan => this.dialogRef.close(plan),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );

View File

@ -32,7 +32,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
// initialize because blueprint changed // initialize because blueprint changed
this.descriptions = []; this.descriptions = [];
if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // dmp's first blueprint if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // plan's first blueprint
item.descriptions.forEach(description => { item.descriptions.forEach(description => {
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId)); this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId));
}) })

View File

@ -13,7 +13,7 @@
<div class="col-12 col-xl mt-3"> <div class="col-12 col-xl mt-3">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'PLAN-CONTACT-PREFILL-DIALOG.FIELDS.USER' | translate}}</mat-label> <mat-label>{{'PLAN-CONTACT-PREFILL-DIALOG.FIELDS.USER' | translate}}</mat-label>
<app-single-auto-complete [formControl]="formGroup" [configuration]="singleAutoCompleteDmpAssociatedUserConfiguration"></app-single-auto-complete> <app-single-auto-complete [formControl]="formGroup" [configuration]="singleAutoCompletePlanAssociatedUserConfiguration"></app-single-auto-complete>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="row" style="justify-content: space-between;"> <div class="row" style="justify-content: space-between;">

View File

@ -4,7 +4,7 @@ import { BaseComponent } from '@common/base/base.component';
import { UserService } from '@app/core/services/user/user.service'; import { UserService } from '@app/core/services/user/user.service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { map } from 'rxjs'; import { map } from 'rxjs';
import { DmpAssociatedUser } from '@app/core/model/user/user'; import { PlanAssociatedUser } from '@app/core/model/user/user';
import { UntypedFormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { PlanContactPrefillDialogEditorModel } from './plan-contact-prefill-dialog.editor.model'; import { PlanContactPrefillDialogEditorModel } from './plan-contact-prefill-dialog.editor.model';
import { FormService } from '@common/forms/form-service'; import { FormService } from '@common/forms/form-service';
@ -22,15 +22,15 @@ export class PlanContactPrefillDialogComponent extends BaseComponent {
contactFormGroup: UntypedFormGroup; contactFormGroup: UntypedFormGroup;
label: string; label: string;
singleAutoCompleteDmpAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { singleAutoCompletePlanAssociatedUserConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup()).pipe(map(x => x.items)), initialItems: (data?: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup(null, null, [selectedItem.id])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup(null, null, [selectedItem.id])).pipe(map(x => x.items[0])),
displayFn: (item: DmpAssociatedUser) => item.name, displayFn: (item: PlanAssociatedUser) => item.name,
subtitleFn: (item: DmpAssociatedUser) => item.email, subtitleFn: (item: PlanAssociatedUser) => item.email,
titleFn: (item: DmpAssociatedUser) => item.name, titleFn: (item: PlanAssociatedUser) => item.name,
valueAssign: (item: DmpAssociatedUser) => item, valueAssign: (item: PlanAssociatedUser) => item,
uniqueAssign: (item: DmpAssociatedUser) => item.id uniqueAssign: (item: PlanAssociatedUser) => item.id
}; constructor( }; constructor(
private userService: UserService, private userService: UserService,

View File

@ -1,11 +1,11 @@
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DmpAssociatedUser } from "@app/core/model/user/user"; import { PlanAssociatedUser } from "@app/core/model/user/user";
import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { Validation, ValidationContext } from '@common/forms/validation/validation-context'; import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
import { Guid } from "@common/types/guid"; import { Guid } from "@common/types/guid";
export class PlanContactPrefillDialogEditorModel implements DmpAssociatedUser { export class PlanContactPrefillDialogEditorModel implements PlanAssociatedUser {
id: Guid; id: Guid;
name: string; name: string;
email: string; email: string;

View File

@ -250,7 +250,7 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
this.checkLock(this.item.id, LockTargetType.Plan, 'PLAN-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-EDITOR.LOCKED-DIALOG.MESSAGE'); this.checkLock(this.item.id, LockTargetType.Plan, 'PLAN-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-EDITOR.LOCKED-DIALOG.MESSAGE');
} }
} catch (error) { } catch (error) {
this.logger.error('Could not parse Dmp item: ' + data + error); this.logger.error('Could not parse Plan item: ' + data + error);
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error); this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
} }
} }
@ -532,14 +532,14 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
} }
private buildFormAfterBlueprintSelection() { private buildFormAfterBlueprintSelection() {
const dmp: Plan = { const plan: Plan = {
label: this.formGroup.get('label').value, label: this.formGroup.get('label').value,
description: this.formGroup.get('description').value, description: this.formGroup.get('description').value,
blueprint: this.selectedBlueprint, blueprint: this.selectedBlueprint,
status: PlanStatus.Draft status: PlanStatus.Draft
} }
this.prepareForm(dmp); this.prepareForm(plan);
} }
// //

View File

@ -14,20 +14,20 @@
{{ 'PLAN-FINALISE-DIALOG.PLAN' | translate }} {{ 'PLAN-FINALISE-DIALOG.PLAN' | translate }}
</mat-panel-title> </mat-panel-title>
<mat-panel-description class="plan-title"> <mat-panel-description class="plan-title">
{{ dmp.label }} {{ plan.label }}
</mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
{{ dmp.description }} {{ plan.description }}
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel [expanded]="true" *ngIf="isDmpValid"> <mat-expansion-panel [expanded]="true" *ngIf="isPlanValid">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
{{ 'PLAN-FINALISE-DIALOG.DESCRPIPTIONS' | translate }} {{ 'PLAN-FINALISE-DIALOG.DESCRPIPTIONS' | translate }}
</mat-panel-title> </mat-panel-title>
<mat-panel-description></mat-panel-description> <mat-panel-description></mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div *ngIf="dmp.descriptions && dmp.descriptions.length > 0"> <div *ngIf="plan.descriptions && plan.descriptions.length > 0">
<div *ngFor="let description of dmp.descriptions" class="row pl-3 descriptions"> <div *ngFor="let description of plan.descriptions" class="row pl-3 descriptions">
<mat-icon *ngIf="description.status == descriptionStatusEnum.Draft" class="col-1 draft-bookmark">bookmark</mat-icon> <mat-icon *ngIf="description.status == descriptionStatusEnum.Draft" class="col-1 draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-1 finalized-bookmark">bookmark</mat-icon> <mat-icon *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="description.status == descriptionStatusEnum.Draft" class="col-11 ml-auto mt-1 mb-4"> <h4 *ngIf="description.status == descriptionStatusEnum.Draft" class="col-11 ml-auto mt-1 mb-4">
@ -42,7 +42,7 @@
<h4 *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-11 ml-auto mt-1 mb-4">{{ description.label }}</h4> <h4 *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-11 ml-auto mt-1 mb-4">{{ description.label }}</h4>
</div> </div>
</div> </div>
<div *ngIf="!dmp.descriptions" class="emptyList">{{ 'PLAN-FINALISE-DIALOG.EMPTY' | translate }} </div> <div *ngIf="!plan.descriptions" class="emptyList">{{ 'PLAN-FINALISE-DIALOG.EMPTY' | translate }} </div>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>
@ -56,11 +56,11 @@
</div> </div>
</mat-selection-list> </mat-selection-list>
</div> </div>
<ng-container *ngIf="isDmpValid == false"> <ng-container *ngIf="isPlanValid == false">
<mat-error> <mat-error>
{{ 'PLAN-FINALISE-DIALOG.VALIDATION.INVALID-PLAN' | translate }} {{ 'PLAN-FINALISE-DIALOG.VALIDATION.INVALID-PLAN' | translate }}
</mat-error> </mat-error>
<ng-container *ngFor="let error of dmpErrors"> <ng-container *ngFor="let error of planErrors">
<div> <div>
<mat-error> <mat-error>
<i class="fa fa-circle" style="font-size:16px"></i> {{error}} <i class="fa fa-circle" style="font-size:16px"></i> {{error}}
@ -68,7 +68,7 @@
</div> </div>
</ng-container> </ng-container>
</ng-container> </ng-container>
<mat-error *ngIf="getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0 && isDmpValid"> <mat-error *ngIf="getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0 && isPlanValid">
{{'PLAN-FINALISE-DIALOG.VALIDATION.AT-LEAST-ONE-DESCRPIPTION-FINALISED' | translate}} {{'PLAN-FINALISE-DIALOG.VALIDATION.AT-LEAST-ONE-DESCRPIPTION-FINALISED' | translate}}
</mat-error> </mat-error>
</div> </div>
@ -77,10 +77,10 @@
<div class="row pt-2 pb-2 pl-4 pr-4"> <div class="row pt-2 pb-2 pl-4 pr-4">
{{ 'PLAN-FINALISE-DIALOG.IMPACT' | translate }} {{ 'PLAN-FINALISE-DIALOG.IMPACT' | translate }}
</div> </div>
<div *ngIf="dmp.accessType == planAccessTypeEnum.Public" class="row pl-4 pr-4"> <div *ngIf="plan.accessType == planAccessTypeEnum.Public" class="row pl-4 pr-4">
{{ 'PLAN-FINALISE-DIALOG.PUBLIC-PLAN-MESSAGE' | translate }} {{ 'PLAN-FINALISE-DIALOG.PUBLIC-PLAN-MESSAGE' | translate }}
</div> </div>
<div *ngIf="dmp.accessType == planAccessTypeEnum.Restricted" class="row pl-4 pr-4"> <div *ngIf="plan.accessType == planAccessTypeEnum.Restricted" class="row pl-4 pr-4">
{{ 'PLAN-FINALISE-DIALOG.RESTRICTED-PLAN-MESSAGE' | translate }} {{ 'PLAN-FINALISE-DIALOG.RESTRICTED-PLAN-MESSAGE' | translate }}
</div> </div>
</div> </div>
@ -90,7 +90,7 @@
<button mat-raised-button cdkFocusInitial (click)="close()" class="cancel-btn">{{ 'PLAN-FINALISE-DIALOG.ACTIONS.CANCEL' | translate }}</button> <button mat-raised-button cdkFocusInitial (click)="close()" class="cancel-btn">{{ 'PLAN-FINALISE-DIALOG.ACTIONS.CANCEL' | translate }}</button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button mat-raised-button [disabled]="!isDmpValid || getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0" class="submit-btn" (click)="onSubmit()">{{ 'PLAN-FINALISE-DIALOG.ACTIONS.SUBMIT' | translate }}</button> <button mat-raised-button [disabled]="!isPlanValid || getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0" class="submit-btn" (click)="onSubmit()">{{ 'PLAN-FINALISE-DIALOG.ACTIONS.SUBMIT' | translate }}</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -19,9 +19,9 @@ import { takeUntil } from 'rxjs/operators';
}) })
export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit { export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit {
dmp: Plan; plan: Plan;
isDmpValid: boolean; isPlanValid: boolean;
dmpErrors: string[]; planErrors: string[];
planAccessTypeEnum = PlanAccessType; planAccessTypeEnum = PlanAccessType;
descriptionStatusEnum = DescriptionStatus; descriptionStatusEnum = DescriptionStatus;
descriptionValidationOutputEnum = DescriptionValidationOutput; descriptionValidationOutputEnum = DescriptionValidationOutput;
@ -38,18 +38,18 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit
@Inject(MAT_DIALOG_DATA) public data: any @Inject(MAT_DIALOG_DATA) public data: any
) { ) {
super(); super();
this.dmp = data.plan; this.plan = data.plan;
} }
ngOnInit(): void { ngOnInit(): void {
this.planService.validate(this.dmp.id).pipe(takeUntil(this._destroyed),) this.planService.validate(this.plan.id).pipe(takeUntil(this._destroyed),)
.subscribe(result => { .subscribe(result => {
if (result.result === PlanValidationOutput.Valid){ if (result.result === PlanValidationOutput.Valid){
this.validateDescriptions(this.dmp); this.validateDescriptions(this.plan);
this.isDmpValid = true; this.isPlanValid = true;
}else{ }else{
this.isDmpValid = false; this.isPlanValid = false;
this.dmpErrors = result.errors; this.planErrors = result.errors;
} }
}, },
error => { error => {
@ -73,8 +73,8 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit
} }
getFinalizedDescriptions() { getFinalizedDescriptions() {
if (!this.dmp.descriptions) return []; if (!this.plan.descriptions) return [];
const finalizedDescriptions = this.dmp.descriptions.filter(x => x.status === DescriptionStatus.Finalized); const finalizedDescriptions = this.plan.descriptions.filter(x => x.status === DescriptionStatus.Finalized);
if (finalizedDescriptions?.length > 0){ if (finalizedDescriptions?.length > 0){
finalizedDescriptions.forEach(finalize => { finalizedDescriptions.forEach(finalize => {
this.descriptionValidationOutputMap.set(finalize.id, DescriptionValidationOutput.Valid); this.descriptionValidationOutputMap.set(finalize.id, DescriptionValidationOutput.Valid);
@ -87,17 +87,17 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit
this.dialogRef.close({ cancelled: true } as PlanFinalizeDialogOutput); this.dialogRef.close({ cancelled: true } as PlanFinalizeDialogOutput);
} }
validateDescriptions(dmp: Plan) { validateDescriptions(plan: Plan) {
if (!dmp.descriptions?.some(x => x.status == DescriptionStatus.Draft)) return; if (!plan.descriptions?.some(x => x.status == DescriptionStatus.Draft)) return;
const draftDescriptions = this.dmp.descriptions.filter(x => x.status == DescriptionStatus.Draft) || []; const draftDescriptions = this.plan.descriptions.filter(x => x.status == DescriptionStatus.Draft) || [];
if ( draftDescriptions.length > 0){ if ( draftDescriptions.length > 0){
draftDescriptions.forEach(draft => { draftDescriptions.forEach(draft => {
this.descriptionValidationOutputMap.set(draft.id, DescriptionValidationOutput.Pending); this.descriptionValidationOutputMap.set(draft.id, DescriptionValidationOutput.Pending);
}); });
} }
this.descriptionService.validate(dmp.descriptions.filter(x => x.status == DescriptionStatus.Draft).map(x => x.id)).pipe(takeUntil(this._destroyed),) this.descriptionService.validate(plan.descriptions.filter(x => x.status == DescriptionStatus.Draft).map(x => x.id)).pipe(takeUntil(this._destroyed),)
.subscribe(result => { .subscribe(result => {
this.validationResults = result; this.validationResults = result;
}, },
@ -108,8 +108,8 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit
} }
get validDraftDescriptions() { get validDraftDescriptions() {
if (!this.dmp.descriptions) return []; if (!this.plan.descriptions) return [];
return this.dmp.descriptions.filter(x => this.validationResults.some(y => y.descriptionId == x.id && y.result == DescriptionValidationOutput.Valid)); return this.plan.descriptions.filter(x => this.validationResults.some(y => y.descriptionId == x.id && y.result == DescriptionValidationOutput.Valid));
} }
} }

View File

@ -44,7 +44,7 @@
<div class="col-12 col-xl mt-3" *ngIf="user.get('userType').value == planUserTypeEnum.Internal"> <div class="col-12 col-xl mt-3" *ngIf="user.get('userType').value == planUserTypeEnum.Internal">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'PLAN-EDITOR.FIELDS.USER' | translate}}</mat-label> <mat-label>{{'PLAN-EDITOR.FIELDS.USER' | translate}}</mat-label>
<app-single-auto-complete [formControl]="user.get('user')" [configuration]="userService.singleAutoCompleteDmpAssociatedUserConfiguration"></app-single-auto-complete> <app-single-auto-complete [formControl]="user.get('user')" [configuration]="userService.singleAutoCompletePlanAssociatedUserConfiguration"></app-single-auto-complete>
<mat-error *ngIf="user.get('user').hasError('backendError')">{{user.get('user').getError('backendError').message}}</mat-error> <mat-error *ngIf="user.get('user').hasError('backendError')">{{user.get('user').getError('backendError').message}}</mat-error>
<mat-error *ngIf="user.get('user').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="user.get('user').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>