-
+
@@ -16,19 +16,19 @@
-
{{ dmp.label }}
+
{{ plan.label }}
.
- +
-

{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }} +

{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}

.
@@ -41,17 +41,17 @@ {{'PLAN-OVERVIEW.LOCKED' | translate}}
{{'PLAN-OVERVIEW.EDITED' | translate}} : - {{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}} + {{plan.updatedAt | dateTimeFormatter: "d MMMM y"}}
-
+
check {{'PLAN-OVERVIEW.FINALISED' | translate}}
-
+
@@ -74,9 +74,9 @@
- +
{{'PLAN-OVERVIEW.GRANT' | translate}}
-
{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
+
{{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}
@@ -102,19 +102,19 @@
horizontal_rule
{{'PLAN-OVERVIEW.DESCRIPTION' | translate}}
-
+
-

+

-
+
horizontal_rule
{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}
- + -
+
horizontal_rule
- +
{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}:
- + {{entityDoi.repositoryId}} @@ -147,7 +147,7 @@
- +
@@ -173,8 +173,8 @@
- -
+ +
- - + +
--> - @@ -244,7 +244,7 @@

{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}

-
+
-
+
@@ -274,7 +274,7 @@
- diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts index 77199e589..e07855876 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts @@ -52,15 +52,15 @@ import { NewVersionPlanDialogComponent } from '../new-version-dialog/plan-new-ve import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; @Component({ - selector: 'app-dmp-overview', + selector: 'app-plan-overview', templateUrl: './plan-overview.component.html', styleUrls: ['./plan-overview.component.scss'] }) export class PlanOverviewComponent extends BaseComponent implements OnInit { - dmp: any; + plan: any; selectedBlueprint: PlanBlueprint; - selectedDmpVersion: any; + selectedPlanVersion: any; researchers: PlanReference[] = []; isNew = true; isFinalized = false; @@ -114,7 +114,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { ngOnInit() { this.analyticsService.trackPageView(AnalyticsService.PlanOverview); - // Gets dmp data using parameter id + // Gets plan data using parameter id this.route.params .pipe(takeUntil(this._destroyed)) .subscribe((params: Params) => { @@ -128,28 +128,28 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { .subscribe(data => { this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label); - this.dmp = data; - this.dmp.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active); - this.dmp.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null; - if (this.dmp.descriptions) { - if (this.dmp.status == PlanStatus.Finalized) { - this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized); + this.plan = data; + this.plan.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active); + this.plan.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null; + if (this.plan.descriptions) { + if (this.plan.status == PlanStatus.Finalized) { + this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized); } else { - this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled); + this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled); } } - if (data.entityDois && data.entityDois.length > 0) this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); + if (data.entityDois && data.entityDois.length > 0) this.plan.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); this.selectedBlueprint = data.blueprint; - this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); + this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); if (!this.hasDoi()) { - this.selectedModel = this.dmp.entityDois[0]; + this.selectedModel = this.plan.entityDois[0]; } - this.selectedDmpVersion = this.dmp; - this.checkLockStatus(this.dmp.id); + this.selectedPlanVersion = this.plan; + this.checkLockStatus(this.plan.id); // this.setIsUserOwner(); // const breadCrumbs = []; // breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PLANS'), url: "/plans" }); - // breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id }); + // breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.plan.label, url: '/plans/overview/' + this.plan.id }); // this.breadCrumbs = observableOf(breadCrumbs); }, (error: any) => { this.httpErrorHandlingService.handleBackedRequestError(error); @@ -172,12 +172,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { this.breadcrumbService.addExcludedParam('public', true); this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label); - this.dmp = data; - this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); + this.plan = data; + this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); if (!this.hasDoi()) { - this.selectedModel = this.dmp.entityDois[0]; + this.selectedModel = this.plan.entityDois[0]; } - this.selectedDmpVersion = this.dmp; + this.selectedPlanVersion = this.plan; }, (error: any) => { this.httpErrorHandlingService.handleBackedRequestError(error); @@ -235,57 +235,57 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { } else return false; } - focusOnAuthor(dmpUserId: Guid, order: number): void { - this.authorFocus = `${dmpUserId}-${order}`; + focusOnAuthor(planUserId: Guid, order: number): void { + this.authorFocus = `${planUserId}-${order}`; } resetAuthorFocus(): void { this.authorFocus = null; } - isFocusedOnUser(dmpUserId: Guid, order: number): boolean { - return `${dmpUserId}-${order}` == this.authorFocus; + isFocusedOnUser(planUserId: Guid, order: number): boolean { + return `${planUserId}-${order}` == this.authorFocus; } canEditPlan(): boolean { - return (this.isDraftDmp()) && (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.isDraftPlan()) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canCreateNewVersion(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canDeletePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canClonePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan)); + return (this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan)); } canFinalizePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canExportPlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)); + return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)); } canInvitePlanUsers(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canAssignPlanUsers(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canDepositPlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } editClicked() { - this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.dmp.id], '/')]); + this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]); } cloneClicked() { @@ -293,7 +293,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -309,7 +309,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -322,11 +322,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { deleteClicked() { let dialogRef: any; - if (this.dmp.descriptions && this.dmp.descriptions.length > 0) { + if (this.plan.descriptions && this.plan.descriptions.length > 0) { dialogRef = this.dialog.open(PlanDeleteDialogComponent, { maxWidth: '300px', data: { - descriptions: this.dmp.descriptions, + descriptions: this.plan.descriptions, } }); } else { @@ -343,7 +343,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { - this.planService.delete(this.dmp.id) + this.planService.delete(this.plan.id) .pipe(takeUntil(this._destroyed)) .subscribe( complete => { this.onDeleteCallbackSuccess() }, @@ -373,38 +373,38 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { isUserDmpRelated(): boolean { const principalId: Guid = this.authentication.userId(); - return this.dmp.planUsers?.some(x => (x.user.id === principalId)); + return this.plan.planUsers?.some(x => (x.user.id === principalId)); } - isDraftDmp() { - return this.dmp.status == PlanStatus.Draft; + isDraftPlan() { + return this.plan.status == PlanStatus.Draft; } - isFinalizedDmp(dmp: Plan) { - return dmp.status == PlanStatus.Finalized; + isFinalizedDmp(plan: Plan) { + return plan.status == PlanStatus.Finalized; } isPublishedDmp() { - return (this.dmp.status == PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public); + return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public); } hasDoi() { - return (this.dmp.entityDois == null || this.dmp.entityDois.length == 0); + return (this.plan.entityDois == null || this.plan.entityDois.length == 0); } afterDeposit(result: EntityDoi[]) { if (result.length > 0) { - this.dmp.entityDois = result; - this.selectedModel = this.dmp.entityDois[this.dmp.entityDois.length - 1]; + this.plan.entityDois = result; + this.selectedModel = this.plan.entityDois[this.plan.entityDois.length - 1]; } } get inputRepos() { - return this.depositRepos.filter(repo => !this.dmp.entityDois?.find(doi => doi.repositoryId === repo.repositoryId)); + return this.depositRepos.filter(repo => !this.plan.entityDois?.find(doi => doi.repositoryId === repo.repositoryId)); } moreDeposit() { - return (this.dmp.entityDois.length < this.depositRepos.length); + return (this.plan.entityDois.length < this.depositRepos.length); } finalize() { @@ -413,13 +413,13 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { restoreFocus: false, autoFocus: false, data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => { if (result && !result.cancelled) { - this.planService.finalize(this.dmp.id, result.descriptionsToBeFinalized) + this.planService.finalize(this.plan.id, result.descriptionsToBeFinalized) .pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); @@ -452,7 +452,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { restoreFocus: false, data: { planId: rowId, - dmpName: rowName, + planName: rowName, blueprint: this.selectedBlueprint } }); @@ -460,9 +460,9 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { selectDoi(entityDoi: EntityDoi) { this.selectedModel = entityDoi; - const foundIdx = this.dmp.entityDois.findIndex(el => el.id == entityDoi.id); - this.dmp.entityDois.splice(foundIdx, 1); - this.dmp.entityDois.unshift(entityDoi); + const foundIdx = this.plan.entityDois.findIndex(el => el.id == entityDoi.id); + this.plan.entityDois.splice(foundIdx, 1); + this.plan.entityDois.unshift(entityDoi); } createDoiLink(doiModel: any): string { @@ -488,7 +488,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { - this.planService.undoFinalize(this.dmp.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) + this.planService.undoFinalize(this.plan.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); this.onUpdateCallbackSuccess() @@ -523,7 +523,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { if (result) { const dmpUserRemovePersist: PlanUserRemovePersist = { id: dmpUser.id, - planId: this.dmp.id, + planId: this.plan.id, role: dmpUser.role }; this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) @@ -566,7 +566,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { getSectionNameById(sectionId: Guid): string { if (sectionId == null) return ''; - let sections: PlanBlueprintDefinitionSection[] = this.dmp?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id); + let sections: PlanBlueprintDefinitionSection[] = this.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id); return sections == null ? '' : sections[0].label; } diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts index 93a967781..6b495d1cf 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts @@ -208,10 +208,10 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist { public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() ) { } - fromModel(item: PlanProperties, planReferences: PlanReference[], dmpBlueprint: PlanBlueprint): PlanPropertiesEditorModel { + fromModel(item: PlanProperties, planReferences: PlanReference[], planBlueprint: PlanBlueprint): PlanPropertiesEditorModel { - dmpBlueprint.definition.sections.forEach(section => { + planBlueprint.definition.sections.forEach(section => { section.fields?.forEach(field => { if (field.category !== PlanBlueprintFieldCategory.System) { this.planBlueprintValues.set(field.id, new PlanBlueprintValueEditorModel(this.validationErrorModel).fromModel( diff --git a/dmp-frontend/src/common/forms/validation/custom-validator.ts b/dmp-frontend/src/common/forms/validation/custom-validator.ts index ab75b8cf2..1b15a4a4a 100644 --- a/dmp-frontend/src/common/forms/validation/custom-validator.ts +++ b/dmp-frontend/src/common/forms/validation/custom-validator.ts @@ -187,7 +187,7 @@ export function PlanBlueprintSystemFieldRequiredValidator(): ValidatorFn { } }); } - return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'dmpBlueprintSystemFieldRequired': true }; + return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'planBlueprintSystemFieldRequired': true }; }; }