rename frontend dmp to plan (in progress)

This commit is contained in:
amentis 2024-07-04 16:54:09 +03:00
parent a6ecac7524
commit a5b9aaccd8
157 changed files with 3196 additions and 3193 deletions

View File

@ -48,7 +48,7 @@ const appRoutes: Routes = [
loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule), loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule),
data: { data: {
authContext: { authContext: {
permissions: [AppPermission.ViewMyDmpPage] permissions: [AppPermission.ViewMyPlanPage]
}, },
breadcrumb: true, breadcrumb: true,
...BreadcrumbService.generateRouteDataConfiguration({ ...BreadcrumbService.generateRouteDataConfiguration({
@ -69,14 +69,14 @@ const appRoutes: Routes = [
} }
}, },
{ {
path: 'dmp-blueprints', path: 'plan-blueprints',
loadChildren: () => import('./ui/admin/plan-blueprint/plan-blueprint.module').then(m => m.DmpBlueprintModule), loadChildren: () => import('./ui/admin/plan-blueprint/plan-blueprint.module').then(m => m.PlanBlueprintModule),
data: { data: {
authContext: { authContext: {
permissions: [AppPermission.ViewDmpBlueprintPage] permissions: [AppPermission.ViewPlanBlueprintPage]
}, },
...BreadcrumbService.generateRouteDataConfiguration({ ...BreadcrumbService.generateRouteDataConfiguration({
title: 'BREADCRUMBS.DMP-BLUEPRINTS' title: 'BREADCRUMBS.PLAN-BLUEPRINTS'
}), }),
title: 'GENERAL.TITLES.BLUEPRINTS' title: 'GENERAL.TITLES.BLUEPRINTS'
} }

View File

@ -1,6 +1,6 @@
export enum LockTargetType { export enum LockTargetType {
Dmp = 0, Dmp = 0,
Description = 1, Description = 1,
DmpBlueprint = 2, PlanBlueprint = 2,
DescriptionTemplate= 3 DescriptionTemplate= 3
} }

View File

@ -5,9 +5,9 @@ export enum AppPermission {
//Public //Public
PublicBrowseDescription = "PublicBrowseDescription", PublicBrowseDescription = "PublicBrowseDescription",
PublicBrowseDescriptionTemplate = "PublicBrowseDescriptionTemplate", PublicBrowseDescriptionTemplate = "PublicBrowseDescriptionTemplate",
PublicBrowseDmp = "PublicBrowseDmp", PublicBrowsePlan = "PublicBrowsePlan",
PublicBrowseDmpReference = "PublicBrowseDmpReference", PublicBrowsePlanReference = "PublicBrowsePlanReference",
PublicBrowseDmpUser = "PublicBrowseDmpUser", PublicBrowsePlanUser = "PublicBrowsePlanUser",
PublicBrowseReference = "PublicBrowseReference", PublicBrowseReference = "PublicBrowseReference",
PublicBrowseUser = "PublicBrowseUser", PublicBrowseUser = "PublicBrowseUser",
PublicBrowseDashboardStatistics = "PublicBrowseDashboardStatistics", PublicBrowseDashboardStatistics = "PublicBrowseDashboardStatistics",
@ -55,7 +55,7 @@ export enum AppPermission {
EditUser = "EditUser", EditUser = "EditUser",
DeleteUser = "DeleteUser", DeleteUser = "DeleteUser",
ExportUsers = "ExportUsers", ExportUsers = "ExportUsers",
BrowseDmpAssociatedUser = "BrowseDmpAssociatedUser", BrowsePlanAssociatedUser = "BrowsePlanAssociatedUser",
//StorageFile //StorageFile
@ -68,38 +68,38 @@ export enum AppPermission {
EditDescriptionTemplateType = "EditDescriptionTemplateType", EditDescriptionTemplateType = "EditDescriptionTemplateType",
DeleteDescriptionTemplateType = "DeleteDescriptionTemplateType", DeleteDescriptionTemplateType = "DeleteDescriptionTemplateType",
//Dmp //Plan
BrowseDmp = "BrowseDmp", BrowsePlan = "BrowsePlan",
EditDmp = "EditDmp", EditPlan = "EditPlan",
NewDmp = "NewDmp", NewPlan = "NewPlan",
DepositDmp = "DepositDmp", DepositPlan = "DepositPlan",
DeleteDmp = "DeleteDmp", DeletePlan = "DeletePlan",
CloneDmp = "CloneDmp", ClonePlan = "ClonePlan",
ExportDmp = "ExportDmp", ExportPlan = "ExportPlan",
CreateNewVersionDmp = "CreateNewVersionDmp", CreateNewVersionPlan = "CreateNewVersionPlan",
FinalizeDmp = "FinalizeDmp", FinalizePlan = "FinalizePlan",
UndoFinalizeDmp = "UndoFinalizeDmp", UndoFinalizePlan = "UndoFinalizePlan",
AssignDmpUsers = "AssignDmpUsers", AssignPlanUsers = "AssignPlanUsers",
InviteDmpUsers = "InviteDmpUsers", InvitePlanUsers = "InvitePlanUsers",
//DmpBlueprint //PlanBlueprint
BrowseDmpBlueprint = "BrowseDmpBlueprint", BrowsePlanBlueprint = "BrowsePlanBlueprint",
EditDmpBlueprint = "EditDmpBlueprint", EditPlanBlueprint = "EditPlanBlueprint",
DeleteDmpBlueprint = "DeleteDmpBlueprint", DeletePlanBlueprint = "DeletePlanBlueprint",
CloneDmpBlueprint = "CloneDmpBlueprint", ClonePlanBlueprint = "ClonePlanBlueprint",
CreateNewVersionDmpBlueprint = "CreateNewVersionDmpBlueprint", CreateNewVersionPlanBlueprint = "CreateNewVersionPlanBlueprint",
ExportDmpBlueprint = "ExportDmpBlueprint", ExportPlanBlueprint = "ExportPlanBlueprint",
ImportDmpBlueprint = "ImportDmpBlueprint", ImportPlanBlueprint = "ImportPlanBlueprint",
//DmpDescriptionTemplate //PlanDescriptionTemplate
BrowseDmpDescriptionTemplate = "BrowseDmpDescriptionTemplate", BrowsePlanDescriptionTemplate = "BrowsePlanDescriptionTemplate",
EditDmpDescriptionTemplate = "EditDmpDescriptionTemplate", EditPlanDescriptionTemplate = "EditPlanDescriptionTemplate",
DeleteDmpDescriptionTemplate = "DeleteDmpDescriptionTemplate", DeletePlanDescriptionTemplate = "DeletePlanDescriptionTemplate",
//DmpUser //PlanUser
BrowseDmpUser = "BrowseDmpUser", BrowsePlanUser = "BrowsePlanUser",
EditDmpUser = "EditDmpUser", EditPlanUser = "EditPlanUser",
DeleteDmpUser = "DeleteDmpUser", DeletePlanUser = "DeletePlanUser",
//Description //Description
BrowseDescription = "BrowseDescription", BrowseDescription = "BrowseDescription",
@ -137,10 +137,10 @@ export enum AppPermission {
EditTag = "EditTag", EditTag = "EditTag",
DeleteTag = "DeleteTag", DeleteTag = "DeleteTag",
//DmpReference //PlanReference
BrowseDmpReference = "BrowseDmpReference", BrowsePlanReference = "BrowsePlanReference",
EditDmpReference = "EditDmpReference", EditPlanReference = "EditPlanReference",
DeleteDmpReference = "DeleteDmpReference", DeletePlanReference = "DeletePlanReference",
//DescriptionReference //DescriptionReference
BrowseDescriptionReference = "BrowseDescriptionReference", BrowseDescriptionReference = "BrowseDescriptionReference",
@ -216,11 +216,11 @@ export enum AppPermission {
ViewReferencePage = "ViewReferencePage", ViewReferencePage = "ViewReferencePage",
ViewEntityLockPage = "ViewEntityLockPage", ViewEntityLockPage = "ViewEntityLockPage",
ViewDescriptionTemplatePage = "ViewDescriptionTemplatePage", ViewDescriptionTemplatePage = "ViewDescriptionTemplatePage",
ViewDmpBlueprintPage = "ViewDmpBlueprintPage", ViewPlanBlueprintPage = "ViewPlanBlueprintPage",
ViewPublicDescriptionPage = "ViewPublicDescriptionPage", ViewPublicDescriptionPage = "ViewPublicDescriptionPage",
ViewPublicDmpPage = "ViewPublicDmpPage", ViewPublicDmpPage = "ViewPublicDmpPage",
ViewMyDescriptionPage = "ViewMyDescriptionPage", ViewMyDescriptionPage = "ViewMyDescriptionPage",
ViewMyDmpPage = "ViewMyDmpPage", ViewMyPlanPage = "ViewMyPlanPage",
ViewHomePage = "ViewHomePage", ViewHomePage = "ViewHomePage",
ViewMineInAppNotificationPage = "ViewMineInAppNotificationPage", ViewMineInAppNotificationPage = "ViewMineInAppNotificationPage",
ViewTenantConfigurationPage = "ViewTenantConfigurationPage", ViewTenantConfigurationPage = "ViewTenantConfigurationPage",

View File

@ -1,4 +1,4 @@
export enum DmpAccessType { export enum PlanAccessType {
Public = 0, Public = 0,
Restricted = 1 Restricted = 1
} }

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintExtraFieldDataType { export enum PlanBlueprintExtraFieldDataType {
TEXT = 0, TEXT = 0,
RICH_TEXT = 1, RICH_TEXT = 1,
DATE = 2, DATE = 2,

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintFieldCategory { export enum PlanBlueprintFieldCategory {
System = 0, System = 0,
Extra = 1, Extra = 1,
ReferenceType = 2 ReferenceType = 2

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintExtraFieldDataType { export enum PlanBlueprintExtraFieldDataType {
Text = 0, Text = 0,
RichText = 1, RichText = 1,
Date = 2, Date = 2,

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintStatus { export enum PlanBlueprintStatus {
Draft = 0, Draft = 0,
Finalized = 1 Finalized = 1
} }

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintSystemFieldType { export enum PlanBlueprintSystemFieldType {
Title = 0, Title = 0,
Description = 1, Description = 1,
// RESEARCHERS = 2, // RESEARCHERS = 2,

View File

@ -1,3 +1,3 @@
export enum DmpBlueprintType { export enum PlanBlueprintType {
Input = 0 Input = 0
} }

View File

@ -1,4 +1,4 @@
export enum DmpBlueprintVersionStatus { export enum PlanBlueprintVersionStatus {
Current = 0, Current = 0,
Previous = 1, Previous = 1,
NotFinalized = 2 NotFinalized = 2

View File

@ -1,4 +1,4 @@
export enum DmpStatus { export enum PlanStatus {
Draft = 0, Draft = 0,
Finalized = 1 Finalized = 1
} }

View File

@ -1,4 +1,4 @@
export enum DmpUserRole { export enum PlanUserRole {
Owner = 0, Owner = 0,
Viewer = 1, Viewer = 1,
DescriptionContributor = 2, DescriptionContributor = 2,

View File

@ -1,4 +1,4 @@
export enum DmpUserType { export enum PlanUserType {
Internal = 0, Internal = 0,
External = 1 External = 1
} }

View File

@ -1,4 +1,4 @@
export enum DmpVersionStatus { export enum PlanVersionStatus {
Current = 0, Current = 0,
Previous = 1, Previous = 1,
NotFinalized = 2 NotFinalized = 2

View File

@ -18,12 +18,12 @@ export enum ResponseErrorCode {
MultipleDmpVersionsNotSupported = 118, MultipleDmpVersionsNotSupported = 118,
DmpIsFinalized = 119, DmpIsFinalized = 119,
DmpCanNotChange = 120, DmpCanNotChange = 120,
DmpDescriptionTemplateCanNotChange = 121, PlanDescriptionTemplateCanNotChange = 121,
InvalidDescriptionTemplate = 122, InvalidDescriptionTemplate = 122,
DescriptionIsFinalized = 123, DescriptionIsFinalized = 123,
DmpBlueprintHasNoDescriptionTemplates = 124, PlanBlueprintHasNoDescriptionTemplates = 124,
DmpBlueprintNewVersionConflict = 125, PlanBlueprintNewVersionConflict = 125,
DmpDescriptionTemplateCanNotRemove = 126, PlanDescriptionTemplateCanNotRemove = 126,
TenantTampering = 127, TenantTampering = 127,
TenantConfigurationTypeCanNotChange = 128, TenantConfigurationTypeCanNotChange = 128,
MultipleTenantConfigurationTypeNotAllowed = 129, MultipleTenantConfigurationTypeNotAllowed = 129,
@ -33,10 +33,10 @@ export enum ResponseErrorCode {
DescriptionTemplateMissingUserContactInfo = 133, DescriptionTemplateMissingUserContactInfo = 133,
DmpInactiveUser = 134, DmpInactiveUser = 134,
DmpMissingUserContactInfo = 135, DmpMissingUserContactInfo = 135,
ImportDescriptionWithoutDmpDescriptionTemplate = 136, ImportDescriptionWithoutPlanDescriptionTemplate = 136,
DuplicateDmpUser = 137, DuplicatePlanUser = 137,
DescriptionTemplateNewVersionAlreadyCreatedDraft = 138, DescriptionTemplateNewVersionAlreadyCreatedDraft = 138,
DmpBlueprintNewVersionAlreadyCreatedDraft = 139, PlanBlueprintNewVersionAlreadyCreatedDraft = 139,
ReferenceTypeCodeExists = 140, ReferenceTypeCodeExists = 140,
PrefillingSourceCodeExists = 141, PrefillingSourceCodeExists = 141,
InviteUserAlreadyConfirmed = 142, InviteUserAlreadyConfirmed = 142,
@ -80,27 +80,27 @@ export class ResponseErrorCodeHelper {
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.DmpNewVersionConflict:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-NEW-VERSION-CONFLICT"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-CONFLICT");
case ResponseErrorCode.DmpIsNotFinalized: case ResponseErrorCode.DmpIsNotFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-IS-NOT-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED");
case ResponseErrorCode.MultipleDmpVersionsNotSupported: case ResponseErrorCode.MultipleDmpVersionsNotSupported:
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DMP-VERSIONS-NOT-SUPPORTED"); return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-PLAN-VERSIONS-NOT-SUPPORTED");
case ResponseErrorCode.DmpIsFinalized: case ResponseErrorCode.DmpIsFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-IS-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED");
case ResponseErrorCode.DmpCanNotChange: case ResponseErrorCode.DmpCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-CAN-NOT-CHANGE"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE");
case ResponseErrorCode.DmpDescriptionTemplateCanNotChange: case ResponseErrorCode.PlanDescriptionTemplateCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE");
case ResponseErrorCode.InvalidDescriptionTemplate: case ResponseErrorCode.InvalidDescriptionTemplate:
return language.instant("GENERAL.BACKEND-ERRORS.INVALID-DESCRIPTION-TEMPLATE"); return language.instant("GENERAL.BACKEND-ERRORS.INVALID-DESCRIPTION-TEMPLATE");
case ResponseErrorCode.DescriptionIsFinalized: case ResponseErrorCode.DescriptionIsFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-IS-FINALIZED"); return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-IS-FINALIZED");
case ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates: case ResponseErrorCode.PlanBlueprintHasNoDescriptionTemplates:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-HAS-NO-DESCRIPTION-TEMPLATES"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-HAS-NO-DESCRIPTION-TEMPLATES");
case ResponseErrorCode.DmpBlueprintNewVersionConflict: case ResponseErrorCode.PlanBlueprintNewVersionConflict:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-NEW-VERSION-CONFLICT"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-NEW-VERSION-CONFLICT");
case ResponseErrorCode.DmpDescriptionTemplateCanNotRemove: case ResponseErrorCode.PlanDescriptionTemplateCanNotRemove:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-DESCRIPTION-TEMPLATE-CAN-NOT-REMOVE"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-REMOVE");
case ResponseErrorCode.TenantTampering: case ResponseErrorCode.TenantTampering:
return language.instant("GENERAL.BACKEND-ERRORS.TENANT-TAMPERING"); return language.instant("GENERAL.BACKEND-ERRORS.TENANT-TAMPERING");
case ResponseErrorCode.TenantConfigurationTypeCanNotChange: case ResponseErrorCode.TenantConfigurationTypeCanNotChange:
@ -110,21 +110,21 @@ export class ResponseErrorCodeHelper {
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.DmpNewVersionAlreadyCreatedDraft:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-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.DmpInactiveUser:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-INACTIVE-USER"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER");
case ResponseErrorCode.DmpMissingUserContactInfo: case ResponseErrorCode.DmpMissingUserContactInfo:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-MISSING-USER-CONTACT-INFO"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO");
case ResponseErrorCode.ImportDescriptionWithoutDmpDescriptionTemplate: case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate:
return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-DMP-DESCRIPTION-TEMPLATE"); return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE");
case ResponseErrorCode.InvalidApiKey: case ResponseErrorCode.InvalidApiKey:
return language.instant("GENERAL.BACKEND-ERRORS.INVALID-API-KEY"); return language.instant("GENERAL.BACKEND-ERRORS.INVALID-API-KEY");
case ResponseErrorCode.DuplicateDmpUser: case ResponseErrorCode.DuplicatePlanUser:
return language.instant("GENERAL.BACKEND-ERRORS.DUPLICATE-DMP-USER"); return language.instant("GENERAL.BACKEND-ERRORS.DUPLICATE-PLAN-USER");
case ResponseErrorCode.StaleApiKey: case ResponseErrorCode.StaleApiKey:
return language.instant("GENERAL.BACKEND-ERRORS.STALE-API-KEY"); return language.instant("GENERAL.BACKEND-ERRORS.STALE-API-KEY");
case ResponseErrorCode.SensitiveInfo: case ResponseErrorCode.SensitiveInfo:
@ -143,8 +143,8 @@ export class ResponseErrorCodeHelper {
return language.instant("GENERAL.BACKEND-ERRORS.OVERLAPPING-TENANT-CONFIGURATION-NOTIFIER-LIST"); return language.instant("GENERAL.BACKEND-ERRORS.OVERLAPPING-TENANT-CONFIGURATION-NOTIFIER-LIST");
case ResponseErrorCode.DescriptionTemplateNewVersionAlreadyCreatedDraft: case ResponseErrorCode.DescriptionTemplateNewVersionAlreadyCreatedDraft:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-NEW-VERSION-ALREADY-CREATED-DRAFT"); return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-NEW-VERSION-ALREADY-CREATED-DRAFT");
case ResponseErrorCode.DmpBlueprintNewVersionAlreadyCreatedDraft: case ResponseErrorCode.PlanBlueprintNewVersionAlreadyCreatedDraft:
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-NEW-VERSION-ALREADY-CREATED-DRAFT"); return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-NEW-VERSION-ALREADY-CREATED-DRAFT");
case ResponseErrorCode.ReferenceTypeCodeExists: case ResponseErrorCode.ReferenceTypeCodeExists:
return language.instant("GENERAL.BACKEND-ERRORS.REFERENCE-TYPE-CODE-EXISTS"); return language.instant("GENERAL.BACKEND-ERRORS.REFERENCE-TYPE-CODE-EXISTS");
case ResponseErrorCode.PrefillingSourceCodeExists: case ResponseErrorCode.PrefillingSourceCodeExists:

View File

@ -8,8 +8,8 @@ import { LanguageInfoService } from './services/culture/language-info-service';
import { DashboardService } from './services/dashboard/dashboard.service'; import { DashboardService } from './services/dashboard/dashboard.service';
import { DepositService } from './services/deposit/deposit.service'; import { DepositService } from './services/deposit/deposit.service';
import { DescriptionTemplateTypeService } from './services/description-template-type/description-template-type.service'; import { DescriptionTemplateTypeService } from './services/description-template-type/description-template-type.service';
import { DmpBlueprintService } from './services/plan/plan-blueprint.service'; import { PlanBlueprintService } from './services/plan/plan-blueprint.service';
import { DmpService } from './services/plan/plan.service'; import { PlanService } from './services/plan/plan.service';
import { BaseHttpV2Service } from './services/http/base-http-v2.service'; import { BaseHttpV2Service } from './services/http/base-http-v2.service';
import { LanguageService } from './services/language/language.service'; import { LanguageService } from './services/language/language.service';
import { LockService } from './services/lock/lock.service'; import { LockService } from './services/lock/lock.service';
@ -79,7 +79,7 @@ export class CoreServiceModule {
LoggingService, LoggingService,
DashboardService, DashboardService,
DepositService, DepositService,
DmpBlueprintService, PlanBlueprintService,
ContactSupportService, ContactSupportService,
LanguageService, LanguageService,
LockService, LockService,
@ -100,7 +100,7 @@ export class CoreServiceModule {
TenantService, TenantService,
UserService, UserService,
LanguageHttpService, LanguageHttpService,
DmpService, PlanService,
DescriptionService, DescriptionService,
MaintenanceService, MaintenanceService,
TagService, TagService,

View File

@ -1,9 +1,9 @@
import { RecentActivityItemType } from "@app/core/common/enum/recent-activity-item-type"; import { RecentActivityItemType } from "@app/core/common/enum/recent-activity-item-type";
import { Description } from "../description/description"; import { Description } from "../description/description";
import { Dmp } from "../plan/plan"; import { Plan } from "../plan/plan";
export interface RecentActivityItem { export interface RecentActivityItem {
type: RecentActivityItemType; type: RecentActivityItemType;
dmp: Dmp; plan: Plan;
description: Description; description: Description;
} }

View File

@ -2,7 +2,7 @@ import { Guid } from "@common/types/guid";
export class DepositRequest { export class DepositRequest {
repositoryId: string; repositoryId: string;
dmpId: Guid; planId: Guid;
authorizationCode: String; authorizationCode: String;
project: DepositRequestFields; project: DepositRequestFields;
} }

View File

@ -2,7 +2,7 @@ import { DescriptionStatus } from "@app/core/common/enum/description-status";
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model"; import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
import { Guid } from "@common/types/guid"; import { Guid } from "@common/types/guid";
import { DescriptionTemplate } from "../description-template/description-template"; import { DescriptionTemplate } from "../description-template/description-template";
import { Dmp, DmpDescriptionTemplate, PublicDmp } from "../plan/plan"; import { Plan, PlanDescriptionTemplate, PublicPlan } from "../plan/plan";
import { Reference, ReferencePersist } from "../reference/reference"; import { Reference, ReferencePersist } from "../reference/reference";
import { Tag, TagPersist } from "../tag/tag"; import { Tag, TagPersist } from "../tag/tag";
import { User } from "../user/user"; import { User } from "../user/user";
@ -17,8 +17,8 @@ export interface Description extends BaseDescription {
descriptionReferences?: DescriptionReference[]; descriptionReferences?: DescriptionReference[];
descriptionTags?: DescriptionTag[]; descriptionTags?: DescriptionTag[];
descriptionTemplate?: DescriptionTemplate; descriptionTemplate?: DescriptionTemplate;
dmpDescriptionTemplate?: DmpDescriptionTemplate; planDescriptionTemplate?: PlanDescriptionTemplate;
dmp?: Dmp; plan?: Plan;
authorizationFlags?: AppPermission[]; authorizationFlags?: AppPermission[];
} }
@ -73,8 +73,8 @@ export interface DescriptionTag extends BaseEntity {
// //
export interface DescriptionPersist extends BaseEntityPersist { export interface DescriptionPersist extends BaseEntityPersist {
label: string; label: string;
dmpId: Guid; planId: Guid;
dmpDescriptionTemplateId: Guid; planDescriptionTemplateId: Guid;
descriptionTemplateId: Guid; descriptionTemplateId: Guid;
status: DescriptionStatus; status: DescriptionStatus;
description: string; description: string;
@ -134,13 +134,13 @@ export interface PublicDescription extends BaseDescription {
description?: string; description?: string;
finalizedAt?: Date; finalizedAt?: Date;
descriptionTemplate?: PublicDescriptionTemplate; descriptionTemplate?: PublicDescriptionTemplate;
dmpDescriptionTemplate?: PublicDmpDescriptionTemplate; planDescriptionTemplate?: PublicPlanDescriptionTemplate;
dmp?: PublicDmp; plan?: PublicPlan;
} }
export interface PublicDmpDescriptionTemplate { export interface PublicPlanDescriptionTemplate {
id: Guid; id: Guid;
dmp: PublicDmp; plan: PublicPlan;
} }
export interface PublicDescriptionTemplate { export interface PublicDescriptionTemplate {
@ -149,7 +149,7 @@ export interface PublicDescriptionTemplate {
description: string; description: string;
} }
export interface DescriptionSectionPermissionResolver { export interface DescriptionSectionPermissionResolver {
dmpId: Guid; planId: Guid;
sectionIds: Guid[]; sectionIds: Guid[];
permissions: string[]; permissions: string[];
} }

View File

@ -1,29 +1,29 @@
import { DmpBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category"; import { PlanBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
import { DmpBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type"; import { PlanBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
import { DmpBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status"; import { PlanBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
import { DmpBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type"; import { PlanBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model"; import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
import { Guid } from "@common/types/guid"; import { Guid } from "@common/types/guid";
import { ReferenceType } from "../reference-type/reference-type"; import { ReferenceType } from "../reference-type/reference-type";
import { PrefillingSource } from "../prefilling-source/prefilling-source"; import { PrefillingSource } from "../prefilling-source/prefilling-source";
import { DmpBlueprintVersionStatus } from "@app/core/common/enum/plan-blueprint-version-status"; import { PlanBlueprintVersionStatus } from "@app/core/common/enum/plan-blueprint-version-status";
export interface DmpBlueprint extends BaseEntity { export interface PlanBlueprint extends BaseEntity {
label: string; label: string;
definition: DmpBlueprintDefinition; definition: PlanBlueprintDefinition;
status: DmpBlueprintStatus; status: PlanBlueprintStatus;
version: number; version: number;
versionStatus: DmpBlueprintVersionStatus; versionStatus: PlanBlueprintVersionStatus;
groupId: Guid; groupId: Guid;
} }
export interface DmpBlueprintDefinition { export interface PlanBlueprintDefinition {
sections?: DmpBlueprintDefinitionSection[]; sections?: PlanBlueprintDefinitionSection[];
} }
export interface DmpBlueprintDefinitionSection { export interface PlanBlueprintDefinitionSection {
id: Guid; id: Guid;
label: string; label: string;
description: string; description: string;
@ -43,7 +43,7 @@ export interface DescriptionTemplatesInSection {
export interface FieldInSection { export interface FieldInSection {
id: Guid; id: Guid;
category: DmpBlueprintFieldCategory; category: PlanBlueprintFieldCategory;
label: string; label: string;
placeholder: string; placeholder: string;
description: string; description: string;
@ -53,11 +53,11 @@ export interface FieldInSection {
} }
export interface SystemFieldInSection extends FieldInSection { export interface SystemFieldInSection extends FieldInSection {
systemFieldType: DmpBlueprintSystemFieldType; systemFieldType: PlanBlueprintSystemFieldType;
} }
export interface ExtraFieldInSection extends FieldInSection { export interface ExtraFieldInSection extends FieldInSection {
dataType: DmpBlueprintExtraFieldDataType; dataType: PlanBlueprintExtraFieldDataType;
} }
export interface ReferenceTypeFieldInSection extends FieldInSection { export interface ReferenceTypeFieldInSection extends FieldInSection {
@ -68,23 +68,23 @@ export interface ReferenceTypeFieldInSection extends FieldInSection {
// //
// Persist // Persist
// //
export interface DmpBlueprintPersist extends BaseEntityPersist { export interface PlanBlueprintPersist extends BaseEntityPersist {
label: string; label: string;
definition: DmpBlueprintDefinitionPersist; definition: PlanBlueprintDefinitionPersist;
status: DmpBlueprintStatus; status: PlanBlueprintStatus;
} }
export interface NewVersionDmpBlueprintPersist { export interface NewVersionPlanBlueprintPersist {
label: string; label: string;
definition: DmpBlueprintDefinitionPersist; definition: PlanBlueprintDefinitionPersist;
status: DmpBlueprintStatus; status: PlanBlueprintStatus;
} }
export interface DmpBlueprintDefinitionPersist { export interface PlanBlueprintDefinitionPersist {
sections?: DmpBlueprintDefinitionSectionPersist[]; sections?: PlanBlueprintDefinitionSectionPersist[];
} }
export interface DmpBlueprintDefinitionSectionPersist { export interface PlanBlueprintDefinitionSectionPersist {
id: Guid; id: Guid;
label: string; label: string;
description: string; description: string;
@ -104,7 +104,7 @@ export interface DescriptionTemplatesInSectionPersist {
export interface FieldInSectionPersist { export interface FieldInSectionPersist {
id: Guid; id: Guid;
category: DmpBlueprintFieldCategory; category: PlanBlueprintFieldCategory;
label: string; label: string;
placeholder: string; placeholder: string;
description: string; description: string;
@ -114,11 +114,11 @@ export interface FieldInSectionPersist {
} }
export interface SystemFieldInSectionPersist extends FieldInSectionPersist { export interface SystemFieldInSectionPersist extends FieldInSectionPersist {
systemFieldType: DmpBlueprintSystemFieldType; systemFieldType: PlanBlueprintSystemFieldType;
} }
export interface ExtraFieldInSectionPersist extends FieldInSectionPersist { export interface ExtraFieldInSectionPersist extends FieldInSectionPersist {
dataType: DmpBlueprintExtraFieldDataType; dataType: PlanBlueprintExtraFieldDataType;
} }
export interface ReferenceTypeFieldInSectionPersist extends FieldInSectionPersist { export interface ReferenceTypeFieldInSectionPersist extends FieldInSectionPersist {

View File

@ -2,14 +2,14 @@ import { Guid } from "@common/types/guid";
import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "../description/description-import"; import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "../description/description-import";
// preprocessing // preprocessing
export interface PreprocessingDmpModel { export interface PreprocessingPlanModel {
label: string; label: string;
blueprintId: Guid; blueprintId: Guid;
preprocessingDescriptionModels: PreprocessingDescriptionModel[]; preprocessingDescriptionModels: PreprocessingDescriptionModel[];
} }
// rda config // rda config
export interface DmpCommonModelConfig { export interface PlanCommonModelConfig {
fileId: Guid; fileId: Guid;
label: string; label: string;
blueprintId: Guid; blueprintId: Guid;

View File

@ -1,14 +1,14 @@
import { BaseEntity } from "@common/base/base-entity.model"; import { BaseEntity } from "@common/base/base-entity.model";
import { Reference } from "../reference/reference"; import { Reference } from "../reference/reference";
import { Dmp } from "./plan"; import { Plan } from "./plan";
import { Guid } from "@common/types/guid"; import { Guid } from "@common/types/guid";
export interface DmpReference extends BaseEntity { export interface PlanReference extends BaseEntity {
dmp?: Dmp; plan?: Plan;
reference?: Reference; reference?: Reference;
data: DmpReferenceData; data: PlanReferenceData;
} }
export interface DmpReferenceData { export interface PlanReferenceData {
blueprintFieldId: Guid; blueprintFieldId: Guid;
} }

View File

@ -1,71 +1,71 @@
import { DmpAccessType } from '@app/core/common/enum/plan-access-type'; import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { DmpVersionStatus } from '@app/core/common/enum/plan-version-status'; import { PlanVersionStatus } from '@app/core/common/enum/plan-version-status';
import { BaseEntity, BaseEntityPersist } from '@common/base/base-entity.model'; import { BaseEntity, BaseEntityPersist } from '@common/base/base-entity.model';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { DescriptionTemplate } from '../description-template/description-template'; import { DescriptionTemplate } from '../description-template/description-template';
import { BaseDescription, Description, PublicDescription } from '../description/description'; import { BaseDescription, Description, PublicDescription } from '../description/description';
import { DmpBlueprint } from '../plan-blueprint/plan-blueprint'; import { PlanBlueprint } from '../plan-blueprint/plan-blueprint';
import { EntityDoi } from '../entity-doi/entity-doi'; import { EntityDoi } from '../entity-doi/entity-doi';
import { ReferencePersist } from '../reference/reference'; import { ReferencePersist } from '../reference/reference';
import { User } from "../user/user"; import { User } from "../user/user";
import { DmpReference } from './plan-reference'; import { PlanReference } from './plan-reference';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { EntityType } from '@app/core/common/enum/entity-type'; import { EntityType } from '@app/core/common/enum/entity-type';
export interface Dmp extends BaseDmp { export interface Plan extends BasePlan {
label?: string; label?: string;
version?: number; version?: number;
versionStatus?: DmpVersionStatus; versionStatus?: PlanVersionStatus;
properties?: DmpProperties; properties?: PlanProperties;
groupId?: String; groupId?: String;
description?: String; description?: String;
finalizedAt?: Date; finalizedAt?: Date;
publishedAt?: Date; publishedAt?: Date;
creator?: User; creator?: User;
accessType?: DmpAccessType; accessType?: PlanAccessType;
blueprint?: DmpBlueprint; blueprint?: PlanBlueprint;
language?: String; language?: String;
publicAfter?: Date; publicAfter?: Date;
dmpReferences?: DmpReference[]; planReferences?: PlanReference[];
dmpUsers?: DmpUser[]; planUsers?: PlanUser[];
descriptions?: Description[]; descriptions?: Description[];
dmpDescriptionTemplates?: DmpDescriptionTemplate[]; planDescriptionTemplates?: PlanDescriptionTemplate[];
entityDois?: EntityDoi[]; entityDois?: EntityDoi[];
otherDmpVersions?: Dmp[]; otherPlanVersions?: Plan[];
authorizationFlags?: AppPermission[]; authorizationFlags?: AppPermission[];
} }
export interface DmpProperties { export interface PlanProperties {
dmpBlueprintValues: DmpBlueprintValue[]; planBlueprintValues: PlanBlueprintValue[];
contacts: DmpContact[]; contacts: PlanContact[];
} }
export interface DmpBlueprintValue { export interface PlanBlueprintValue {
fieldId: Guid; fieldId: Guid;
fieldValue: string; fieldValue: string;
dateValue: Date; dateValue: Date;
numberValue: number; numberValue: number;
} }
export interface DmpContact { export interface PlanContact {
firstName: string; firstName: string;
lastName: string; lastName: string;
email: string; email: string;
} }
export interface DmpUser extends BaseEntity { export interface PlanUser extends BaseEntity {
dmp: Dmp; plan: Plan;
user: User; user: User;
role: DmpUserRole; role: PlanUserRole;
sectionId: Guid; sectionId: Guid;
} }
export interface DmpDescriptionTemplate extends BaseEntity { export interface PlanDescriptionTemplate extends BaseEntity {
dmp?: Dmp; plan?: Plan;
currentDescriptionTemplate?: DescriptionTemplate; //TODO: what is this? currentDescriptionTemplate?: DescriptionTemplate; //TODO: what is this?
descriptionTemplates?: DescriptionTemplate[]; //TODO: why it is array? descriptionTemplates?: DescriptionTemplate[]; //TODO: why it is array?
descriptionTemplateGroupId?: Guid; descriptionTemplateGroupId?: Guid;
@ -75,112 +75,112 @@ export interface DmpDescriptionTemplate extends BaseEntity {
// //
// Persist // Persist
// //
export interface DmpPersist extends BaseEntityPersist { export interface PlanPersist extends BaseEntityPersist {
label: string; label: string;
status: DmpStatus; status: PlanStatus;
properties: DmpPropertiesPersist; properties: PlanPropertiesPersist;
description: String; description: String;
language: String; language: String;
blueprint: Guid; blueprint: Guid;
accessType: DmpAccessType; accessType: PlanAccessType;
descriptionTemplates: DmpDescriptionTemplatePersist[]; descriptionTemplates: PlanDescriptionTemplatePersist[];
users: DmpUserPersist[]; users: PlanUserPersist[];
} }
export interface DmpPropertiesPersist { export interface PlanPropertiesPersist {
dmpBlueprintValues: Map<Guid, DmpBlueprintValuePersist>; planBlueprintValues: Map<Guid, PlanBlueprintValuePersist>;
contacts: DmpContactPersist[]; contacts: PlanContactPersist[];
} }
export interface DmpBlueprintValuePersist { export interface PlanBlueprintValuePersist {
fieldId: Guid; fieldId: Guid;
fieldValue: string; fieldValue: string;
dateValue: Date; dateValue: Date;
numberValue: number; numberValue: number;
references: DmpReferencePersist[]; references: PlanReferencePersist[];
reference: DmpReferencePersist; reference: PlanReferencePersist;
} }
export interface DmpContactPersist { export interface PlanContactPersist {
firstName: string; firstName: string;
lastName: string; lastName: string;
email: string; email: string;
} }
export interface DmpReferencePersist { export interface PlanReferencePersist {
reference?: ReferencePersist; reference?: ReferencePersist;
data?: DmpReferenceDataPersist; data?: PlanReferenceDataPersist;
} }
export interface DmpReferenceDataPersist { export interface PlanReferenceDataPersist {
blueprintFieldId: Guid; blueprintFieldId: Guid;
} }
export interface DmpDescriptionTemplatePersist { export interface PlanDescriptionTemplatePersist {
descriptionTemplateGroupId: Guid; descriptionTemplateGroupId: Guid;
sectionId: Guid; sectionId: Guid;
} }
export interface CloneDmpPersist { export interface ClonePlanPersist {
id: Guid; id: Guid;
label: string; label: string;
description: String; description: String;
descriptions: Guid[]; descriptions: Guid[];
} }
export interface NewVersionDmpPersist { export interface NewVersionPlanPersist {
id: Guid; id: Guid;
label: string; label: string;
description: String; description: String;
blueprintId: Guid; blueprintId: Guid;
descriptions: NewVersionDmpDescriptionPersist[]; descriptions: NewVersionPlanDescriptionPersist[];
hash?: string; hash?: string;
} }
export interface NewVersionDmpDescriptionPersist { export interface NewVersionPlanDescriptionPersist {
descriptionId: Guid; descriptionId: Guid;
blueprintSectionId: Guid; blueprintSectionId: Guid;
} }
export interface DmpUserPersist { export interface PlanUserPersist {
user: Guid; user: Guid;
role: DmpUserRole; role: PlanUserRole;
email: string; email: string;
sectionId: string; sectionId: string;
} }
export interface DmpUserRemovePersist { export interface PlanUserRemovePersist {
id: Guid; id: Guid;
dmpId: Guid; planId: Guid;
role: DmpUserRole; role: PlanUserRole;
} }
export interface DmpUserInvitePersist { export interface PlanUserInvitePersist {
users: DmpUserPersist[]; users: PlanUserPersist[];
} }
// //
// Public // Public
// //
export interface PublicDmp extends BaseDmp { export interface PublicPlan extends BasePlan {
label?: string; label?: string;
version?: number; version?: number;
description?: string; description?: string;
finalizedAt?: Date; finalizedAt?: Date;
publishedAt?: Date; publishedAt?: Date;
groupId?: String; groupId?: String;
accessType: DmpAccessType; accessType: PlanAccessType;
dmpReferences: PublicDmpReference[]; planReferences: PublicPlanReference[];
dmpUsers: PublicDmpUser[]; planUsers: PublicPlanUser[];
descriptions: PublicDescription[]; descriptions: PublicDescription[];
entityDois: PublicEntityDoi[]; entityDois: PublicEntityDoi[];
otherDmpVersions?: PublicDmp[]; otherPlanVersions?: PublicPlan[];
} }
export interface PublicDmpReference { export interface PublicPlanReference {
id: Guid; id: Guid;
dmp: PublicDmp; plan: PublicPlan;
reference: PublicReference; reference: PublicReference;
isActive?: IsActive; isActive?: IsActive;
} }
@ -199,11 +199,11 @@ export interface PublicReferenceType {
code: string; code: string;
} }
export interface PublicDmpUser { export interface PublicPlanUser {
id: Guid; id: Guid;
dmp: PublicDmp; plan: PublicPlan;
user: PublicUser; user: PublicUser;
role: DmpUserRole; role: PlanUserRole;
} }
export interface PublicUser { export interface PublicUser {
@ -219,7 +219,7 @@ export interface PublicEntityDoi {
doi: string; doi: string;
} }
export interface BaseDmp extends BaseEntity { export interface BasePlan extends BaseEntity {
status?: DmpStatus; status?: PlanStatus;
descriptions?: BaseDescription[]; descriptions?: BaseDescription[];
} }

View File

@ -8,7 +8,7 @@ import { DescriptionTemplateField, DescriptionTemplateLabelAndMultiplicityData,
import { DescriptionFieldPersist } from "../model/description/description"; import { DescriptionFieldPersist } from "../model/description/description";
import { StorageFile } from "../model/storage-file/storage-file"; import { StorageFile } from "../model/storage-file/storage-file";
import { DescriptionService } from "../services/description/description.service"; import { DescriptionService } from "../services/description/description.service";
import { DmpService } from "../services/plan/plan.service"; import { PlanService } from "../services/plan/plan.service";
import { StorageFileService } from "../services/storage-file/storage-file.service"; import { StorageFileService } from "../services/storage-file/storage-file.service";
import { DateTimeFormatPipe } from "./date-time-format.pipe"; import { DateTimeFormatPipe } from "./date-time-format.pipe";
@ -19,7 +19,7 @@ export class FieldValuePipe implements PipeTransform {
constructor( constructor(
private dateTimeFormatPipe: DateTimeFormatPipe, private dateTimeFormatPipe: DateTimeFormatPipe,
private dmpService: DmpService, private planService: PlanService,
private storageFileService: StorageFileService, private storageFileService: StorageFileService,
private descriptionService: DescriptionService, private descriptionService: DescriptionService,
private language: TranslateService) { private language: TranslateService) {
@ -77,9 +77,9 @@ export class FieldValuePipe implements PipeTransform {
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: { case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: {
const data = <DescriptionTemplateLabelAndMultiplicityData>field.data; const data = <DescriptionTemplateLabelAndMultiplicityData>field.data;
if (!data?.multipleSelect && controlValue.textValue && controlValue.textValue.length > 0) { if (!data?.multipleSelect && controlValue.textValue && controlValue.textValue.length > 0) {
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y => y.label).join(','))); return this.planService.query(this.planService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y => y.label).join(',')));
} else if (data?.multipleSelect && controlValue.references && controlValue.textListValue && controlValue.textListValue.length > 0) { } else if (data?.multipleSelect && controlValue.references && controlValue.textListValue && controlValue.textListValue.length > 0) {
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y => y.label).join(','))); return this.planService.query(this.planService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y => y.label).join(',')));
} }
break; break;
} }

View File

@ -2,7 +2,7 @@ import { Lookup } from '@common/model/lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { IsActive } from '../common/enum/is-active.enum'; import { IsActive } from '../common/enum/is-active.enum';
import { DescriptionStatus } from '../common/enum/description-status'; import { DescriptionStatus } from '../common/enum/description-status';
import { DmpLookup } from './plan.lookup'; import { PlanLookup } from './plan.lookup';
import { ReferenceType } from '../model/reference-type/reference-type'; import { ReferenceType } from '../model/reference-type/reference-type';
import { DescriptionReferenceLookup } from './reference.lookup'; import { DescriptionReferenceLookup } from './reference.lookup';
import { DescriptionTagLookup } from './tag.lookup'; import { DescriptionTagLookup } from './tag.lookup';
@ -19,7 +19,7 @@ export class DescriptionLookup extends Lookup implements DescriptionFilter {
isActive: IsActive[]; isActive: IsActive[];
statuses: DescriptionStatus[]; statuses: DescriptionStatus[];
dmpSubQuery: DmpLookup; planSubQuery: PlanLookup;
descriptionTemplateSubQuery: DescriptionTemplateLookup; descriptionTemplateSubQuery: DescriptionTemplateLookup;
descriptionTagSubQuery: DescriptionTagLookup; descriptionTagSubQuery: DescriptionTagLookup;
descriptionReferenceSubQuery: DescriptionReferenceLookup; descriptionReferenceSubQuery: DescriptionReferenceLookup;
@ -40,7 +40,7 @@ export interface DescriptionFilter {
isActive: IsActive[]; isActive: IsActive[];
statuses: DescriptionStatus[]; statuses: DescriptionStatus[];
dmpSubQuery: DmpLookup; planSubQuery: PlanLookup;
descriptionTemplateSubQuery: DescriptionTemplateLookup; descriptionTemplateSubQuery: DescriptionTemplateLookup;
descriptionTagSubQuery: DescriptionTagLookup; descriptionTagSubQuery: DescriptionTagLookup;
descriptionReferenceSubQuery: DescriptionReferenceLookup; descriptionReferenceSubQuery: DescriptionReferenceLookup;

View File

@ -1,28 +1,28 @@
import { Lookup } from '@common/model/lookup'; import { Lookup } from '@common/model/lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { IsActive } from '../common/enum/is-active.enum'; import { IsActive } from '../common/enum/is-active.enum';
import { DmpBlueprintStatus } from '../common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '../common/enum/plan-blueprint-status';
import { DmpBlueprintVersionStatus } from '../common/enum/plan-blueprint-version-status'; import { PlanBlueprintVersionStatus } from '../common/enum/plan-blueprint-version-status';
export class DmpBlueprintLookup extends Lookup implements DmpBlueprintFilter { export class PlanBlueprintLookup extends Lookup implements PlanBlueprintFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
statuses: DmpBlueprintStatus[]; statuses: PlanBlueprintStatus[];
groupIds: Guid[]; groupIds: Guid[];
versionStatuses: DmpBlueprintVersionStatus[]; versionStatuses: PlanBlueprintVersionStatus[];
constructor() { constructor() {
super(); super();
} }
} }
export interface DmpBlueprintFilter { export interface PlanBlueprintFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
statuses: DmpBlueprintStatus[]; statuses: PlanBlueprintStatus[];
versionStatuses: DmpBlueprintVersionStatus[]; versionStatuses: PlanBlueprintVersionStatus[];
} }

View File

@ -2,10 +2,10 @@ import { Lookup } from '@common/model/lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { IsActive } from '../common/enum/is-active.enum'; import { IsActive } from '../common/enum/is-active.enum';
export class DmpDescriptionTemplateLookup extends Lookup implements DmpDescriptionTemplateFilter { export class PlanDescriptionTemplateLookup extends Lookup implements PlanDescriptionTemplateFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
dmpIds: Guid[]; planIds: Guid[];
descriptionTemplateGroupIds: Guid[]; descriptionTemplateGroupIds: Guid[];
sectionIds: Guid[]; sectionIds: Guid[];
isActive: IsActive[]; isActive: IsActive[];
@ -16,10 +16,10 @@ export class DmpDescriptionTemplateLookup extends Lookup implements DmpDescripti
} }
} }
export interface DmpDescriptionTemplateFilter { export interface PlanDescriptionTemplateFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
dmpIds: Guid[]; planIds: Guid[];
descriptionTemplateGroupIds: Guid[]; descriptionTemplateGroupIds: Guid[];
sectionIds: Guid[]; sectionIds: Guid[];
isActive: IsActive[]; isActive: IsActive[];

View File

@ -2,10 +2,10 @@ import { Guid } from "@common/types/guid";
import { IsActive } from "../common/enum/is-active.enum"; import { IsActive } from "../common/enum/is-active.enum";
import { Lookup } from "@common/model/lookup"; import { Lookup } from "@common/model/lookup";
export class DmpUserLookup extends Lookup implements DmpUserFilter { export class PlanUserLookup extends Lookup implements PlanUserFilter {
ids: Guid[]; ids: Guid[];
isActive: IsActive[]; isActive: IsActive[];
dmpIds: Guid[]; planIds: Guid[];
userIds: Guid[]; userIds: Guid[];
sectionIds: Guid[]; sectionIds: Guid[];
userRoles: Guid[]; userRoles: Guid[];
@ -15,11 +15,11 @@ export class DmpUserLookup extends Lookup implements DmpUserFilter {
} }
} }
export interface DmpUserFilter { export interface PlanUserFilter {
ids: Guid[]; ids: Guid[];
isActive: IsActive[]; isActive: IsActive[];
dmpIds: Guid[]; planIds: Guid[];
userIds: Guid[]; userIds: Guid[];
sectionIds: Guid[]; sectionIds: Guid[];
userRoles: Guid[]; userRoles: Guid[];

View File

@ -1,47 +1,48 @@
import { Lookup } from '@common/model/lookup'; import { Lookup } from '@common/model/lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { DmpAccessType } from '../common/enum/plan-access-type'; import { PlanAccessType } from '../common/enum/plan-access-type';
import { DmpStatus } from '../common/enum/plan-status'; import { PlanStatus } from '../common/enum/plan-status';
import { DmpVersionStatus } from '../common/enum/plan-version-status'; import { PlanVersionStatus } from '../common/enum/plan-version-status';
import { IsActive } from '../common/enum/is-active.enum'; import { IsActive } from '../common/enum/is-active.enum';
import { DmpDescriptionTemplateLookup } from './plan-description-template.lookup'; import { PlanDescriptionTemplateLookup } from './plan-description-template.lookup';
import { DmpUserLookup } from './plan-user.lookup'; import { PlanUserLookup } from './plan-user.lookup';
import { DmpBlueprintLookup } from './plan-blueprint.lookup'; import { PlanBlueprintLookup } from './plan-blueprint.lookup';
import { DmpReferenceLookup } from './reference.lookup'; import { PlanReferenceLookup } from './reference.lookup';
export class DmpLookup extends Lookup implements DmpFilter { export class PlanLookup extends Lookup implements PlanFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
versionStatuses: DmpVersionStatus[]; versionStatuses: PlanVersionStatus[];
statuses: DmpStatus[]; statuses: PlanStatus[];
accessTypes: DmpAccessType[]; accessTypes: PlanAccessType[];
versions: Number[]; versions: Number[];
groupIds: Guid[]; groupIds: Guid[];
dmpUserSubQuery: DmpUserLookup; planUserSubQuery: PlanUserLookup;
dmpBlueprintSubQuery: DmpBlueprintLookup; planBlueprintSubQuery: PlanBlueprintLookup;
dmpDescriptionTemplateSubQuery: DmpDescriptionTemplateLookup; planDescriptionTemplateSubQuery: PlanDescriptionTemplateLookup;
dmpReferenceSubQuery: DmpReferenceLookup planReferenceSubQuery: PlanReferenceLookup;
constructor() { constructor() {
super(); super();
} }
} }
export interface DmpFilter { export interface PlanFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
versionStatuses: DmpVersionStatus[]; versionStatuses: PlanVersionStatus[];
statuses: DmpStatus[]; statuses: PlanStatus[];
accessTypes: DmpAccessType[]; accessTypes: PlanAccessType[];
versions: Number[]; versions: Number[];
groupIds: Guid[]; groupIds: Guid[];
dmpUserSubQuery: DmpUserLookup; planUserSubQuery: PlanUserLookup;
dmpBlueprintSubQuery: DmpBlueprintLookup; planBlueprintSubQuery: PlanBlueprintLookup;
dmpDescriptionTemplateSubQuery: DmpDescriptionTemplateLookup; planDescriptionTemplateSubQuery: PlanDescriptionTemplateLookup;
planReferenceSubQuery: PlanReferenceLookup;
} }

View File

@ -26,7 +26,8 @@ export class DescriptionReferenceLookup extends Lookup {
} }
} }
export class DmpReferenceLookup extends Lookup { export class PlanReferenceLookup extends Lookup {
planIds: Guid[];
referenceIds: Guid[]; referenceIds: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;

View File

@ -25,10 +25,10 @@ export class FileTransformerHttpService extends BaseService {
return this.http.get<RepositoryFileFormat[]>(url).pipe(catchError((error: any) => throwError(error))); return this.http.get<RepositoryFileFormat[]>(url).pipe(catchError((error: any) => throwError(error)));
} }
exportDmp(dmpId: Guid, repositoryId: string, format: string): Observable<any> { exportDmp(planId: Guid, repositoryId: string, format: string): Observable<any> {
//TODO: implement //TODO: implement
const url = `${this.apiBase}/export-dmp`; const url = `${this.apiBase}/export-dmp`;
return this.http.post<any>(url, {id: dmpId, repositoryId: repositoryId, format: format}, {responseType: 'blob', observe: 'response'}).pipe(catchError((error: any) => throwError(error))); return this.http.post<any>(url, {id: planId, repositoryId: repositoryId, format: format}, {responseType: 'blob', observe: 'response'}).pipe(catchError((error: any) => throwError(error)));
} }
exportDescription(id: Guid, repositoryId: string, format: string): Observable<any> { exportDescription(id: Guid, repositoryId: string, format: string): Observable<any> {

View File

@ -8,7 +8,7 @@ import { FileUtils } from '../utilities/file-utils.service';
import { AuthService } from '../auth/auth.service'; import { AuthService } from '../auth/auth.service';
import { RepositoryFileFormat } from '@app/core/model/file/file-format.model'; import { RepositoryFileFormat } from '@app/core/model/file/file-format.model';
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type'; import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
import { DmpService } from '../plan/plan.service'; import { PlanService } from '../plan/plan.service';
import { DescriptionService } from '../description/description.service'; import { DescriptionService } from '../description/description.service';
import { AnalyticsService } from '../matomo/analytics-service'; import { AnalyticsService } from '../matomo/analytics-service';
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service'; import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
@ -20,7 +20,7 @@ export class FileTransformerService extends BaseService {
private fileTransformerHttpService: FileTransformerHttpService, private fileTransformerHttpService: FileTransformerHttpService,
private analyticsService: AnalyticsService, private analyticsService: AnalyticsService,
private fileUtils: FileUtils, private fileUtils: FileUtils,
private dmpService: DmpService, private planService: PlanService,
private descriptionService: DescriptionService, private descriptionService: DescriptionService,
private authentication: AuthService, private authentication: AuthService,
private httpErrorHandlingService: HttpErrorHandlingService private httpErrorHandlingService: HttpErrorHandlingService
@ -70,7 +70,7 @@ export class FileTransformerService extends BaseService {
exportDmp(id: Guid, repositoryId: string, format: string) { exportDmp(id: Guid, repositoryId: string, format: string) {
this._loading = true; this._loading = true;
if (repositoryId == this.xmlExportRepo.repositoryId) { if (repositoryId == this.xmlExportRepo.repositoryId) {
this.dmpService.downloadXML(id) this.planService.downloadXML(id)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(response => { .subscribe(response => {
const blob = new Blob([response.body], { type: 'application/xml' }); const blob = new Blob([response.body], { type: 'application/xml' });

View File

@ -11,8 +11,8 @@ export class AnalyticsService {
public static About: string = 'About'; public static About: string = 'About';
public static DescriptionTemplateEditor: string = 'Admin: DMP Blueprints'; public static DescriptionTemplateEditor: string = 'Admin: DMP Blueprints';
public static DescriptionTemplateListing: string = 'Admin: DMP Templates'; public static DescriptionTemplateListing: string = 'Admin: DMP Templates';
public static DmpBlueprintEditor: string = 'Admin: DMP Blueprints'; public static PlanBlueprintEditor: string = 'Admin: DMP Blueprints';
public static DmpBlueprintListing: string = 'Admin: DMP Templates'; public static PlanBlueprintListing: string = 'Admin: DMP Templates';
public static LanguagesEditor: string = 'Admin: Languages'; public static LanguagesEditor: string = 'Admin: Languages';
public static PrefillingSourcesEditor: string = 'Admin: PrefillingSources'; public static PrefillingSourcesEditor: string = 'Admin: PrefillingSources';
public static ReferencesEditor: string = 'Admin: References'; public static ReferencesEditor: string = 'Admin: References';
@ -29,11 +29,11 @@ export class AnalyticsService {
public static DescriptionFilterDialog: string = 'Dataset Criteria'; public static DescriptionFilterDialog: string = 'Dataset Criteria';
public static DescriptionListingItem: string = 'Description Listing Item'; public static DescriptionListingItem: string = 'Description Listing Item';
public static DescriptionOverview: string = 'Description Overview'; public static DescriptionOverview: string = 'Description Overview';
public static DmpEditor: string = 'DMP Editor'; public static PlanEditor: string = 'DMP Editor';
public static DmpListing: string = 'DMPs'; public static DmpListing: string = 'DMPs';
public static DmpFilterDialog: string = 'DMP Criteria'; public static DmpFilterDialog: string = 'DMP Criteria';
public static DmpListingItem: string = 'DMP Listing Item'; public static DmpListingItem: string = 'DMP Listing Item';
public static StartNewDmpDialog: string = 'Start New DMP Dialog'; public static StartNewPlanDialog: string = 'Start New DMP Dialog';
public static DmpUploadDialog: string = 'DMP Upload Dialog'; public static DmpUploadDialog: string = 'DMP Upload Dialog';
public static DmpOverview: string = 'DMP Overview'; public static DmpOverview: string = 'DMP Overview';
public static FAQ: string = 'FAQ'; public static FAQ: string = 'FAQ';

View File

@ -1,8 +1,8 @@
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 { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection, DmpBlueprintPersist, NewVersionDmpBlueprintPersist } from '@app/core/model/plan-blueprint/plan-blueprint'; import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection, PlanBlueprintPersist, NewVersionPlanBlueprintPersist } from '@app/core/model/plan-blueprint/plan-blueprint';
import { DmpBlueprintLookup } from '@app/core/query/plan-blueprint.lookup'; import { PlanBlueprintLookup } from '@app/core/query/plan-blueprint.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';
import { BaseHttpParams } from '@common/http/base-http-params'; import { BaseHttpParams } from '@common/http/base-http-params';
@ -15,13 +15,13 @@ import { catchError, map } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { ConfigurationService } from '../configuration/configuration.service'; import { ConfigurationService } from '../configuration/configuration.service';
import { BaseHttpV2Service } from '../http/base-http-v2.service'; import { BaseHttpV2Service } from '../http/base-http-v2.service';
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
import { error } from 'console'; import { error } from 'console';
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status'; import { PlanBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
@Injectable() @Injectable()
export class DmpBlueprintService { export class PlanBlueprintService {
private headers = new HttpHeaders(); private headers = new HttpHeaders();
@ -29,53 +29,53 @@ export class DmpBlueprintService {
) { ) {
} }
private get apiBase(): string { return `${this.configurationService.server}dmp-blueprint`; } private get apiBase(): string { return `${this.configurationService.server}plan-blueprint`; }
query(q: DmpBlueprintLookup): Observable<QueryResult<DmpBlueprint>> { query(q: PlanBlueprintLookup): Observable<QueryResult<PlanBlueprint>> {
const url = `${this.apiBase}/query`; const url = `${this.apiBase}/query`;
return this.http.post<QueryResult<DmpBlueprint>>(url, q).pipe(catchError((error: any) => throwError(error))); return this.http.post<QueryResult<PlanBlueprint>>(url, q).pipe(catchError((error: any) => throwError(error)));
} }
getSingle(id: Guid, reqFields: string[] = []): Observable<DmpBlueprint> { getSingle(id: Guid, reqFields: string[] = []): Observable<PlanBlueprint> {
const url = `${this.apiBase}/${id}`; const url = `${this.apiBase}/${id}`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.get<DmpBlueprint>(url, options).pipe( .get<PlanBlueprint>(url, options).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
persist(item: DmpBlueprintPersist): Observable<DmpBlueprint> { persist(item: PlanBlueprintPersist): Observable<PlanBlueprint> {
const url = `${this.apiBase}/persist`; const url = `${this.apiBase}/persist`;
return this.http return this.http
.post<DmpBlueprint>(url, item).pipe( .post<PlanBlueprint>(url, item).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
delete(id: Guid): Observable<DmpBlueprint> { delete(id: Guid): Observable<PlanBlueprint> {
const url = `${this.apiBase}/${id}`; const url = `${this.apiBase}/${id}`;
return this.http return this.http
.delete<DmpBlueprint>(url).pipe( .delete<PlanBlueprint>(url).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
clone(id: Guid, reqFields: string[] = []): Observable<DmpBlueprint> { clone(id: Guid, reqFields: string[] = []): Observable<PlanBlueprint> {
const url = `${this.apiBase}/clone/${id}`; const url = `${this.apiBase}/clone/${id}`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.get<DmpBlueprint>(url, options).pipe( .get<PlanBlueprint>(url, options).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
newVersion(item: NewVersionDmpBlueprintPersist, reqFields: string[] = []): Observable<DmpBlueprint> { newVersion(item: NewVersionPlanBlueprintPersist, reqFields: string[] = []): Observable<PlanBlueprint> {
const url = `${this.apiBase}/new-version`; const url = `${this.apiBase}/new-version`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.post<DmpBlueprint>(url, item).pipe( .post<PlanBlueprint>(url, item).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
@ -89,7 +89,7 @@ export class DmpBlueprintService {
return this.httpClient.get(url, { params: params, responseType: 'blob', observe: 'response', headers: headerXml }); return this.httpClient.get(url, { params: params, responseType: 'blob', observe: 'response', headers: headerXml });
} }
uploadFile(file: FileList, labelSent: string, reqFields: string[] = []): Observable<DmpBlueprint> { uploadFile(file: FileList, labelSent: string, reqFields: string[] = []): Observable<PlanBlueprint> {
const url = `${this.apiBase}/xml/import`; const url = `${this.apiBase}/xml/import`;
const params = new BaseHttpParams(); const params = new BaseHttpParams();
params.interceptorContext = { params.interceptorContext = {
@ -108,9 +108,9 @@ export class DmpBlueprintService {
initialItems: (data?: any) => this.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)), initialItems: (data?: any) => this.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DmpBlueprint) => item.label, displayFn: (item: PlanBlueprint) => item.label,
titleFn: (item: DmpBlueprint) => item.label, titleFn: (item: PlanBlueprint) => item.label,
valueAssign: (item: DmpBlueprint) => item.id, valueAssign: (item: PlanBlueprint) => item.id,
}; };
// tslint:disable-next-line: member-ordering // tslint:disable-next-line: member-ordering
@ -118,13 +118,13 @@ export class DmpBlueprintService {
initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup(null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)), initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup(null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)),
filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup(searchQuery, excludedItems)).pipe(map(x => x.items)), filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup(searchQuery, excludedItems)).pipe(map(x => x.items)),
getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)), getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)),
displayFn: (item: DmpBlueprint) => item.label, displayFn: (item: PlanBlueprint) => item.label,
titleFn: (item: DmpBlueprint) => item.label, titleFn: (item: PlanBlueprint) => item.label,
valueAssign: (item: DmpBlueprint) => item.id, valueAssign: (item: PlanBlueprint) => item.id,
}; };
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpBlueprintStatus[]): DmpBlueprintLookup { public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanBlueprintStatus[]): PlanBlueprintLookup {
const lookup: DmpBlueprintLookup = new DmpBlueprintLookup(); const lookup: PlanBlueprintLookup = new PlanBlueprintLookup();
lookup.page = { size: 100, offset: 0 }; lookup.page = { size: 100, offset: 0 };
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
if (ids && ids.length > 0) { lookup.ids = ids; } if (ids && ids.length > 0) { lookup.ids = ids; }
@ -132,30 +132,30 @@ export class DmpBlueprintService {
lookup.statuses = statuses; lookup.statuses = statuses;
lookup.project = { lookup.project = {
fields: [ fields: [
nameof<DmpBlueprint>(x => x.id), nameof<PlanBlueprint>(x => x.id),
nameof<DmpBlueprint>(x => x.label), nameof<PlanBlueprint>(x => x.label),
nameof<DmpBlueprint>(x => x.version) nameof<PlanBlueprint>(x => x.version)
] ]
}; };
lookup.order = { items: [nameof<DmpBlueprint>(x => x.label)] }; lookup.order = { items: [nameof<PlanBlueprint>(x => x.label)] };
lookup.versionStatuses = [DmpBlueprintVersionStatus.Current]; lookup.versionStatuses = [PlanBlueprintVersionStatus.Current];
if (like) { lookup.like = this.filterService.transformLike(like); } if (like) { lookup.like = this.filterService.transformLike(like); }
return lookup; return lookup;
} }
// Finalized Blueprint with definitions Single AutoComplete // Finalized Blueprint with definitions Single AutoComplete
singleAutocompleteBlueprintConfiguration: SingleAutoCompleteConfiguration = { singleAutocompleteBlueprintConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, null, [DmpBlueprintStatus.Finalized])).pipe(map(x => x.items)), initialItems: (data?: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, null, [PlanBlueprintStatus.Finalized])).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteWithDefinitonLookup(searchQuery, null, null, [DmpBlueprintStatus.Finalized])).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteWithDefinitonLookup(searchQuery, null, null, [PlanBlueprintStatus.Finalized])).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DmpBlueprint) => item.label, displayFn: (item: PlanBlueprint) => item.label,
subtitleFn: (item: DmpBlueprint) => this.language.instant('DMP-EDITOR.FIELDS.DMP-BLUEPRINT-VERSION') + ' '+ item.version, subtitleFn: (item: PlanBlueprint) => this.language.instant('Plan-EDITOR.FIELDS.Plan-BLUEPRINT-VERSION') + ' '+ item.version,
titleFn: (item: DmpBlueprint) => item.label, titleFn: (item: PlanBlueprint) => item.label,
valueAssign: (item: DmpBlueprint) => item.id, valueAssign: (item: PlanBlueprint) => item.id,
}; };
public buildAutocompleteWithDefinitonLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpBlueprintStatus[]): DmpBlueprintLookup { public buildAutocompleteWithDefinitonLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanBlueprintStatus[]): PlanBlueprintLookup {
const lookup: DmpBlueprintLookup = new DmpBlueprintLookup(); const lookup: PlanBlueprintLookup = new PlanBlueprintLookup();
lookup.page = { size: 100, offset: 0 }; lookup.page = { size: 100, offset: 0 };
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
if (ids && ids.length > 0) { lookup.ids = ids; } if (ids && ids.length > 0) { lookup.ids = ids; }
@ -163,17 +163,17 @@ export class DmpBlueprintService {
lookup.statuses = statuses; lookup.statuses = statuses;
lookup.project = { lookup.project = {
fields: [ fields: [
nameof<DmpBlueprint>(x => x.id), nameof<PlanBlueprint>(x => x.id),
nameof<DmpBlueprint>(x => x.label), nameof<PlanBlueprint>(x => x.label),
nameof<DmpBlueprint>(x => x.version), nameof<PlanBlueprint>(x => x.version),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
] ]
}; };
lookup.order = { items: [nameof<DmpBlueprint>(x => x.label)] }; lookup.order = { items: [nameof<PlanBlueprint>(x => x.label)] };
lookup.versionStatuses = [DmpBlueprintVersionStatus.Previous, DmpBlueprintVersionStatus.Current]; lookup.versionStatuses = [PlanBlueprintVersionStatus.Previous, PlanBlueprintVersionStatus.Current];
if (like) { lookup.like = this.filterService.transformLike(like); } if (like) { lookup.like = this.filterService.transformLike(like); }
return lookup; return lookup;
} }
@ -184,7 +184,7 @@ export class DmpBlueprintService {
// //
// //
getSection(dmpBlueprint: DmpBlueprint, sectionId: Guid): DmpBlueprintDefinitionSection { getSection(PlanBlueprint: PlanBlueprint, sectionId: Guid): PlanBlueprintDefinitionSection {
return dmpBlueprint?.definition?.sections?.find(x => x.id === sectionId); return PlanBlueprint?.definition?.sections?.find(x => x.id === sectionId);
} }
} }

View File

@ -1,10 +1,10 @@
import { HttpClient, HttpHeaders, HttpParamsOptions, HttpResponse } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpParamsOptions, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup'; import { PlanDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
import { DmpLookup } from '@app/core/query/plan.lookup'; import { PlanLookup } from '@app/core/query/plan.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';
import { QueryResult } from '@common/model/query-result'; import { QueryResult } from '@common/model/query-result';
@ -15,15 +15,15 @@ import { catchError, map } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { BaseHttpParams } from '../../../../common/http/base-http-params'; import { BaseHttpParams } from '../../../../common/http/base-http-params';
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type'; import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
import { CloneDmpPersist, Dmp, DmpPersist, DmpUser, DmpUserInvitePersist, DmpUserPersist, DmpUserRemovePersist, NewVersionDmpPersist, PublicDmp } from '../../model/plan/plan'; import { ClonePlanPersist, Plan, PlanPersist, PlanUser, PlanUserInvitePersist, PlanUserPersist, PlanUserRemovePersist, NewVersionPlanPersist, PublicPlan } from '../../model/plan/plan';
import { AuthService } from '../auth/auth.service'; import { AuthService } from '../auth/auth.service';
import { ConfigurationService } from '../configuration/configuration.service'; import { ConfigurationService } from '../configuration/configuration.service';
import { BaseHttpV2Service } from '../http/base-http-v2.service'; import { BaseHttpV2Service } from '../http/base-http-v2.service';
import { DmpValidationResult } from '@app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component'; import { PlanValidationResult } from '@app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component';
import { DmpCommonModelConfig, PreprocessingDmpModel } from '@app/core/model/plan/plan-import'; import { PlanCommonModelConfig, PreprocessingPlanModel } from '@app/core/model/plan/plan-import';
@Injectable() @Injectable()
export class DmpService { export class PlanService {
private headers = new HttpHeaders(); private headers = new HttpHeaders();
@ -36,33 +36,33 @@ export class DmpService {
) { ) {
} }
private get apiBase(): string { return `${this.configurationService.server}dmp`; } private get apiBase(): string { return `${this.configurationService.server}plan`; }
query(q: DmpLookup): Observable<QueryResult<Dmp>> { query(q: PlanLookup): Observable<QueryResult<Plan>> {
const url = `${this.apiBase}/query`; const url = `${this.apiBase}/query`;
return this.http.post<QueryResult<Dmp>>(url, q).pipe(catchError((error: any) => throwError(error))); return this.http.post<QueryResult<Plan>>(url, q).pipe(catchError((error: any) => throwError(error)));
} }
publicQuery(q: DmpLookup): Observable<QueryResult<PublicDmp>> { publicQuery(q: PlanLookup): Observable<QueryResult<PublicPlan>> {
const url = `${this.apiBase}/public/query`; const url = `${this.apiBase}/public/query`;
const params = new BaseHttpParams(); const params = new BaseHttpParams();
params.interceptorContext = { params.interceptorContext = {
excludedInterceptors: [InterceptorType.AuthToken, excludedInterceptors: [InterceptorType.AuthToken,
InterceptorType.TenantHeaderInterceptor] InterceptorType.TenantHeaderInterceptor]
}; };
return this.http.post<QueryResult<PublicDmp>>(url, q, {params: params}).pipe(catchError((error: any) => throwError(error))); return this.http.post<QueryResult<PublicPlan>>(url, q, {params: params}).pipe(catchError((error: any) => throwError(error)));
} }
getSingle(id: Guid, reqFields: string[] = []): Observable<Dmp> { getSingle(id: Guid, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/${id}`; const url = `${this.apiBase}/${id}`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.get<Dmp>(url, options).pipe( .get<Plan>(url, options).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
getPublicSingle(id: Guid, reqFields: string[] = []): Observable<PublicDmp> { getPublicSingle(id: Guid, reqFields: string[] = []): Observable<PublicPlan> {
const url = `${this.apiBase}/public/${id}`; const url = `${this.apiBase}/public/${id}`;
const options: HttpParamsOptions = { fromObject: { f: reqFields } }; const options: HttpParamsOptions = { fromObject: { f: reqFields } };
@ -74,23 +74,23 @@ export class DmpService {
}; };
return this.http return this.http
.get<PublicDmp>(url, { params: params }).pipe( .get<PublicPlan>(url, { params: params }).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
persist(item: DmpPersist): Observable<Dmp> { persist(item: PlanPersist): Observable<Plan> {
const url = `${this.apiBase}/persist`; const url = `${this.apiBase}/persist`;
return this.http return this.http
.post<Dmp>(url, item).pipe( .post<Plan>(url, item).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
delete(id: Guid): Observable<Dmp> { delete(id: Guid): Observable<Plan> {
const url = `${this.apiBase}/${id}`; const url = `${this.apiBase}/${id}`;
return this.http return this.http
.delete<Dmp>(url).pipe( .delete<Plan>(url).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
@ -112,59 +112,59 @@ export class DmpService {
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
validate(id: Guid): Observable<DmpValidationResult> { validate(id: Guid): Observable<PlanValidationResult> {
const url = `${this.apiBase}/validate/${id}`; const url = `${this.apiBase}/validate/${id}`;
return this.http return this.http
.get<DmpValidationResult>(url).pipe( .get<PlanValidationResult>(url).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
clone(item: CloneDmpPersist, reqFields: string[] = []): Observable<Dmp> { clone(item: ClonePlanPersist, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/clone`; const url = `${this.apiBase}/clone`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.post<Dmp>(url, item, options).pipe( .post<Plan>(url, item, options).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
newVersion(item: NewVersionDmpPersist, reqFields: string[] = []): Observable<Dmp> { newVersion(item: NewVersionPlanPersist, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/new-version`; const url = `${this.apiBase}/new-version`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.post<Dmp>(url, item, options ).pipe( .post<Plan>(url, item, options ).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
assignUsers(id: Guid, items: DmpUserPersist[], reqFields: string[] = []): Observable<DmpUser> { assignUsers(id: Guid, items: PlanUserPersist[], reqFields: string[] = []): Observable<PlanUser> {
const url = `${this.apiBase}/${id}/assign-users`; const url = `${this.apiBase}/${id}/assign-users`;
const options = { params: { f: reqFields } }; const options = { params: { f: reqFields } };
return this.http return this.http
.post<DmpUser>(url, items).pipe( .post<PlanUser>(url, items).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
removeUser(item: DmpUserRemovePersist, reqFields: string[] = []): Observable<Dmp> { removeUser(item: PlanUserRemovePersist, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/remove-user`; const url = `${this.apiBase}/remove-user`;
return this.http return this.http
.post<Dmp>(url, item).pipe( .post<Plan>(url, item).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
inviteUsers(dmpId: Guid, item: DmpUserInvitePersist): Observable<any> { inviteUsers(PlanId: Guid, item: PlanUserInvitePersist): Observable<any> {
const url = `${this.apiBase}/${dmpId}/invite-users`; const url = `${this.apiBase}/${PlanId}/invite-users`;
return this.http return this.http
.post<any>(url, item).pipe( .post<any>(url, item).pipe(
catchError((error: any) => throwError(error))); catchError((error: any) => throwError(error)));
} }
acceptInvitation(dmpId: Guid, token: string): Observable<any> { acceptInvitation(PlanId: Guid, token: string): Observable<any> {
const url = `${this.apiBase}/${dmpId}/token/${token}/invite-accept`; const url = `${this.apiBase}/${PlanId}/token/${token}/invite-accept`;
return this.http.get<any>(url).pipe(catchError((error: any) => throwError(error))); return this.http.get<any>(url).pipe(catchError((error: any) => throwError(error)));
} }
@ -179,7 +179,7 @@ export class DmpService {
return this.httpClient.get(url, { params: params, responseType: 'blob', observe: 'response', headers: headerXml }); return this.httpClient.get(url, { params: params, responseType: 'blob', observe: 'response', headers: headerXml });
} }
uploadXml(file: File, label: string, reqFields: string[] = []): Observable<Dmp> { uploadXml(file: File, label: string, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/xml/import`; const url = `${this.apiBase}/xml/import`;
const params = new BaseHttpParams(); const params = new BaseHttpParams();
params.interceptorContext = { params.interceptorContext = {
@ -198,7 +198,7 @@ export class DmpService {
catchError((error: any) => throwError(error)));; catchError((error: any) => throwError(error)));;
} }
preprocessingDmp(fileId: Guid, repositoryId: string): Observable<PreprocessingDmpModel> { preprocessingPlan(fileId: Guid, repositoryId: string): Observable<PreprocessingPlanModel> {
const url = `${this.apiBase}/json/preprocessing`; const url = `${this.apiBase}/json/preprocessing`;
const params = new BaseHttpParams(); const params = new BaseHttpParams();
@ -209,13 +209,13 @@ export class DmpService {
formData.append('fileId', fileId.toString()); formData.append('fileId', fileId.toString());
formData.append('repositoryId', repositoryId); formData.append('repositoryId', repositoryId);
return this.http.post<PreprocessingDmpModel>(url, formData, { params: params }).pipe(catchError((error: any) => throwError(error))); return this.http.post<PreprocessingPlanModel>(url, formData, { params: params }).pipe(catchError((error: any) => throwError(error)));
} }
uploadJson(item: DmpCommonModelConfig, reqFields: string[] = []): Observable<Dmp> { uploadJson(item: PlanCommonModelConfig, reqFields: string[] = []): Observable<Plan> {
const url = `${this.apiBase}/json/import`; const url = `${this.apiBase}/json/import`;
return this.http.post<Dmp>(url, item).pipe(catchError((error: any) => throwError(error))); return this.http.post<Plan>(url, item).pipe(catchError((error: any) => throwError(error)));
} }
@ -227,9 +227,9 @@ export class DmpService {
initialItems: (data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active])).pipe(map(x => x.items)), initialItems: (data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active])).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: Dmp) => item.label, displayFn: (item: Plan) => item.label,
titleFn: (item: Dmp) => item.label, titleFn: (item: Plan) => item.label,
valueAssign: (item: Dmp) => item.id, valueAssign: (item: Plan) => item.id,
}; };
// tslint:disable-next-line: member-ordering // tslint:disable-next-line: member-ordering
@ -237,13 +237,13 @@ export class DmpService {
initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)), initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)),
filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active],searchQuery, excludedItems)).pipe(map(x => x.items)), filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active],searchQuery, excludedItems)).pipe(map(x => x.items)),
getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, selectedItems)).pipe(map(x => x.items)), getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, selectedItems)).pipe(map(x => x.items)),
displayFn: (item: Dmp) => item.label, displayFn: (item: Plan) => item.label,
titleFn: (item: Dmp) => item.label, titleFn: (item: Plan) => item.label,
valueAssign: (item: Dmp) => item.id, valueAssign: (item: Plan) => item.id,
}; };
public buildAutocompleteLookup(isActive: IsActive[], like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpStatus[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup { public buildAutocompleteLookup(isActive: IsActive[], like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanStatus[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
const lookup: DmpLookup = new DmpLookup(); const lookup: PlanLookup = new PlanLookup();
lookup.page = { size: 100, offset: 0 }; lookup.page = { size: 100, offset: 0 };
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
if (ids && ids.length > 0) { lookup.ids = ids; } if (ids && ids.length > 0) { lookup.ids = ids; }
@ -251,12 +251,12 @@ export class DmpService {
lookup.statuses = statuses; lookup.statuses = statuses;
lookup.project = { lookup.project = {
fields: [ fields: [
nameof<Dmp>(x => x.id), nameof<Plan>(x => x.id),
nameof<Dmp>(x => x.label) nameof<Plan>(x => x.label)
] ]
}; };
if (dmpDescriptionTemplateSubQuery != null) lookup.dmpDescriptionTemplateSubQuery = dmpDescriptionTemplateSubQuery; if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
lookup.order = { items: [nameof<Dmp>(x => x.label)] }; lookup.order = { items: [nameof<Plan>(x => x.label)] };
if (like) { lookup.like = this.filterService.transformLike(like); } if (like) { lookup.like = this.filterService.transformLike(like); }
return lookup; return lookup;
} }
@ -267,12 +267,12 @@ export class DmpService {
// //
// //
getCurrentUserRolesInDmp(dmpUsers: DmpUser[]): DmpUserRole[] { getCurrentUserRolesInPlan(planUsers: PlanUser[]): PlanUserRole[] {
const principalId: Guid = this.authService.userId(); const principalId: Guid = this.authService.userId();
let dmpUserRoles: DmpUserRole[] = null; let planUserRoles: PlanUserRole[] = null;
if (principalId) { if (principalId) {
dmpUserRoles = dmpUsers.filter(element => element.isActive == IsActive.Active && element?.user?.id === principalId).map(x => x.role); planUserRoles = planUsers.filter(element => element.isActive == IsActive.Active && element?.user?.id === principalId).map(x => x.role);
} }
return dmpUserRoles; return planUserRoles;
} }
} }

View File

@ -1,7 +1,7 @@
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 { ReferenceSourceType } from '@app/core/common/enum/reference-source-type'; import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
import { DmpReference } from '@app/core/model/plan/plan-reference'; import { PlanReference } from '@app/core/model/plan/plan-reference';
import { Definition, Field, Reference, ReferencePersist } from '@app/core/model/reference/reference'; import { Definition, Field, Reference, ReferencePersist } from '@app/core/model/reference/reference';
import { ReferenceSearchDefinitionLookup, ReferenceSearchLookup } from '@app/core/query/reference-search.lookup'; import { ReferenceSearchDefinitionLookup, ReferenceSearchLookup } from '@app/core/query/reference-search.lookup';
import { ReferenceLookup } from '@app/core/query/reference.lookup'; import { ReferenceLookup } from '@app/core/query/reference.lookup';
@ -184,15 +184,15 @@ export class ReferenceService {
// //
// //
hasRerefenceOfTypes(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): boolean { hasRerefenceOfTypes(planReferences: PlanReference[], referenceTypeIds?: Guid[]): boolean {
return this.getReferencesForTypes(dmpReferences, referenceTypeIds)?.length > 0; return this.getReferencesForTypes(planReferences, referenceTypeIds)?.length > 0;
} }
getReferencesForTypes(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): DmpReference[] { getReferencesForTypes(planReferences: PlanReference[], referenceTypeIds?: Guid[]): PlanReference[] {
return dmpReferences?.filter(x => referenceTypeIds?.includes(x?.reference?.type?.id)).filter(x=> x.isActive === IsActive.Active);; return planReferences?.filter(x => referenceTypeIds?.includes(x?.reference?.type?.id)).filter(x=> x.isActive === IsActive.Active);;
} }
getReferencesForTypesFirstSafe(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): DmpReference { getReferencesForTypesFirstSafe(planReferences: PlanReference[], referenceTypeIds?: Guid[]): PlanReference {
return this.getReferencesForTypes(dmpReferences, referenceTypeIds)?.find(Boolean); return this.getReferencesForTypes(planReferences, referenceTypeIds)?.find(Boolean);
} }
} }

View File

@ -32,7 +32,7 @@ export class UserService {
} }
queryDmpAssociated(q: UserLookup): Observable<QueryResult<DmpAssociatedUser>> { queryDmpAssociated(q: UserLookup): Observable<QueryResult<DmpAssociatedUser>> {
const url = `${this.apiBase}/dmp-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<DmpAssociatedUser>>(url, q).pipe(catchError((error: any) => throwError(error)));
} }

View File

@ -7,12 +7,12 @@ import { DescriptionTemplateFieldDataExternalDatasetType } from '@app/core/commo
import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type'; import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type';
import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status'; import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status';
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status'; import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
import { DmpAccessType } from '@app/core/common/enum/plan-access-type'; import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
import { DmpBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category'; import { PlanBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type'; import { PlanBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { DmpUserType } from '@app/core/common/enum/plan-user-type'; import { PlanUserType } from '@app/core/common/enum/plan-user-type';
import { ExternalFetcherApiHTTPMethodType } from '@app/core/common/enum/external-fetcher-api-http-method-type'; import { ExternalFetcherApiHTTPMethodType } from '@app/core/common/enum/external-fetcher-api-http-method-type';
import { ExternalFetcherSourceType } from '@app/core/common/enum/external-fetcher-source-type'; import { ExternalFetcherSourceType } from '@app/core/common/enum/external-fetcher-source-type';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
@ -26,8 +26,8 @@ import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-ma
import { UserDescriptionTemplateRole } from '@app/core/common/enum/user-description-template-role'; import { UserDescriptionTemplateRole } from '@app/core/common/enum/user-description-template-role';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { AppRole } from '../../common/enum/app-role'; import { AppRole } from '../../common/enum/app-role';
import { DmpBlueprintExtraFieldDataType } from '../../common/enum/plan-blueprint-field-type'; import { PlanBlueprintExtraFieldDataType } from '../../common/enum/plan-blueprint-field-type';
import { DmpStatus } from '../../common/enum/plan-status'; import { PlanStatus } from '../../common/enum/plan-status';
import { ValidationType } from '../../common/enum/validation-type'; import { ValidationType } from '../../common/enum/validation-type';
@Injectable() @Injectable()
@ -47,6 +47,7 @@ export class EnumUtils {
return []; return [];
} }
toIsActiveString(status: IsActive): string { toIsActiveString(status: IsActive): string {
switch (status) { switch (status) {
case IsActive.Active: return this.language.instant('TYPES.IS-ACTIVE.ACTIVE'); case IsActive.Active: return this.language.instant('TYPES.IS-ACTIVE.ACTIVE');
@ -66,10 +67,10 @@ export class EnumUtils {
} }
} }
toDmpStatusString(status: DmpStatus): string { toPlanStatusString(status: PlanStatus): string {
switch (status) { switch (status) {
case DmpStatus.Draft: return this.language.instant('TYPES.DMP.DRAFT'); case PlanStatus.Draft: return this.language.instant('TYPES.PLAN.DRAFT');
case DmpStatus.Finalized: return this.language.instant('TYPES.DMP.FINALISED'); case PlanStatus.Finalized: return this.language.instant('TYPES.PLAN.FINALISED');
} }
} }
@ -113,30 +114,30 @@ export class EnumUtils {
} }
} }
toDmpBlueprintStatusString(status: DmpBlueprintStatus): string { toPlanBlueprintStatusString(status: PlanBlueprintStatus): string {
switch (status) { switch (status) {
case DmpBlueprintStatus.Draft: return this.language.instant('TYPES.DMP-BLUEPRINT-STATUS.DRAFT'); case PlanBlueprintStatus.Draft: return this.language.instant('TYPES.PLAN-BLUEPRINT-STATUS.DRAFT');
case DmpBlueprintStatus.Finalized: return this.language.instant('TYPES.DMP-BLUEPRINT-STATUS.FINALIZED'); case PlanBlueprintStatus.Finalized: return this.language.instant('TYPES.PLAN-BLUEPRINT-STATUS.FINALIZED');
} }
} }
toDmpBlueprintSystemFieldTypeString(status: DmpBlueprintSystemFieldType): string { toPlanBlueprintSystemFieldTypeString(status: PlanBlueprintSystemFieldType): string {
switch (status) { switch (status) {
case DmpBlueprintSystemFieldType.Title: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.TITLE'); case PlanBlueprintSystemFieldType.Title: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.TITLE');
case DmpBlueprintSystemFieldType.Description: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.DESCRIPTION'); case PlanBlueprintSystemFieldType.Description: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.DESCRIPTION');
case DmpBlueprintSystemFieldType.Language: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.LANGUAGE'); case PlanBlueprintSystemFieldType.Language: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.LANGUAGE');
case DmpBlueprintSystemFieldType.Contact: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.CONTACT'); case PlanBlueprintSystemFieldType.Contact: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.CONTACT');
case DmpBlueprintSystemFieldType.AccessRights: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.ACCESS_RIGHTS'); case PlanBlueprintSystemFieldType.AccessRights: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.ACCESS_RIGHTS');
case DmpBlueprintSystemFieldType.User: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.USER'); case PlanBlueprintSystemFieldType.User: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.USER');
} }
} }
toDmpBlueprintExtraFieldDataTypeString(status: DmpBlueprintExtraFieldDataType): string { toPlanBlueprintExtraFieldDataTypeString(status: PlanBlueprintExtraFieldDataType): string {
switch (status) { switch (status) {
case DmpBlueprintExtraFieldDataType.Text: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.TEXT'); case PlanBlueprintExtraFieldDataType.Text: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.TEXT');
case DmpBlueprintExtraFieldDataType.RichText: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.RICH-TEXT'); case PlanBlueprintExtraFieldDataType.RichText: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.RICH-TEXT');
case DmpBlueprintExtraFieldDataType.Date: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.DATE'); case PlanBlueprintExtraFieldDataType.Date: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.DATE');
case DmpBlueprintExtraFieldDataType.Number: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.NUMBER'); case PlanBlueprintExtraFieldDataType.Number: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.NUMBER');
} }
} }
@ -145,8 +146,8 @@ export class EnumUtils {
case DescriptionTemplateFieldType.SELECT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.SELECT'); case DescriptionTemplateFieldType.SELECT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.SELECT');
case DescriptionTemplateFieldType.BOOLEAN_DECISION: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.BOOLEAN-DECISION'); case DescriptionTemplateFieldType.BOOLEAN_DECISION: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.BOOLEAN-DECISION');
case DescriptionTemplateFieldType.RADIO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RADIO-BOX'); case DescriptionTemplateFieldType.RADIO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RADIO-BOX');
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS'); case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-PLAN-ENTITIES-DMPS');
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DESCRIPTIONS'); case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-PLAN-ENTITIES-DESCRIPTIONS');
case DescriptionTemplateFieldType.CHECK_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.CHECKBOX'); case DescriptionTemplateFieldType.CHECK_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.CHECKBOX');
case DescriptionTemplateFieldType.FREE_TEXT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.FREE-TEXT'); case DescriptionTemplateFieldType.FREE_TEXT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.FREE-TEXT');
case DescriptionTemplateFieldType.TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TEXT-AREA'); case DescriptionTemplateFieldType.TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TEXT-AREA');
@ -215,13 +216,13 @@ export class EnumUtils {
} }
} }
toDmpUserRolesString(roles: DmpUserRole[]): string { return roles.map(x => this.toDmpUserRoleString(x)).join(', ') } toPlanUserRolesString(roles: PlanUserRole[]): string { return roles.map(x => this.toPlanUserRoleString(x)).join(', ') }
toDmpUserRoleString(role: DmpUserRole): string { toPlanUserRoleString(role: PlanUserRole): string {
switch (role) { switch (role) {
case DmpUserRole.Owner: return this.language.instant('TYPES.DMP-USER-ROLE.OWNER'); case PlanUserRole.Owner: return this.language.instant('TYPES.PLAN-USER-ROLE.OWNER');
case DmpUserRole.Viewer: return this.language.instant('TYPES.DMP-USER-ROLE.VIEWER'); case PlanUserRole.Viewer: return this.language.instant('TYPES.PLAN-USER-ROLE.VIEWER');
case DmpUserRole.DescriptionContributor: return this.language.instant('TYPES.DMP-USER-ROLE.DESCRIPTION-CONTRIBUTOR'); case PlanUserRole.DescriptionContributor: return this.language.instant('TYPES.PLAN-USER-ROLE.DESCRIPTION-CONTRIBUTOR');
case DmpUserRole.Reviewer: return this.language.instant('TYPES.DMP-USER-ROLE.REVIEWER'); case PlanUserRole.Reviewer: return this.language.instant('TYPES.PLAN-USER-ROLE.REVIEWER');
} }
} }
@ -234,10 +235,10 @@ export class EnumUtils {
} }
} }
public toDmpAccessTypeString(value: DmpAccessType): string { public toPlanAccessTypeString(value: PlanAccessType): string {
switch (value) { switch (value) {
case DmpAccessType.Public: return this.language.instant('TYPES.DMP-ACCESS-TYPE.PUBLIC'); case PlanAccessType.Public: return this.language.instant('TYPES.PLAN-ACCESS-TYPE.PUBLIC');
case DmpAccessType.Restricted: return this.language.instant('TYPES.DMP-ACCESS-TYPE.RESTRICTED'); case PlanAccessType.Restricted: return this.language.instant('TYPES.PLAN-ACCESS-TYPE.RESTRICTED');
} }
} }
@ -249,10 +250,10 @@ export class EnumUtils {
} }
} }
public toDmpUserTypeString(value: DmpUserType): string { public toPlanUserTypeString(value: PlanUserType): string {
switch (value) { switch (value) {
case DmpUserType.Internal: return this.language.instant('TYPES.DMP-USER-TYPE.INTERNAL'); case PlanUserType.Internal: return this.language.instant('TYPES.PLAN-USER-TYPE.INTERNAL');
case DmpUserType.External: return this.language.instant('TYPES.DMP-USER-TYPE.EXTERNAL'); case PlanUserType.External: return this.language.instant('TYPES.PLAN-USER-TYPE.EXTERNAL');
} }
} }
@ -269,11 +270,11 @@ export class EnumUtils {
} }
} }
public toDmpBlueprintFieldCategoryString(value: DmpBlueprintFieldCategory): string { public toPlanBlueprintFieldCategoryString(value: PlanBlueprintFieldCategory): string {
switch (value) { switch (value) {
case DmpBlueprintFieldCategory.System: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.SYSTEM'); case PlanBlueprintFieldCategory.System: return this.language.instant('TYPES.PLAN-BLUEPRINT-FIELD-CATEGORY.SYSTEM');
case DmpBlueprintFieldCategory.Extra: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.EXTRA'); case PlanBlueprintFieldCategory.Extra: return this.language.instant('TYPES.PLAN-BLUEPRINT-FIELD-CATEGORY.EXTRA');
case DmpBlueprintFieldCategory.ReferenceType: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.REFERENCE-TYPE'); case PlanBlueprintFieldCategory.ReferenceType: return this.language.instant('TYPES.PLAN-BLUEPRINT-FIELD-CATEGORY.REFERENCE-TYPE');
} }
} }
@ -295,9 +296,9 @@ export class EnumUtils {
public toLockTargetTypeString(status: LockTargetType): string { public toLockTargetTypeString(status: LockTargetType): string {
switch (status) { switch (status) {
case LockTargetType.Dmp: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DMP'); case LockTargetType.Dmp: return this.language.instant('TYPES.LOCK-TARGET-TYPE.PLAN');
case LockTargetType.Description: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DESCRIPTION'); case LockTargetType.Description: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DESCRIPTION');
case LockTargetType.DmpBlueprint: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DMP-BLUEPRINT'); case LockTargetType.PlanBlueprint: return this.language.instant('TYPES.LOCK-TARGET-TYPE.PLAN-BLUEPRINT');
case LockTargetType.DescriptionTemplate: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DESCRIPTION-TEMPLATE'); case LockTargetType.DescriptionTemplate: return this.language.instant('TYPES.LOCK-TARGET-TYPE.DESCRIPTION-TEMPLATE');
} }
} }

View File

@ -49,7 +49,7 @@
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="heading">1.2 {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION'| translate}} *</div> <div class="heading">1.2 {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION'| translate}} *</div>
<!-- <div class="hint">{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}</div> --> <!-- <div class="hint">{{'PLAN-EDITOR.MAIN-INFO.HINT' | translate}}</div> -->
<div class="hint">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION-HINT'| translate}}</div> <div class="hint">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION-HINT'| translate}}</div>
<div class="full-width basic-info-input"> <div class="full-width basic-info-input">
<rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION-PLACEHOLDER'" [wrapperClasses]="(formGroup.get('description').touched && formGroup.get('description').hasError('required')) ? 'required' : ''" [editable]="formGroup.controls['description'].status !== 'DISABLED'"> <rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-DESCRIPTION-PLACEHOLDER'" [wrapperClasses]="(formGroup.get('description').touched && formGroup.get('description').hasError('required')) ? 'required' : ''" [editable]="formGroup.controls['description'].status !== 'DISABLED'">
@ -73,7 +73,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-12"> <div class="col-12">
<!-- <div class="heading">1.4 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}</div> --> <!-- <div class="heading">1.4 {{'PLAN-EDITOR.FIELDS.LANGUAGE' | translate}}</div> -->
<div class="heading">1.4 {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-LANGUAGE'| translate}} *</div> <div class="heading">1.4 {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-LANGUAGE'| translate}} *</div>
<div class="hint">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-LANGUAGE-HINT'| translate}}</div> <div class="hint">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-LANGUAGE-HINT'| translate}}</div>
<mat-form-field class="full-width basic-info-input"> <mat-form-field class="full-width basic-info-input">
@ -229,7 +229,7 @@
<div class="row w-100 justify-content-center"> <div class="row w-100 justify-content-center">
<div class="col-auto"> <div class="col-auto">
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.NOTHING-HERE-HINT'| translate}} {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.NOTHING-HERE-HINT'| translate}}
<p *ngIf="formGroup.get('definition').get('pages').dirty && formGroup.get('definition').get('pages').hasError('required')">{{'DMP-BLUEPRINT-EDITOR.FIELDS-REQUIRED' | translate}}</p> <p *ngIf="formGroup.get('definition').get('pages').dirty && formGroup.get('definition').get('pages').hasError('required')">{{'PLAN-BLUEPRINT-EDITOR.FIELDS-REQUIRED' | translate}}</p>
<p *ngIf="formGroup.get('definition').get('pages').hasError('backendError')">{{formGroup.get('definition').get('pages').getError('backendError').message}}</p> <p *ngIf="formGroup.get('definition').get('pages').hasError('backendError')">{{formGroup.get('definition').get('pages').getError('backendError').message}}</p>
</div> </div>
</div> </div>

View File

@ -33,7 +33,7 @@
<div class="mt-2"> <div class="mt-2">
<button mat-raised-button color="primary" (click)="sendUserTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-USER-TOUCH')}}</button> <button mat-raised-button color="primary" (click)="sendUserTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-USER-TOUCH')}}</button>
<button mat-raised-button color="primary" (click)="sendTenantTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-TENANT-TOUCH')}}</button> <button mat-raised-button color="primary" (click)="sendTenantTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-TENANT-TOUCH')}}</button>
<button mat-raised-button color="primary" (click)="sendDmpTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-DMP-TOUCH')}}</button> <button mat-raised-button color="primary" (click)="sendDmpTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-PLAN-TOUCH')}}</button>
<button mat-raised-button color="primary" (click)="sendDescriptionTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-DESCRIPTION-TOUCH')}}</button> <button mat-raised-button color="primary" (click)="sendDescriptionTouchEvents($event)" class="lightblue-btn button">{{language.instant('MAINTENANCE-TASKS.SECTIONS.EVENTS.ACTIONS.SEND-DESCRIPTION-TOUCH')}}</button>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>

View File

@ -3,14 +3,14 @@
<div class="col-md-10 offset-md-1"> <div class="col-md-10 offset-md-1">
<div class="row align-items-center mt-4 mb-4" *ngIf="formGroup"> <div class="row align-items-center mt-4 mb-4" *ngIf="formGroup">
<div class="col-md col-12"> <div class="col-md col-12">
<!-- <h3 *ngIf="!isFinalized && !isNewVersion && isNew">{{'DMP-BLUEPRINT-EDITOR.TITLE.NEW' | translate}}</h3> <!-- <h3 *ngIf="!isFinalized && !isNewVersion && isNew">{{'PLAN-BLUEPRINT-EDITOR.TITLE.NEW' | translate}}</h3>
<h3 *ngIf="!isClone && !isNewVersion && !isNew">{{formGroup.get('label').value}}</h3> <h3 *ngIf="!isClone && !isNewVersion && !isNew">{{formGroup.get('label').value}}</h3>
<h3 *ngIf="isClone"> <h3 *ngIf="isClone">
<span>{{'DMP-BLUEPRINT-EDITOR.TITLE.CLONE' | translate}}</span> <span>{{'PLAN-BLUEPRINT-EDITOR.TITLE.CLONE' | translate}}</span>
{{formGroup.get('label').value}} {{formGroup.get('label').value}}
</h3> </h3>
<h3 *ngIf="isNewVersion"> <h3 *ngIf="isNewVersion">
<span>{{'DMP-BLUEPRINT-EDITOR.TITLE.NEW-VERSION' | translate}}</span> <span>{{'PLAN-BLUEPRINT-EDITOR.TITLE.NEW-VERSION' | translate}}</span>
{{formGroup.get('label').value}} {{formGroup.get('label').value}}
</h3> --> </h3> -->
<app-navigation-breadcrumb /> <app-navigation-breadcrumb />
@ -18,14 +18,14 @@
<div class="col-md-auto mb-md-0 col-12 mb-2" *ngIf="!isNew && !isClone && !isNewVersion && this.editorModel.belongsToCurrentTenant != false"> <div class="col-md-auto mb-md-0 col-12 mb-2" *ngIf="!isNew && !isClone && !isNewVersion && this.editorModel.belongsToCurrentTenant != false">
<button [disabled]="isLocked" mat-button class="action-btn" type="button" (click)="delete()"> <button [disabled]="isLocked" mat-button class="action-btn" type="button" (click)="delete()">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}} {{'PLAN-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}}
</button> </button>
</div> </div>
<div class="col-md-auto col-12" *ngIf="formGroup.get('status').value==1 && !isClone && !isNewVersion"> <div class="col-md-auto col-12" *ngIf="formGroup.get('status').value==1 && !isClone && !isNewVersion">
<button mat-button class="finalize-btn" (click)="downloadXML()" type="button">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.DOWNLOAD-XML' | translate }}</button> <button mat-button class="finalize-btn" (click)="downloadXML()" type="button">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.DOWNLOAD-XML' | translate }}</button>
</div> </div>
<div *ngIf="formGroup.get('status').value!=1" class="col-auto"> <div *ngIf="formGroup.get('status').value!=1" class="col-auto">
<button mat-button class="finalize-btn" (click)="finalize()" [disabled]="!this.isFormValid() || !canFinalize || isLocked" type="button">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.FINALIZE' | translate }}</button> <button mat-button class="finalize-btn" (click)="finalize()" [disabled]="!this.isFormValid() || !canFinalize || isLocked" type="button">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.FINALIZE' | translate }}</button>
</div> </div>
</div> </div>
<form *ngIf="formGroup"> <form *ngIf="formGroup">
@ -34,14 +34,14 @@
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.NAME' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.NAME' | translate}}</mat-label>
<input matInput type="text" name="label" [formControl]="formGroup.get('label')" required> <input matInput type="text" name="label" [formControl]="formGroup.get('label')" required>
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error> <mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<h4 class="col-12">{{'DMP-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}} <h4 class="col-12">{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'DMP-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error> <mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
</h4> </h4>
<div class="col-12" cdkDropList (cdkDropListDropped)="dropSections($event)"> <div class="col-12" cdkDropList (cdkDropListDropped)="dropSections($event)">
<div *ngFor="let section of formGroup.get('definition').get('sections').controls; let sectionIndex=index;" class="row mb-3" cdkDrag [cdkDragDisabled]="formGroup.disabled"> <div *ngFor="let section of formGroup.get('definition').get('sections').controls; let sectionIndex=index;" class="row mb-3" cdkDrag [cdkDragDisabled]="formGroup.disabled">
@ -50,12 +50,12 @@
<mat-card-header> <mat-card-header>
<div class="row mb-3 d-flex align-items-center"> <div class="row mb-3 d-flex align-items-center">
<div class="col-auto d-flex"> <div class="col-auto d-flex">
<mat-card-title>{{'DMP-BLUEPRINT-EDITOR.FIELDS.SECTION-PREFIX' | translate}} {{sectionIndex + 1}}</mat-card-title> <mat-card-title>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTION-PREFIX' | translate}} {{sectionIndex + 1}}</mat-card-title>
</div> </div>
<div class="col-auto d-flex"><mat-icon [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon></div> <div class="col-auto d-flex"><mat-icon [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon></div>
<div class="col-auto d-flex"> <div class="col-auto d-flex">
<button mat-icon-button class="action-list-icon" matTooltip="{{'DMP-BLUEPRINT-EDITOR.ACTIONS.REMOVE-SECTION' | translate}}" (click)="removeSection(sectionIndex)" [disabled]="formGroup.disabled"> <button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-SECTION' | translate}}" (click)="removeSection(sectionIndex)" [disabled]="formGroup.disabled">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
@ -65,7 +65,7 @@
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.SECTION-NAME' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTION-NAME' | translate}}</mat-label>
<input matInput type="text" name="label" [formControl]="section.get('label')" required> <input matInput type="text" name="label" [formControl]="section.get('label')" required>
<mat-error *ngIf="section.get('label').hasError('backendError')">{{section.get('label').getError('backendError').message}}</mat-error> <mat-error *ngIf="section.get('label').hasError('backendError')">{{section.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="section.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="section.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -73,14 +73,14 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.SECTION-DESCRIPTION' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTION-DESCRIPTION' | translate}}</mat-label>
<input matInput type="text" name="description" [formControl]="section.get('description')"> <input matInput type="text" name="description" [formControl]="section.get('description')">
<mat-error *ngIf="section.get('description').hasError('backendError')">{{section.get('description').getError('backendError').message}}</mat-error> <mat-error *ngIf="section.get('description').hasError('backendError')">{{section.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="section.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="section.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-auto mb-3"> <div class="col-auto mb-3">
<button mat-button class="action-btn" type="button" (click)="addField(sectionIndex)" [disabled]="formGroup.disabled">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.ADD-FIELD' | translate}}</button> <button mat-button class="action-btn" type="button" (click)="addField(sectionIndex)" [disabled]="formGroup.disabled">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.ADD-FIELD' | translate}}</button>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -93,7 +93,7 @@
<mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon> <mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button mat-icon-button matTooltip="{{'DMP-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)" [disabled]="formGroup.disabled"> <button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)" [disabled]="formGroup.disabled">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
@ -107,9 +107,9 @@
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-12 col-xl-4"> <div class="col-12 col-xl-4">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label>
<mat-select [formControl]="field.get('category')" [disabled]="field.disabled" (selectionChange)="fieldCategoryChanged(sectionIndex, fieldIndex)"> <mat-select [formControl]="field.get('category')" [disabled]="field.disabled" (selectionChange)="fieldCategoryChanged(sectionIndex, fieldIndex)">
<mat-option *ngFor="let fieldCategory of dmpBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toDmpBlueprintFieldCategoryString(fieldCategory)}}</mat-option> <mat-option *ngFor="let fieldCategory of dmpBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="field.get('category').hasError('backendError')">{{field.get('category').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('category').hasError('backendError')">{{field.get('category').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('category').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('category').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -117,9 +117,9 @@
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.System"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.System">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label>
<mat-select [formControl]="field.get('systemFieldType')" [disabled]="field.disabled"> <mat-select [formControl]="field.get('systemFieldType')" [disabled]="field.disabled">
<mat-option *ngFor="let systemFieldType of dmpBlueprintSystemFieldTypeEnum" [disabled]="systemFieldDisabled(systemFieldType)" [value]="systemFieldType">{{enumUtils.toDmpBlueprintSystemFieldTypeString(systemFieldType)}}</mat-option> <mat-option *ngFor="let systemFieldType of planBlueprintSystemFieldTypeEnum" [disabled]="systemFieldDisabled(systemFieldType)" [value]="systemFieldType">{{enumUtils.toPlanBlueprintSystemFieldTypeString(systemFieldType)}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="field.get('systemFieldType').hasError('backendError')">{{field.get('systemFieldType').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('systemFieldType').hasError('backendError')">{{field.get('systemFieldType').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('systemFieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('systemFieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -127,10 +127,10 @@
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.Extra"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.Extra">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label>
<mat-select [formControl]="field.get('dataType')"> <mat-select [formControl]="field.get('dataType')">
<mat-option *ngFor="let extraFieldDataType of dmpBlueprintExtraFieldDataTypeEnum" [value]="extraFieldDataType"> <mat-option *ngFor="let extraFieldDataType of planBlueprintExtraFieldDataTypeEnum" [value]="extraFieldDataType">
{{enumUtils.toDmpBlueprintExtraFieldDataTypeString(extraFieldDataType)}} {{enumUtils.toPlanBlueprintExtraFieldDataTypeString(extraFieldDataType)}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="field.get('dataType').hasError('backendError')">{{field.get('dataType').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('dataType').hasError('backendError')">{{field.get('dataType').getError('backendError').message}}</mat-error>
@ -139,15 +139,15 @@
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label>
<app-single-auto-complete placeholder="{{'DMP-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}" [required]="true" [formControl]="field.get('referenceTypeId')" [configuration]="referenceTypeService.singleAutocompleteConfiguration"></app-single-auto-complete> <app-single-auto-complete placeholder="{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}" [required]="true" [formControl]="field.get('referenceTypeId')" [configuration]="referenceTypeService.singleAutocompleteConfiguration"></app-single-auto-complete>
<mat-error *ngIf="field.get('referenceTypeId').hasError('backendError')">{{field.get('referenceTypeId').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('referenceTypeId').hasError('backendError')">{{field.get('referenceTypeId').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('referenceTypeId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('referenceTypeId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.FIELD-LABEL' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-LABEL' | translate}}</mat-label>
<input matInput type="text" name="label" [formControl]="field.get('label')"> <input matInput type="text" name="label" [formControl]="field.get('label')">
<mat-error *ngIf="field.get('label').hasError('backendError')">{{field.get('label').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('label').hasError('backendError')">{{field.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -155,7 +155,7 @@
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.FIELD-PLACEHOLDER' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="text" name="placeholder" [formControl]="field.get('placeholder')"> <input matInput type="text" name="placeholder" [formControl]="field.get('placeholder')">
<mat-error *ngIf="field.get('placeholder').hasError('backendError')">{{field.get('placeholder').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('placeholder').hasError('backendError')">{{field.get('placeholder').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('placeholder').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('placeholder').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -163,7 +163,7 @@
</div> </div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null"> <div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.FIELD-DESCRIPTION' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-DESCRIPTION' | translate}}</mat-label>
<input matInput type="text" name="description" [formControl]="field.get('description')"> <input matInput type="text" name="description" [formControl]="field.get('description')">
<mat-error *ngIf="field.get('description').hasError('backendError')">{{field.get('description').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('description').hasError('backendError')">{{field.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -171,21 +171,21 @@
</div> </div>
<div class="col-12 order-xl-8" *ngIf="field.get('category').value != null"> <div class="col-12 order-xl-8" *ngIf="field.get('category').value != null">
<mat-form-field class="mt-3 w-100"> <mat-form-field class="mt-3 w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.SEMANTICS' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SEMANTICS' | translate}}</mat-label>
<app-multiple-auto-complete placeholder="{{'DMP-BLUEPRINT-EDITOR.FIELDS.SEMANTICS' | translate}}" [required]="false" [separatorKeysCodes]="separatorKeysCodes" [formControl]="field.get('semantics')" [configuration]="semanticsService.multipleAutocompleteConfiguration"> <app-multiple-auto-complete placeholder="{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SEMANTICS' | translate}}" [required]="false" [separatorKeysCodes]="separatorKeysCodes" [formControl]="field.get('semantics')" [configuration]="semanticsService.multipleAutocompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="field.get('semantics').hasError('backendError')">{{field.get('semantics').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('semantics').hasError('backendError')">{{field.get('semantics').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('semantics').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('semantics').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-auto col-xl-2 section-field" *ngIf="field.get('category').value != null"> <div class="col-auto col-xl-2 section-field" *ngIf="field.get('category').value != null">
<mat-checkbox [disabled]="alwaysRequiredSystemFieldTypes.includes(field.get('systemFieldType')?.value) || formGroup.disabled" [checked]="field.get('required').value" (change)="field.get('required').setValue($event.checked)"><span>{{'DMP-BLUEPRINT-EDITOR.FIELDS.FIELD-REQUIRED' | translate}}</span></mat-checkbox> <mat-checkbox [disabled]="alwaysRequiredSystemFieldTypes.includes(field.get('systemFieldType')?.value) || formGroup.disabled" [checked]="field.get('required').value" (change)="field.get('required').setValue($event.checked)"><span>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-REQUIRED' | translate}}</span></mat-checkbox>
<mat-error *ngIf="field.get('required').hasError('backendError')">{{field.get('required').getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('required').hasError('backendError')">{{field.get('required').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>
<div class="col-auto col-xl-2"> <div class="col-auto col-xl-2">
<div *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType"> <div *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
<mat-checkbox [disabled]="formGroup.disabled" [checked]="field.get('multipleSelect').value" (change)="field.get('multipleSelect').setValue($event.checked)"><span>{{'DMP-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}}</span></mat-checkbox> <mat-checkbox [disabled]="formGroup.disabled" [checked]="field.get('multipleSelect').value" (change)="field.get('multipleSelect').setValue($event.checked)"><span>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}}</span></mat-checkbox>
<mat-error *ngIf="field.get('multipleSelect')?.hasError('backendError')">{{field.get('multipleSelect')?.getError('backendError').message}}</mat-error> <mat-error *ngIf="field.get('multipleSelect')?.hasError('backendError')">{{field.get('multipleSelect')?.getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('multipleSelect')?.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="field.get('multipleSelect')?.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>
@ -193,7 +193,7 @@
</div> </div>
</div> </div>
<div [hidden]="viewOnly" class="col-12 col-xl-auto section-options-horizontal"> <div [hidden]="viewOnly" class="col-12 col-xl-auto section-options-horizontal">
<button mat-icon-button matTooltip="{{'DMP-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)" [disabled]="formGroup.disabled"> <button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)" [disabled]="formGroup.disabled">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
@ -203,7 +203,7 @@
</div> </div>
</div> </div>
</div> </div>
<mat-error *ngIf="section.get('fields').dirty && section.get('fields').hasError('required')">{{'DMP-BLUEPRINT-EDITOR.FIELDS-REQUIRED' | translate}}</mat-error> <mat-error *ngIf="section.get('fields').dirty && section.get('fields').hasError('required')">{{'PLAN-BLUEPRINT-EDITOR.FIELDS-REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="section.get('fields').hasError('backendError')">{{section.get('fields').getError('backendError').message}}</mat-error> <mat-error *ngIf="section.get('fields').hasError('backendError')">{{section.get('fields').getError('backendError').message}}</mat-error>
</div> </div>
</div> </div>
@ -213,13 +213,13 @@
<div class="row d-flex flex-column"> <div class="row d-flex flex-column">
<div class="col-auto"> <div class="col-auto">
<mat-checkbox [formControl]="section.get('hasTemplates')" (change)="removeAllDescriptionTemplates($event, sectionIndex)"> <mat-checkbox [formControl]="section.get('hasTemplates')" (change)="removeAllDescriptionTemplates($event, sectionIndex)">
{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATES' | translate}} {{'PLAN-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATES' | translate}}
</mat-checkbox> </mat-checkbox>
<mat-error *ngIf="section.get('hasTemplates').hasError('backendError')">{{section.get('hasTemplates').getError('backendError').message}}</mat-error> <mat-error *ngIf="section.get('hasTemplates').hasError('backendError')">{{section.get('hasTemplates').getError('backendError').message}}</mat-error>
<mat-error *ngIf="section.get('hasTemplates').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="section.get('hasTemplates').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>
<div class="col-auto" *ngIf="section.get('hasTemplates').value == true"> <div class="col-auto" *ngIf="section.get('hasTemplates').value == true">
<button mat-button class="action-btn" type="button" (click)="addDescriptionTemplate(sectionIndex)" [disabled]="formGroup.disabled">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.ADD-DESCRIPTION-TEMPLATE' | translate}}</button> <button mat-button class="action-btn" type="button" (click)="addDescriptionTemplate(sectionIndex)" [disabled]="formGroup.disabled">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.ADD-DESCRIPTION-TEMPLATE' | translate}}</button>
</div> </div>
</div> </div>
</div> </div>
@ -236,7 +236,7 @@
<mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon> <mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button mat-icon-button class="action-list-icon" matTooltip="{{'DMP-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)" [disabled]="formGroup.disabled"> <button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)" [disabled]="formGroup.disabled">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
@ -251,7 +251,7 @@
<div class="row"> <div class="row">
<div class="col-12 col-lg-6"> <div class="col-12 col-lg-6">
<mat-form-field class="w-100 mt-3"> <mat-form-field class="w-100 mt-3">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE' | translate}}</mat-label>
<app-single-auto-complete [formControl]="descriptionTemplate.get('descriptionTemplateGroupId')" [configuration]="descriptionTempalteGroupSingleAutocompleteConfiguration" (optionActionClicked)="onPreviewDescriptionTemplate($event, sectionIndex, descriptionTemplateIndex)"></app-single-auto-complete> <app-single-auto-complete [formControl]="descriptionTemplate.get('descriptionTemplateGroupId')" [configuration]="descriptionTempalteGroupSingleAutocompleteConfiguration" (optionActionClicked)="onPreviewDescriptionTemplate($event, sectionIndex, descriptionTemplateIndex)"></app-single-auto-complete>
<mat-error *ngIf="descriptionTemplate.get('descriptionTemplateGroupId').hasError('backendError')">{{descriptionTemplate.get('descriptionTemplateGroupId').getError('backendError').message}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('descriptionTemplateGroupId').hasError('backendError')">{{descriptionTemplate.get('descriptionTemplateGroupId').getError('backendError').message}}</mat-error>
<mat-error *ngIf="descriptionTemplate.get('descriptionTemplateGroupId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('descriptionTemplateGroupId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -259,7 +259,7 @@
</div> </div>
<!-- <div class="col-12 col-lg-6 col-xl-4"> <!-- <div class="col-12 col-lg-6 col-xl-4">
<mat-form-field class="w-100 mt-3"> <mat-form-field class="w-100 mt-3">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-LABEL' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-LABEL' | translate}}</mat-label>
<input matInput type="text" name="label" [formControl]="descriptionTemplate.get('label')"> <input matInput type="text" name="label" [formControl]="descriptionTemplate.get('label')">
<mat-error *ngIf="descriptionTemplate.get('label').hasError('backendError')">{{descriptionTemplate.get('label').getError('backendError').message}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('label').hasError('backendError')">{{descriptionTemplate.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="descriptionTemplate.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -267,7 +267,7 @@
</div> --> </div> -->
<div class="col-12 col-lg-3"> <div class="col-12 col-lg-3">
<mat-form-field class="w-100 mt-3"> <mat-form-field class="w-100 mt-3">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY' | translate}}</mat-label>
<input matInput type="number" min="0" [max]="descriptionTemplate.get('maxMultiplicity').value" name="minMultiplicity" [formControl]="descriptionTemplate.get('minMultiplicity')"> <input matInput type="number" min="0" [max]="descriptionTemplate.get('maxMultiplicity').value" name="minMultiplicity" [formControl]="descriptionTemplate.get('minMultiplicity')">
<mat-error *ngIf="descriptionTemplate.get('minMultiplicity').hasError('backendError')">{{descriptionTemplate.get('minMultiplicity').getError('backendError').message}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('minMultiplicity').hasError('backendError')">{{descriptionTemplate.get('minMultiplicity').getError('backendError').message}}</mat-error>
<mat-error *ngIf="descriptionTemplate.get('minMultiplicity').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('minMultiplicity').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -275,7 +275,7 @@
</div> </div>
<div class="col-12 col-lg-3"> <div class="col-12 col-lg-3">
<mat-form-field class="w-100 mt-3"> <mat-form-field class="w-100 mt-3">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY' | translate}}</mat-label>
<input matInput type="number" [min]="descriptionTemplate.get('minMultiplicity').value != null && descriptionTemplate.get('minMultiplicity').value != 0 ? descriptionTemplate.get('minMultiplicity').value : 1" name="maxMultiplicity" [formControl]="descriptionTemplate.get('maxMultiplicity')"> <input matInput type="number" [min]="descriptionTemplate.get('minMultiplicity').value != null && descriptionTemplate.get('minMultiplicity').value != 0 ? descriptionTemplate.get('minMultiplicity').value : 1" name="maxMultiplicity" [formControl]="descriptionTemplate.get('maxMultiplicity')">
<mat-error *ngIf="descriptionTemplate.get('maxMultiplicity').hasError('backendError')">{{descriptionTemplate.get('maxMultiplicity').getError('backendError').message}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('maxMultiplicity').hasError('backendError')">{{descriptionTemplate.get('maxMultiplicity').getError('backendError').message}}</mat-error>
<mat-error *ngIf="descriptionTemplate.get('maxMultiplicity').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="descriptionTemplate.get('maxMultiplicity').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -286,7 +286,7 @@
<div class="col-12 col-xl-auto section-options-horizontal"> <div class="col-12 col-xl-auto section-options-horizontal">
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<button mat-icon-button class="action-list-icon" matTooltip="{{'DMP-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)" [disabled]="formGroup.disabled"> <button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)" [disabled]="formGroup.disabled">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
@ -299,7 +299,7 @@
<div class="row"> <div class="row">
<div *ngIf="section.get('hasTemplates').value == true" class="col-12"> <div *ngIf="section.get('hasTemplates').value == true" class="col-12">
<mat-form-field class="w-100 mt-3"> <mat-form-field class="w-100 mt-3">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.PREFILLING-SOURCES' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.PREFILLING-SOURCES' | translate}}</mat-label>
<app-multiple-auto-complete [formControl]="section.get('prefillingSourcesIds')" [configuration]="prefillingSourceService.multipleAutocompleteConfiguration"></app-multiple-auto-complete> <app-multiple-auto-complete [formControl]="section.get('prefillingSourcesIds')" [configuration]="prefillingSourceService.multipleAutocompleteConfiguration"></app-multiple-auto-complete>
<mat-error *ngIf="section.get('prefillingSourcesIds').hasError('backendError')">{{section.get('prefillingSourcesIds').getError('backendError').message}}</mat-error> <mat-error *ngIf="section.get('prefillingSourcesIds').hasError('backendError')">{{section.get('prefillingSourcesIds').getError('backendError').message}}</mat-error>
</mat-form-field> </mat-form-field>
@ -320,8 +320,8 @@
<div class="col-12"> <div class="col-12">
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<button mat-button class="action-btn" type="button" (click)="addSection()" [disabled]="formGroup.disabled">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.ADD-SECTION' | translate}}</button> <button mat-button class="action-btn" type="button" (click)="addSection()" [disabled]="formGroup.disabled">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.ADD-SECTION' | translate}}</button>
<mat-error *ngIf="formGroup.get('definition').get('sections').dirty && formGroup.get('definition').get('sections').hasError('required')">{{'DMP-BLUEPRINT-EDITOR.SECTIONS-REQUIRED' | translate}}</mat-error> <mat-error *ngIf="formGroup.get('definition').get('sections').dirty && formGroup.get('definition').get('sections').hasError('required')">{{'PLAN-BLUEPRINT-EDITOR.SECTIONS-REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('backendError')">{{formGroup.get('definition').get('sections').getError('backendError').message}}</mat-error> <mat-error *ngIf="formGroup.get('definition').get('sections').hasError('backendError')">{{formGroup.get('definition').get('sections').getError('backendError').message}}</mat-error>
</div> </div>
</div> </div>
@ -329,12 +329,12 @@
</div> </div>
<div class="row mt-4"> <div class="row mt-4">
<div class="col-auto"> <div class="col-auto">
<button mat-button class="action-btn" (click)="cancel()" type="button">{{'DMP-BLUEPRINT-EDITOR.ACTIONS.CANCEL' | translate}}</button> <button mat-button class="action-btn" (click)="cancel()" type="button">{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.CANCEL' | translate}}</button>
</div> </div>
<div class="col"></div> <div class="col"></div>
<div class="col-auto"> <div class="col-auto">
<button mat-button class="action-btn" [disabled]="!canSave || isLocked" type="submit" (click)="save(); formSubmit()"> <button mat-button class="action-btn" [disabled]="!canSave || isLocked" type="submit" (click)="save(); formSubmit()">
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.SAVE' | translate}} {{'PLAN-BLUEPRINT-EDITOR.ACTIONS.SAVE' | translate}}
</button> </button>
</div> </div>
</div> </div>

View File

@ -6,19 +6,19 @@ import { MatCheckboxChange } from '@angular/material/checkbox';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { Title } from '@angular/platform-browser'; import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { DmpBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category'; import { PlanBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
import { DmpBlueprintExtraFieldDataType } from '@app/core/common/enum/plan-blueprint-field-type'; import { PlanBlueprintExtraFieldDataType } from '@app/core/common/enum/plan-blueprint-field-type';
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type'; import { PlanBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { LockTargetType } from '@app/core/common/enum/lock-target-type'; import { LockTargetType } from '@app/core/common/enum/lock-target-type';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { DmpBlueprint, DmpBlueprintPersist, NewVersionDmpBlueprintPersist, SystemFieldInSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprint, PlanBlueprintPersist, NewVersionPlanBlueprintPersist, SystemFieldInSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
import { DmpBlueprintService } from '@app/core/services/plan/plan-blueprint.service'; import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service';
import { LockService } from '@app/core/services/lock/lock.service'; import { LockService } from '@app/core/services/lock/lock.service';
import { LoggingService } from '@app/core/services/logging/logging-service'; import { LoggingService } from '@app/core/services/logging/logging-service';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
@ -41,9 +41,9 @@ import { TranslateService } from '@ngx-translate/core';
import * as FileSaver from 'file-saver'; import * as FileSaver from 'file-saver';
import { map, takeUntil } from 'rxjs/operators'; import { map, takeUntil } from 'rxjs/operators';
import { DescriptionTemplatePreviewDialogComponent } from '../../description-template/description-template-preview/description-template-preview-dialog.component'; import { DescriptionTemplatePreviewDialogComponent } from '../../description-template/description-template-preview/description-template-preview-dialog.component';
import { DmpBlueprintEditorModel, FieldInSectionEditorModel } from './plan-blueprint-editor.model'; import { PlanBlueprintEditorModel, FieldInSectionEditorModel } from './plan-blueprint-editor.model';
import { DmpBlueprintEditorResolver } from './plan-blueprint-editor.resolver'; import { PlanBlueprintEditorResolver } from './plan-blueprint-editor.resolver';
import { DmpBlueprintEditorService } from './plan-blueprint-editor.service'; import { PlanBlueprintEditorService } from './plan-blueprint-editor.service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@ -51,9 +51,9 @@ import { RouterUtilsService } from '@app/core/services/router/router-utils.servi
selector: 'app-plan-blueprint-editor-component', selector: 'app-plan-blueprint-editor-component',
templateUrl: 'plan-blueprint-editor.component.html', templateUrl: 'plan-blueprint-editor.component.html',
styleUrls: ['./plan-blueprint-editor.component.scss'], styleUrls: ['./plan-blueprint-editor.component.scss'],
providers: [DmpBlueprintEditorService] providers: [PlanBlueprintEditorService]
}) })
export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorModel, DmpBlueprint> implements OnInit { export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditorModel, PlanBlueprint> implements OnInit {
isNew = true; isNew = true;
isClone = false; isClone = false;
@ -65,12 +65,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
hoveredSectionIndex: number = -1; hoveredSectionIndex: number = -1;
hoveredDescriptionTemplateIndex: number = -1; hoveredDescriptionTemplateIndex: number = -1;
dmpBlueprintSectionFieldCategory = DmpBlueprintFieldCategory; dmpBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
dmpBlueprintSystemFieldType = DmpBlueprintSystemFieldType; dmpBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
public dmpBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintSystemFieldType>(DmpBlueprintSystemFieldType); public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
dmpBlueprintExtraFieldDataType = DmpBlueprintExtraFieldDataType; dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
public dmpBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintExtraFieldDataType>(DmpBlueprintExtraFieldDataType); public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintExtraFieldDataType>(PlanBlueprintExtraFieldDataType);
public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<DmpBlueprintFieldCategory>(DmpBlueprintFieldCategory); public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = { descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)), initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)),
@ -83,17 +83,17 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
protected get canDelete(): boolean { protected get canDelete(): boolean {
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDmpBlueprint); return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeletePlanBlueprint);
} }
protected get canSave(): boolean { protected get canSave(): boolean {
if (this.isDeleted || !this.hasPermission(this.authService.permissionEnum.EditDmpBlueprint)) return false; if (this.isDeleted || !this.hasPermission(this.authService.permissionEnum.EditPlanBlueprint)) return false;
if (this.isNewVersion) return this.canCreateNewVersion; if (this.isNewVersion) return this.canCreateNewVersion;
return !this.formGroup.disabled; return !this.formGroup.disabled;
} }
protected get canFinalize(): boolean { protected get canFinalize(): boolean {
return !this.isNewVersion && !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDmpBlueprint); return !this.isNewVersion && !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditPlanBlueprint);
} }
protected get canCreateNewVersion(): boolean { protected get canCreateNewVersion(): boolean {
@ -101,7 +101,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
protected get isFinalized(): boolean { protected get isFinalized(): boolean {
return this.editorModel.status == DmpBlueprintStatus.Finalized; return this.editorModel.status == PlanBlueprintStatus.Finalized;
} }
private hasPermission(permission: AppPermission): boolean { private hasPermission(permission: AppPermission): boolean {
@ -124,9 +124,9 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
protected configurationService: ConfigurationService, protected configurationService: ConfigurationService,
// Rest dependencies. Inject any other needed deps here: // Rest dependencies. Inject any other needed deps here:
public enumUtils: EnumUtils, public enumUtils: EnumUtils,
private dmpBlueprintService: DmpBlueprintService, private planBlueprintService: PlanBlueprintService,
private logger: LoggingService, private logger: LoggingService,
private dmpBlueprintEditorService: DmpBlueprintEditorService, private dmpBlueprintEditorService: PlanBlueprintEditorService,
private fileUtils: FileUtils, private fileUtils: FileUtils,
public descriptionTemplateService: DescriptionTemplateService, public descriptionTemplateService: DescriptionTemplateService,
public referenceTypeService: ReferenceTypeService, public referenceTypeService: ReferenceTypeService,
@ -140,13 +140,13 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
if (descriptionLabel) { if (descriptionLabel) {
titleService.setTitle(descriptionLabel); titleService.setTitle(descriptionLabel);
} else { } else {
titleService.setTitle('DMP-BLUEPRINT-EDITOR.TITLE-EDIT-BLUEPRINT'); titleService.setTitle('PLAN-BLUEPRINT-EDITOR.TITLE-EDIT-BLUEPRINT');
} }
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService); super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
} }
ngOnInit(): void { ngOnInit(): void {
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintEditor); this.analyticsService.trackPageView(AnalyticsService.PlanBlueprintEditor);
this.initModelFlags(this.route.snapshot.data['action']); this.initModelFlags(this.route.snapshot.data['action']);
super.ngOnInit(); super.ngOnInit();
this.route.data.subscribe(d => { this.route.data.subscribe(d => {
@ -172,22 +172,22 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
} }
getItem(itemId: Guid, successFunction: (item: DmpBlueprint) => void) { getItem(itemId: Guid, successFunction: (item: PlanBlueprint) => void) {
this.dmpBlueprintService.getSingle(itemId, DmpBlueprintEditorResolver.lookupFields()) this.planBlueprintService.getSingle(itemId, PlanBlueprintEditorResolver.lookupFields())
.pipe(map(data => data as DmpBlueprint), takeUntil(this._destroyed)) .pipe(map(data => data as PlanBlueprint), takeUntil(this._destroyed))
.subscribe( .subscribe(
data => successFunction(data), data => successFunction(data),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }
prepareForm(data: DmpBlueprint) { prepareForm(data: PlanBlueprint) {
try { try {
this.editorModel = data ? new DmpBlueprintEditorModel().fromModel(data) : new DmpBlueprintEditorModel(); this.editorModel = data ? new PlanBlueprintEditorModel().fromModel(data) : new PlanBlueprintEditorModel();
this.isDeleted = data ? data.isActive === IsActive.Inactive : false; this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
this.buildForm(); this.buildForm();
if (data && data.id) this.checkLock(data.id, LockTargetType.DmpBlueprint, 'DMP-BLUEPRINT-EDITOR.LOCKED-DIALOG.TITLE', 'DMP-BLUEPRINT-EDITOR.LOCKED-DIALOG.MESSAGE'); if (data && data.id) this.checkLock(data.id, LockTargetType.PlanBlueprint, 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.MESSAGE');
} catch (error) { } catch (error) {
this.logger.error('Could not parse dmpBlueprint item: ' + data + error); this.logger.error('Could not parse dmpBlueprint item: ' + data + error);
@ -196,7 +196,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
buildForm() { buildForm() {
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditDmpBlueprint)); this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditPlanBlueprint));
this.dmpBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel); this.dmpBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
if (this.isFinalized || this.isDeleted) { if (this.isFinalized || this.isDeleted) {
this.formGroup.disable(); this.formGroup.disable();
@ -207,14 +207,14 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
refreshData(id?: Guid): void { refreshData(id?: Guid): void {
this.getItem(id ?? this.editorModel.id, (data: DmpBlueprint) => this.prepareForm(data)); this.getItem(id ?? this.editorModel.id, (data: PlanBlueprint) => this.prepareForm(data));
} }
refreshOnNavigateToData(id?: Guid): void { refreshOnNavigateToData(id?: Guid): void {
this.formGroup.markAsPristine(); this.formGroup.markAsPristine();
if (this.isNew || this.isNewVersion) { if (this.isNew || this.isNewVersion) {
let route = []; let route = [];
route.push(this.routerUtils.generateUrl('/dmp-blueprints/' + id)); route.push(this.routerUtils.generateUrl('/plan-blueprints/' + id));
this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route }); this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route });
} else { } else {
this.refreshData(id); this.refreshData(id);
@ -223,17 +223,17 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
persistEntity(onSuccess?: (response) => void): void { persistEntity(onSuccess?: (response) => void): void {
if (this.isNewVersion == false) { if (this.isNewVersion == false) {
const formData = this.formService.getValue(this.formGroup.value) as DmpBlueprintPersist; const formData = this.formService.getValue(this.formGroup.value) as PlanBlueprintPersist;
this.dmpBlueprintService.persist(formData) this.planBlueprintService.persist(formData)
.pipe(takeUntil(this._destroyed)).subscribe( .pipe(takeUntil(this._destroyed)).subscribe(
complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete), complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} else if (this.isNewVersion == true && this.isNew == false && this.isClone == false) { } else if (this.isNewVersion == true && this.isNew == false && this.isClone == false) {
const formData = this.formService.getValue(this.formGroup.value) as NewVersionDmpBlueprintPersist; const formData = this.formService.getValue(this.formGroup.value) as NewVersionPlanBlueprintPersist;
this.dmpBlueprintService.newVersion(formData) this.planBlueprintService.newVersion(formData)
.pipe(takeUntil(this._destroyed)).subscribe( .pipe(takeUntil(this._destroyed)).subscribe(
complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete), complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete),
error => this.onCallbackError(error) error => this.onCallbackError(error)
@ -265,7 +265,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) { if (result) {
this.dmpBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed)) this.planBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackDeleteSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
@ -310,7 +310,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
}); });
//Reapply validators //Reapply validators
DmpBlueprintEditorModel.reApplySectionValidators( PlanBlueprintEditorModel.reApplySectionValidators(
{ {
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
@ -328,7 +328,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
sectionsFormArray.controls.forEach((section, index) => { sectionsFormArray.controls.forEach((section, index) => {
section.get('ordinal').setValue(index + 1); section.get('ordinal').setValue(index + 1);
}); });
DmpBlueprintEditorModel.reApplySectionValidators( PlanBlueprintEditorModel.reApplySectionValidators(
{ {
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
@ -357,7 +357,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
}); });
//Reapply validators //Reapply validators
DmpBlueprintEditorModel.reApplySectionValidators( PlanBlueprintEditorModel.reApplySectionValidators(
{ {
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
@ -366,13 +366,13 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
(this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields').markAsDirty(); (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields').markAsDirty();
} }
systemFieldDisabled(systemField: DmpBlueprintSystemFieldType) { systemFieldDisabled(systemField: PlanBlueprintSystemFieldType) {
return (this.formGroup.get('definition').get('sections') as FormArray)?.controls.some(x => (x.get('fields') as FormArray).controls.some(y => (y as UntypedFormGroup).get('systemFieldType')?.value === systemField)); return (this.formGroup.get('definition').get('sections') as FormArray)?.controls.some(x => (x.get('fields') as FormArray).controls.some(y => (y as UntypedFormGroup).get('systemFieldType')?.value === systemField));
} }
fieldCategoryChanged(sectionIndex: number, fieldIndex: number) { fieldCategoryChanged(sectionIndex: number, fieldIndex: number) {
//Reapply validators //Reapply validators
DmpBlueprintEditorModel.reApplySectionValidators( PlanBlueprintEditorModel.reApplySectionValidators(
{ {
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
@ -381,7 +381,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
(this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields').markAsDirty(); (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields').markAsDirty();
} }
get alwaysRequiredSystemFieldTypes(): DmpBlueprintSystemFieldType[] { get alwaysRequiredSystemFieldTypes(): PlanBlueprintSystemFieldType[] {
return FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes; return FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes;
} }
@ -395,7 +395,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
section.get('ordinal').setValue(index + 1); section.get('ordinal').setValue(index + 1);
}); });
DmpBlueprintEditorModel.reApplySectionValidators({ PlanBlueprintEditorModel.reApplySectionValidators({
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
} }
@ -447,7 +447,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
const descriptionTempaltesArray = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray; const descriptionTempaltesArray = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray;
descriptionTempaltesArray.removeAt(descriptionTemplateIndex); descriptionTempaltesArray.removeAt(descriptionTemplateIndex);
DmpBlueprintEditorModel.reApplySectionValidators( PlanBlueprintEditorModel.reApplySectionValidators(
{ {
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
@ -462,7 +462,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
moveItemInArray(descriptionTemplatesFormArray.controls, event.previousIndex, event.currentIndex); moveItemInArray(descriptionTemplatesFormArray.controls, event.previousIndex, event.currentIndex);
descriptionTemplatesFormArray.updateValueAndValidity(); descriptionTemplatesFormArray.updateValueAndValidity();
DmpBlueprintEditorModel.reApplySectionValidators({ PlanBlueprintEditorModel.reApplySectionValidators({
formGroup: this.formGroup, formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel validationErrorModel: this.editorModel.validationErrorModel
} }
@ -517,27 +517,27 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
hasTitle(): boolean { hasTitle(): boolean {
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value; const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Title)); return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
} }
hasDescription(): boolean { hasDescription(): boolean {
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value; const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Description)); return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
} }
hasLanguage(): boolean { hasLanguage(): boolean {
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value; const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Language)); return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
} }
hasAccess(): boolean { hasAccess(): boolean {
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value; const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.AccessRights)); return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
} }
hasDescriptionTemplates(): boolean { hasDescriptionTemplates(): boolean {
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value; const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true); return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true);
} }
@ -556,12 +556,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
} }
public cancel(): void { public cancel(): void {
this.router.navigate([this.routerUtils.generateUrl('/dmp-blueprints')]); this.router.navigate([this.routerUtils.generateUrl('/plan-blueprints')]);
} }
finalize() { finalize() {
if (this.checkValidity() || !this.hasDescriptionTemplates()) { if (this.checkValidity() || !this.hasDescriptionTemplates()) {
this.formGroup.get('status').setValue(DmpBlueprintStatus.Finalized); this.formGroup.get('status').setValue(PlanBlueprintStatus.Finalized);
if (this.isNewVersion) this.isNewVersion = false; if (this.isNewVersion) this.isNewVersion = false;
this.formSubmit(); this.formSubmit();
} }
@ -570,7 +570,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
downloadXML(): void { downloadXML(): void {
const blueprintId = this.formGroup.get('id').value; const blueprintId = this.formGroup.get('id').value;
if (blueprintId == null) return; if (blueprintId == null) return;
this.dmpBlueprintService.downloadXML(blueprintId) this.planBlueprintService.downloadXML(blueprintId)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(response => { .subscribe(response => {
const blob = new Blob([response.body], { type: 'application/xml' }); const blob = new Blob([response.body], { type: 'application/xml' });

View File

@ -1,21 +1,21 @@
import { FormArray, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { FormArray, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DmpBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category"; import { PlanBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
import { DmpBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type"; import { PlanBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
import { DmpBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status"; import { PlanBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
import { DmpBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type"; import { PlanBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
import { DmpBlueprintVersionStatus } from "@app/core/common/enum/plan-blueprint-version-status"; import { PlanBlueprintVersionStatus } from "@app/core/common/enum/plan-blueprint-version-status";
import { DescriptionTemplatesInSection, DescriptionTemplatesInSectionPersist, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionPersist, DmpBlueprintDefinitionSection, DmpBlueprintDefinitionSectionPersist, DmpBlueprintPersist, ExtraFieldInSection, FieldInSection, FieldInSectionPersist, ReferenceTypeFieldInSection, SystemFieldInSection } from "@app/core/model/plan-blueprint/plan-blueprint"; import { DescriptionTemplatesInSection, DescriptionTemplatesInSectionPersist, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionPersist, PlanBlueprintDefinitionSection, PlanBlueprintDefinitionSectionPersist, PlanBlueprintPersist, ExtraFieldInSection, FieldInSection, FieldInSectionPersist, ReferenceTypeFieldInSection, SystemFieldInSection } from "@app/core/model/plan-blueprint/plan-blueprint";
import { BaseEditorModel } from "@common/base/base-form-editor-model"; import { BaseEditorModel } from "@common/base/base-form-editor-model";
import { BackendErrorValidator, DmpBlueprintSystemFieldRequiredValidator } from "@common/forms/validation/custom-validator"; import { BackendErrorValidator, PlanBlueprintSystemFieldRequiredValidator } 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 DmpBlueprintEditorModel extends BaseEditorModel implements DmpBlueprintPersist { export class PlanBlueprintEditorModel extends BaseEditorModel implements PlanBlueprintPersist {
label: string; label: string;
definition: DmpBlueprintDefinitionEditorModel = new DmpBlueprintDefinitionEditorModel(); definition: PlanBlueprintDefinitionEditorModel = new PlanBlueprintDefinitionEditorModel();
status: DmpBlueprintStatus = DmpBlueprintStatus.Draft; status: PlanBlueprintStatus = PlanBlueprintStatus.Draft;
versionStatus: DmpBlueprintVersionStatus = DmpBlueprintVersionStatus.Current; versionStatus: PlanBlueprintVersionStatus = PlanBlueprintVersionStatus.Current;
description: string; description: string;
permissions: string[]; permissions: string[];
@ -24,13 +24,13 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
constructor() { super(); } constructor() { super(); }
public fromModel(item: DmpBlueprint): DmpBlueprintEditorModel { public fromModel(item: PlanBlueprint): PlanBlueprintEditorModel {
if (item) { if (item) {
super.fromModel(item); super.fromModel(item);
this.label = item.label; this.label = item.label;
this.status = item.status; this.status = item.status;
this.versionStatus = item.versionStatus; this.versionStatus = item.versionStatus;
this.definition = new DmpBlueprintDefinitionEditorModel(this.validationErrorModel).fromModel(item.definition); this.definition = new PlanBlueprintDefinitionEditorModel(this.validationErrorModel).fromModel(item.definition);
} }
return this; return this;
} }
@ -63,7 +63,7 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
} }
createChildSection(index: number): UntypedFormGroup { createChildSection(index: number): UntypedFormGroup {
const section: DmpBlueprintDefinitionSectionEditorModel = new DmpBlueprintDefinitionSectionEditorModel(this.validationErrorModel); const section: PlanBlueprintDefinitionSectionEditorModel = new PlanBlueprintDefinitionSectionEditorModel(this.validationErrorModel);
section.id = Guid.create(); section.id = Guid.create();
section.ordinal = index + 1; section.ordinal = index + 1;
section.hasTemplates = false; section.hasTemplates = false;
@ -90,7 +90,7 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
const { formGroup, validationErrorModel } = params; const { formGroup, validationErrorModel } = params;
const control = formGroup?.get('definition'); const control = formGroup?.get('definition');
DmpBlueprintDefinitionEditorModel.reapplySectionsValidators({ PlanBlueprintDefinitionEditorModel.reapplySectionsValidators({
formArray: control.get('sections') as UntypedFormArray, formArray: control.get('sections') as UntypedFormArray,
rootPath: `definition.`, rootPath: `definition.`,
validationErrorModel: validationErrorModel validationErrorModel: validationErrorModel
@ -99,17 +99,17 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
} }
} }
export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinitionPersist { export class PlanBlueprintDefinitionEditorModel implements PlanBlueprintDefinitionPersist {
sections: DmpBlueprintDefinitionSectionEditorModel[] = []; sections: PlanBlueprintDefinitionSectionEditorModel[] = [];
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
constructor( constructor(
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DmpBlueprintDefinition): DmpBlueprintDefinitionEditorModel { public fromModel(item: PlanBlueprintDefinition): PlanBlueprintDefinitionEditorModel {
if (item) { if (item) {
if (item.sections) { item.sections.sort((a,b) => a.ordinal - b.ordinal).map(x => this.sections.push(new DmpBlueprintDefinitionSectionEditorModel(this.validationErrorModel).fromModel(x))); } if (item.sections) { item.sections.sort((a,b) => a.ordinal - b.ordinal).map(x => this.sections.push(new PlanBlueprintDefinitionSectionEditorModel(this.validationErrorModel).fromModel(x))); }
} }
return this; return this;
} }
@ -121,7 +121,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
}): UntypedFormGroup { }): UntypedFormGroup {
let { context = null, disabled = false, rootPath } = params ?? {} let { context = null, disabled = false, rootPath } = params ?? {}
if (context == null) { if (context == null) {
context = DmpBlueprintDefinitionEditorModel.createValidationContext({ context = PlanBlueprintDefinitionEditorModel.createValidationContext({
validationErrorModel: this.validationErrorModel, validationErrorModel: this.validationErrorModel,
rootPath rootPath
}); });
@ -147,7 +147,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
const baseContext: ValidationContext = new ValidationContext(); const baseContext: ValidationContext = new ValidationContext();
const baseValidationArray: Validation[] = new Array<Validation>(); const baseValidationArray: Validation[] = new Array<Validation>();
baseValidationArray.push({ key: 'sections', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}sections`), DmpBlueprintSystemFieldRequiredValidator()] }); baseValidationArray.push({ key: 'sections', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}sections`), PlanBlueprintSystemFieldRequiredValidator()] });
baseContext.validation = baseValidationArray; baseContext.validation = baseValidationArray;
return baseContext; return baseContext;
@ -160,7 +160,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
}): void { }): void {
const { validationErrorModel, rootPath, formArray } = params; const { validationErrorModel, rootPath, formArray } = params;
formArray?.controls?.forEach( formArray?.controls?.forEach(
(control, index) => DmpBlueprintDefinitionSectionEditorModel.reapplySectionValidators({ (control, index) => PlanBlueprintDefinitionSectionEditorModel.reapplySectionValidators({
formGroup: control as UntypedFormGroup, formGroup: control as UntypedFormGroup,
rootPath: `${rootPath}sections[${index}].`, rootPath: `${rootPath}sections[${index}].`,
validationErrorModel: validationErrorModel validationErrorModel: validationErrorModel
@ -170,7 +170,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
} }
export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDefinitionSectionPersist { export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintDefinitionSectionPersist {
id: Guid; id: Guid;
label: string; label: string;
description: string; description: string;
@ -186,7 +186,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DmpBlueprintDefinitionSection): DmpBlueprintDefinitionSectionEditorModel { public fromModel(item: PlanBlueprintDefinitionSection): PlanBlueprintDefinitionSectionEditorModel {
if (item) { if (item) {
this.id = item.id; this.id = item.id;
this.label = item.label; this.label = item.label;
@ -207,7 +207,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
}): UntypedFormGroup { }): UntypedFormGroup {
let { context = null, disabled = false, rootPath } = params ?? {} let { context = null, disabled = false, rootPath } = params ?? {}
if (context == null) { if (context == null) {
context = DmpBlueprintDefinitionSectionEditorModel.createValidationContext({ context = PlanBlueprintDefinitionSectionEditorModel.createValidationContext({
validationErrorModel: this.validationErrorModel, validationErrorModel: this.validationErrorModel,
rootPath rootPath
}); });
@ -267,7 +267,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
rootPath: string rootPath: string
}): void { }): void {
const { formGroup, rootPath, validationErrorModel } = params; const { formGroup, rootPath, validationErrorModel } = params;
const context = DmpBlueprintDefinitionSectionEditorModel.createValidationContext({ const context = PlanBlueprintDefinitionSectionEditorModel.createValidationContext({
rootPath, rootPath,
validationErrorModel validationErrorModel
}); });
@ -302,20 +302,20 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
export class FieldInSectionEditorModel implements FieldInSectionPersist { export class FieldInSectionEditorModel implements FieldInSectionPersist {
public id: Guid; public id: Guid;
public category: DmpBlueprintFieldCategory; public category: PlanBlueprintFieldCategory;
public label: string; public label: string;
public placeholder: string; public placeholder: string;
public description: string; public description: string;
public semantics: string[]; public semantics: string[];
public required: boolean = false; public required: boolean = false;
public ordinal: number; public ordinal: number;
public dataType: DmpBlueprintExtraFieldDataType; public dataType: PlanBlueprintExtraFieldDataType;
public systemFieldType: DmpBlueprintSystemFieldType; public systemFieldType: PlanBlueprintSystemFieldType;
public referenceTypeId: Guid; public referenceTypeId: Guid;
public multipleSelect: boolean; public multipleSelect: boolean;
static get alwaysRequiredSystemFieldTypes(): DmpBlueprintSystemFieldType[] { static get alwaysRequiredSystemFieldTypes(): PlanBlueprintSystemFieldType[] {
return [DmpBlueprintSystemFieldType.Title, DmpBlueprintSystemFieldType.Description, DmpBlueprintSystemFieldType.Language, DmpBlueprintSystemFieldType.AccessRights]; return [PlanBlueprintSystemFieldType.Title, PlanBlueprintSystemFieldType.Description, PlanBlueprintSystemFieldType.Language, PlanBlueprintSystemFieldType.AccessRights];
} }
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
@ -334,14 +334,14 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
this.required = item.required; this.required = item.required;
this.ordinal = item.ordinal; this.ordinal = item.ordinal;
if (this.category == DmpBlueprintFieldCategory.System) { if (this.category == PlanBlueprintFieldCategory.System) {
this.systemFieldType = (item as SystemFieldInSection).systemFieldType; this.systemFieldType = (item as SystemFieldInSection).systemFieldType;
if (FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes.includes(this.systemFieldType)) { if (FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes.includes(this.systemFieldType)) {
this.required = true; this.required = true;
} }
} else if (this.category == DmpBlueprintFieldCategory.Extra) { } else if (this.category == PlanBlueprintFieldCategory.Extra) {
this.dataType = (item as ExtraFieldInSection).dataType; this.dataType = (item as ExtraFieldInSection).dataType;
} else if (this.category == DmpBlueprintFieldCategory.ReferenceType) { } else if (this.category == PlanBlueprintFieldCategory.ReferenceType) {
this.referenceTypeId = (item as ReferenceTypeFieldInSection).referenceType?.id; this.referenceTypeId = (item as ReferenceTypeFieldInSection).referenceType?.id;
this.multipleSelect= (item as ReferenceTypeFieldInSection).multipleSelect; this.multipleSelect= (item as ReferenceTypeFieldInSection).multipleSelect;
} }
@ -366,7 +366,7 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators],
category: [{ value: this.category, disabled: disabled }, context.getValidation('category').validators], category: [{ value: this.category, disabled: disabled }, context.getValidation('category').validators],
label: [{ value: this.label, disabled: disabled }, this.category === DmpBlueprintFieldCategory.System ? context.getValidation('label-system').validators : ( this.category === DmpBlueprintFieldCategory.Extra ? context.getValidation('label-extra').validators : context.getValidation('label-external-reference').validators)], label: [{ value: this.label, disabled: disabled }, this.category === PlanBlueprintFieldCategory.System ? context.getValidation('label-system').validators : ( this.category === PlanBlueprintFieldCategory.Extra ? context.getValidation('label-extra').validators : context.getValidation('label-external-reference').validators)],
placeholder: [{ value: this.placeholder, disabled: disabled }, context.getValidation('placeholder').validators], placeholder: [{ value: this.placeholder, disabled: disabled }, context.getValidation('placeholder').validators],
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators], description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
required: [{ value: this.required, disabled: disabled }, context.getValidation('required').validators], required: [{ value: this.required, disabled: disabled }, context.getValidation('required').validators],
@ -425,16 +425,16 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
if (keyField == 'label') { if (keyField == 'label') {
control?.addValidators(context.has('label-system') ? context.getValidation('label-system').validators : (context.has('label-extra') ? context.getValidation('label-extra').validators : context.getValidation('label-external-reference').validators)); control?.addValidators(context.has('label-system') ? context.getValidation('label-system').validators : (context.has('label-extra') ? context.getValidation('label-extra').validators : context.getValidation('label-external-reference').validators));
} else if (keyField == 'referenceTypeId') { } else if (keyField == 'referenceTypeId') {
if (formGroup.get('category').value === DmpBlueprintFieldCategory.ReferenceType) control?.addValidators([Validators.required, ...context.getValidation('referenceTypeId').validators]); if (formGroup.get('category').value === PlanBlueprintFieldCategory.ReferenceType) control?.addValidators([Validators.required, ...context.getValidation('referenceTypeId').validators]);
else control?.addValidators([...context.getValidation('referenceTypeId').validators]); else control?.addValidators([...context.getValidation('referenceTypeId').validators]);
} else if (keyField == 'multipleSelect') { } else if (keyField == 'multipleSelect') {
if (formGroup.get('category').value === DmpBlueprintFieldCategory.ReferenceType) control?.addValidators([Validators.required, ...context.getValidation('multipleSelect').validators]); if (formGroup.get('category').value === PlanBlueprintFieldCategory.ReferenceType) control?.addValidators([Validators.required, ...context.getValidation('multipleSelect').validators]);
else control?.addValidators([...context.getValidation('multipleSelect').validators]); else control?.addValidators([...context.getValidation('multipleSelect').validators]);
}else if (keyField == 'systemFieldType') { }else if (keyField == 'systemFieldType') {
if (formGroup.get('category').value === DmpBlueprintFieldCategory.System) control?.addValidators([Validators.required, ...context.getValidation('systemFieldType').validators]); if (formGroup.get('category').value === PlanBlueprintFieldCategory.System) control?.addValidators([Validators.required, ...context.getValidation('systemFieldType').validators]);
else control?.addValidators([...context.getValidation('systemFieldType').validators]); else control?.addValidators([...context.getValidation('systemFieldType').validators]);
} else if (keyField == 'dataType') { } else if (keyField == 'dataType') {
if (formGroup.get('category').value === DmpBlueprintFieldCategory.Extra) control?.addValidators([Validators.required, ...context.getValidation('dataType').validators]); if (formGroup.get('category').value === PlanBlueprintFieldCategory.Extra) control?.addValidators([Validators.required, ...context.getValidation('dataType').validators]);
else control?.addValidators([...context.getValidation('dataType').validators]); else control?.addValidators([...context.getValidation('dataType').validators]);
} else { } else {
control?.addValidators(context.getValidation(keyField).validators); control?.addValidators(context.getValidation(keyField).validators);

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection, ExtraFieldInSection, FieldInSection, ReferenceTypeFieldInSection, SystemFieldInSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection, ExtraFieldInSection, FieldInSection, ReferenceTypeFieldInSection, SystemFieldInSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source'; import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { DmpBlueprintService } from '@app/core/services/plan/plan-blueprint.service'; import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { BaseEditorResolver } from '@common/base/base-editor.resolver'; import { BaseEditorResolver } from '@common/base/base-editor.resolver';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
@ -11,68 +11,68 @@ import { takeUntil, tap } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
@Injectable() @Injectable()
export class DmpBlueprintEditorResolver extends BaseEditorResolver { export class PlanBlueprintEditorResolver extends BaseEditorResolver {
constructor(private dmpBlueprintService: DmpBlueprintService, private breadcrumbService: BreadcrumbService) { constructor(private planBlueprintService: PlanBlueprintService, private breadcrumbService: BreadcrumbService) {
super(); super();
} }
public static lookupFields(): string[] { public static lookupFields(): string[] {
return [ return [
...BaseEditorResolver.lookupFields(), ...BaseEditorResolver.lookupFields(),
nameof<DmpBlueprint>(x => x.id), nameof<PlanBlueprint>(x => x.id),
nameof<DmpBlueprint>(x => x.label), nameof<PlanBlueprint>(x => x.label),
nameof<DmpBlueprint>(x => x.status), nameof<PlanBlueprint>(x => x.status),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.description)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.description)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.ordinal)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.id)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.id)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.category)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.category)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.label)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.label)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.placeholder)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.placeholder)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.description)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.description)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.required)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.required)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.semantics)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.semantics)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.ordinal)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<FieldInSection>(x => x.ordinal)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<SystemFieldInSection>(x => x.systemFieldType)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<SystemFieldInSection>(x => x.systemFieldType)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<ExtraFieldInSection>(x => x.dataType)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<ExtraFieldInSection>(x => x.dataType)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.id)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.id)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.name)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.name)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.code)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.referenceType), nameof<ReferenceType>(x => x.code)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.multipleSelect)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.fields), nameof<ReferenceTypeFieldInSection>(x => x.multipleSelect)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.label)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.label)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.minMultiplicity)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.minMultiplicity)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.maxMultiplicity)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.maxMultiplicity)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.id)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.id)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.label)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.label)].join('.'),
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.code)].join('.'), [nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.code)].join('.'),
nameof<DmpBlueprint>(x => x.createdAt), nameof<PlanBlueprint>(x => x.createdAt),
nameof<DmpBlueprint>(x => x.hash), nameof<PlanBlueprint>(x => x.hash),
nameof<DmpBlueprint>(x => x.isActive) nameof<PlanBlueprint>(x => x.isActive)
] ]
} }
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const fields = [ const fields = [
...DmpBlueprintEditorResolver.lookupFields() ...PlanBlueprintEditorResolver.lookupFields()
]; ];
const id = route.paramMap.get('id'); const id = route.paramMap.get('id');
const cloneid = route.paramMap.get('cloneid'); const cloneid = route.paramMap.get('cloneid');
const newversion = route.paramMap.get("newversionid"); const newversion = route.paramMap.get("newversionid");
if (id != null) { if (id != null) {
return this.dmpBlueprintService.getSingle(Guid.parse(id), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed)); return this.planBlueprintService.getSingle(Guid.parse(id), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed));
} else if (cloneid != null) { } else if (cloneid != null) {
return this.dmpBlueprintService.clone(Guid.parse(cloneid), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(cloneid, x.label)), takeUntil(this._destroyed)); return this.planBlueprintService.clone(Guid.parse(cloneid), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(cloneid, x.label)), takeUntil(this._destroyed));
} else if (newversion != null) { } else if (newversion != null) {
return this.dmpBlueprintService.getSingle(Guid.parse(newversion), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(newversion, x.label)), takeUntil(this._destroyed)); return this.planBlueprintService.getSingle(Guid.parse(newversion), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(newversion, x.label)), takeUntil(this._destroyed));
} }
} }
} }

View File

@ -2,7 +2,7 @@ import { Injectable } from "@angular/core";
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
@Injectable() @Injectable()
export class DmpBlueprintEditorService { export class PlanBlueprintEditorService {
private validationErrorModel: ValidationErrorModel; private validationErrorModel: ValidationErrorModel;
public setValidationErrorModel(validationErrorModel: ValidationErrorModel): void { public setValidationErrorModel(validationErrorModel: ValidationErrorModel): void {

View File

@ -10,7 +10,7 @@
<div class="container-fluid" (click)="$event?.stopPropagation?.()"> <div class="container-fluid" (click)="$event?.stopPropagation?.()">
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto mt-2"> <div class="col-auto mt-2">
<h4>{{'DMP-BLUEPRINT-LISTING.FILTER.TITLE' | translate}}</h4> <h4>{{'PLAN-BLUEPRINT-LISTING.FILTER.TITLE' | translate}}</h4>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button color="accent" mat-button (click)="clearFilters()"> <button color="accent" mat-button (click)="clearFilters()">
@ -23,7 +23,7 @@
<div class="col-12"> <div class="col-12">
<section class="w-100"> <section class="w-100">
<mat-slide-toggle [(ngModel)]="internalFilters.isActive" labelPosition="before"> <mat-slide-toggle [(ngModel)]="internalFilters.isActive" labelPosition="before">
{{'DMP-BLUEPRINT-LISTING.FILTER.IS-ACTIVE' | translate}}</mat-slide-toggle> {{'PLAN-BLUEPRINT-LISTING.FILTER.IS-ACTIVE' | translate}}</mat-slide-toggle>
</section> </section>
</div> </div>
</div> </div>
@ -31,9 +31,9 @@
<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">
<mat-label>{{'DMP-BLUEPRINT-LISTING.FILTER.STATUS' | translate}}</mat-label> <mat-label>{{'PLAN-BLUEPRINT-LISTING.FILTER.STATUS' | translate}}</mat-label>
<mat-select multiple [(ngModel)]="internalFilters.statuses"> <mat-select multiple [(ngModel)]="internalFilters.statuses">
<mat-option *ngFor="let blueprintStatus of dmpBlueprintStatusEnumValues" [value]="blueprintStatus">{{enumUtils.toDmpBlueprintStatusString(blueprintStatus)}}</mat-option> <mat-option *ngFor="let blueprintStatus of planBlueprintStatusEnumValues" [value]="blueprintStatus">{{enumUtils.toPlanBlueprintStatusString(blueprintStatus)}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -42,12 +42,12 @@
<div class="row justify-content-end align-items-center mt-4 mb-1 gap-1-rem"> <div class="row justify-content-end align-items-center mt-4 mb-1 gap-1-rem">
<div class="col-auto"> <div class="col-auto">
<button class="normal-btn-light-sm" (click)="filterMenuTrigger?.closeMenu()"> <button class="normal-btn-light-sm" (click)="filterMenuTrigger?.closeMenu()">
{{'DMP-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}} {{'PLAN-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}}
</button> </button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button class="normal-btn-sm" (click)="filterMenuTrigger.closeMenu(); applyFilters();"> <button class="normal-btn-sm" (click)="filterMenuTrigger.closeMenu(); applyFilters();">
{{'DMP-BLUEPRINT-LISTING.FILTER.APPLY-FILTERS' | translate}} {{'PLAN-BLUEPRINT-LISTING.FILTER.APPLY-FILTERS' | translate}}
</button> </button>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpBlueprintFilter } from '@app/core/query/plan-blueprint.lookup'; import { PlanBlueprintFilter } from '@app/core/query/plan-blueprint.lookup';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
@ -12,15 +12,15 @@ import { nameof } from 'ts-simple-nameof';
templateUrl: './plan-blueprint-listing-filters.component.html', templateUrl: './plan-blueprint-listing-filters.component.html',
styleUrls: ['./plan-blueprint-listing-filters.component.scss'] styleUrls: ['./plan-blueprint-listing-filters.component.scss']
}) })
export class DmpBlueprintListingFiltersComponent extends BaseComponent implements OnInit, OnChanges { export class PlanBlueprintListingFiltersComponent extends BaseComponent implements OnInit, OnChanges {
@Input() readonly filter: DmpBlueprintFilter; @Input() readonly filter: PlanBlueprintFilter;
@Output() filterChange = new EventEmitter<DmpBlueprintFilter>(); @Output() filterChange = new EventEmitter<PlanBlueprintFilter>();
dmpBlueprintStatusEnumValues = this.enumUtils.getEnumValues<DmpBlueprintStatus>(DmpBlueprintStatus); planBlueprintStatusEnumValues = this.enumUtils.getEnumValues<PlanBlueprintStatus>(PlanBlueprintStatus);
// * State // * State
internalFilters: DmpBlueprintListingFilters = this._getEmptyFilters(); internalFilters: PlanBlueprintListingFilters = this._getEmptyFilters();
protected appliedFilterCount: number = 0; protected appliedFilterCount: number = 0;
constructor( constructor(
@ -31,7 +31,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
const filterChange = changes[nameof<DmpBlueprintListingFiltersComponent>(x => x.filter)]?.currentValue as DmpBlueprintFilter; const filterChange = changes[nameof<PlanBlueprintListingFiltersComponent>(x => x.filter)]?.currentValue as PlanBlueprintFilter;
if (filterChange) { if (filterChange) {
this.updateFilters() this.updateFilters()
} }
@ -59,7 +59,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
private _parseToInternalFilters(inputFilter: DmpBlueprintFilter): DmpBlueprintListingFilters { private _parseToInternalFilters(inputFilter: PlanBlueprintFilter): PlanBlueprintListingFilters {
if (!inputFilter) { if (!inputFilter) {
return this._getEmptyFilters(); return this._getEmptyFilters();
} }
@ -74,7 +74,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
private _getEmptyFilters(): DmpBlueprintListingFilters { private _getEmptyFilters(): PlanBlueprintListingFilters {
return { return {
isActive: true, isActive: true,
like: null, like: null,
@ -82,7 +82,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
} }
private _computeAppliedFilters(filters: DmpBlueprintListingFilters): number { private _computeAppliedFilters(filters: PlanBlueprintListingFilters): number {
let count = 0; let count = 0;
if (filters?.isActive) { if (filters?.isActive) {
count++ count++
@ -95,8 +95,8 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
} }
interface DmpBlueprintListingFilters { interface PlanBlueprintListingFilters {
isActive: boolean; isActive: boolean;
like: string; like: string;
statuses: DmpBlueprintStatus[]; statuses: PlanBlueprintStatus[];
} }

View File

@ -21,15 +21,15 @@
<div class="col-12 d-flex justify-content-center attach-btn"> <div class="col-12 d-flex justify-content-center attach-btn">
<button mat-button type="button" class="col-auto attach-file" (click)="imgFileInput.click()"> <button mat-button type="button" class="col-auto attach-file" (click)="imgFileInput.click()">
<mat-icon class="mr-2">input</mat-icon> <mat-icon class="mr-2">input</mat-icon>
<span *ngIf="!hasBlueprint()">{{'GENERAL.START-NEW-DMP-DIALOG.UPLOAD-FILE' | translate}}</span> <span *ngIf="!hasBlueprint()">{{'GENERAL.START-NEW-PLAN-DIALOG.UPLOAD-FILE' | translate}}</span>
<span *ngIf="hasBlueprint()">{{'GENERAL.START-NEW-DMP-DIALOG.REPLACE-FILE' | translate}}</span> <span *ngIf="hasBlueprint()">{{'GENERAL.START-NEW-PLAN-DIALOG.REPLACE-FILE' | translate}}</span>
</button> </button>
<input class="hidden" type="file" #imgFileInput (change)="selectXML($event)" accept="text/xml" /> <input class="hidden" type="file" #imgFileInput (change)="selectXML($event)" accept="text/xml" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput placeholder="{{'DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-NAME'| translate}}" name="descriptionBlueprintName" [(ngModel)]="data.name"> <input matInput placeholder="{{'PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-NAME'| translate}}" name="descriptionBlueprintName" [(ngModel)]="data.name">
</mat-form-field> </mat-form-field>
<div class="col-auto"> <div class="col-auto">
<button mat-button type="button" class="cancel-btn" (click)="cancel()">{{ data.cancelButton }}</button> <button mat-button type="button" class="cancel-btn" (click)="cancel()">{{ data.cancelButton }}</button>

View File

@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
templateUrl: './import-plan-blueprint.dialog.component.html', templateUrl: './import-plan-blueprint.dialog.component.html',
styleUrls: ['./import-plan-blueprint.dialog.component.scss'] styleUrls: ['./import-plan-blueprint.dialog.component.scss']
}) })
export class ImportDmpBlueprintDialogComponent { export class ImportPlanBlueprintDialogComponent {
sizeError = false; sizeError = false;
selectFile = false; selectFile = false;
@ -14,7 +14,7 @@ export class ImportDmpBlueprintDialogComponent {
selectedFileName: string; selectedFileName: string;
constructor( constructor(
public dialogRef: MatDialogRef<ImportDmpBlueprintDialogComponent>, public dialogRef: MatDialogRef<ImportPlanBlueprintDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any @Inject(MAT_DIALOG_DATA) public data: any
) { } ) { }

View File

@ -8,20 +8,20 @@
<div class="col-auto"> <div class="col-auto">
<button mat-raised-button class="import-btn" (click)="import()"> <button mat-raised-button class="import-btn" (click)="import()">
<span class="button-text"> <span class="button-text">
{{'DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML' | translate}} {{'PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML' | translate}}
</span> </span>
</button> </button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new'])"> <button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="routerUtils.generateUrl(['/plan-blueprints/new'])">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
{{'DMP-BLUEPRINT-LISTING.CREATE-DMP-BLUEPRINT' | translate}} {{'PLAN-BLUEPRINT-LISTING.CREATE-PLAN-BLUEPRINT' | translate}}
</button> </button>
</div> </div>
</div> </div>
<app-hybrid-listing [rows]="gridRows" [columns]="gridColumns" [visibleColumns]="visibleColumns" [count]="totalElements" [offset]="currentPageNumber" [limit]="lookup.page.size" [defaultSort]="lookup.order?.items" [externalSorting]="true" (rowActivated)="onRowActivated($event, routerUtils.generateUrl('/dmp-blueprints'))" (pageLoad)="alterPage($event)" (columnSort)="onColumnSort($event)" (columnsChanged)="onColumnsChanged($event)" [listItemTemplate]="listItemTemplate"> <app-hybrid-listing [rows]="gridRows" [columns]="gridColumns" [visibleColumns]="visibleColumns" [count]="totalElements" [offset]="currentPageNumber" [limit]="lookup.page.size" [defaultSort]="lookup.order?.items" [externalSorting]="true" (rowActivated)="onRowActivated($event, routerUtils.generateUrl('/plan-blueprints'))" (pageLoad)="alterPage($event)" (columnSort)="onColumnSort($event)" (columnsChanged)="onColumnsChanged($event)" [listItemTemplate]="listItemTemplate">
<app-plan-blueprint-listing-filters hybrid-listing-filters [(filter)]="lookup" (filterChange)="filterChanged($event)" /> <app-plan-blueprint-listing-filters hybrid-listing-filters [(filter)]="lookup" (filterChange)="filterChanged($event)" />
@ -46,15 +46,15 @@
<ng-container *ngIf="isColumnSelected('status')"> <ng-container *ngIf="isColumnSelected('status')">
<div class="col-auto"> <div class="col-auto">
<div class="status-chip" [ngClass]="{'status-chip-finalized': item.status === dmpBlueprintStatuses.Finalized, 'status-chip-draft' : item.status === dmpBlueprintStatuses.Draft}"> <div class="status-chip" [ngClass]="{'status-chip-finalized': item.status === planBlueprintStatuses.Finalized, 'status-chip-draft' : item.status === planBlueprintStatuses.Draft}">
{{enumUtils.toDmpBlueprintStatusString(item.status) | nullifyValue}} {{enumUtils.toPlanBlueprintStatusString(item.status) | nullifyValue}}
</div> </div>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="isColumnSelected('createdAt')"> <ng-container *ngIf="isColumnSelected('createdAt')">
<span class="col-12"> <span class="col-12">
{{'DMP-BLUEPRINT-LISTING.FIELDS.CREATED-AT' | translate}}: {{'PLAN-BLUEPRINT-LISTING.FIELDS.CREATED-AT' | translate}}:
<small> <small>
{{item?.createdAt | dateTimeFormatter : 'short' | nullifyValue}} {{item?.createdAt | dateTimeFormatter : 'short' | nullifyValue}}
</small> </small>
@ -63,7 +63,7 @@
</ng-container> </ng-container>
<ng-container *ngIf="isColumnSelected('updatedAt')"> <ng-container *ngIf="isColumnSelected('updatedAt')">
<span class="col-12"> <span class="col-12">
{{'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT' | translate}}: {{'PLAN-BLUEPRINT-LISTING.FIELDS.UPDATED-AT' | translate}}:
<small> <small>
{{item?.updatedAt | dateTimeFormatter : 'short' | nullifyValue}} {{item?.updatedAt | dateTimeFormatter : 'short' | nullifyValue}}
</small> </small>
@ -73,10 +73,10 @@
</div> </div>
</ng-template> </ng-template>
<ng-template #dmpBlueprintStatus let-row="row" let-item> <ng-template #planBlueprintStatus let-row="row" let-item>
<div class="row"> <div class="row">
<div class="col-auto status-chip" [ngClass]="{'status-chip-finalized': row.status === dmpBlueprintStatuses.Finalized, 'status-chip-draft' : row.status === dmpBlueprintStatuses.Draft}"> <div class="col-auto status-chip" [ngClass]="{'status-chip-finalized': row.status === planBlueprintStatuses.Finalized, 'status-chip-draft' : row.status === planBlueprintStatuses.Draft}">
{{enumUtils.toDmpBlueprintStatusString(row.status) | nullifyValue}} {{enumUtils.toPlanBlueprintStatusString(row.status) | nullifyValue}}
</div> </div>
</div> </div>
</ng-template> </ng-template>
@ -88,25 +88,25 @@
<mat-icon>more_horiz</mat-icon> <mat-icon>more_horiz</mat-icon>
</button> </button>
<mat-menu #actionsMenu="matMenu"> <mat-menu #actionsMenu="matMenu">
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/', row.id])"> <button *ngIf="(row.status != null && row.status === planBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/', row.id])">
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}} <mat-icon>edit</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
</button> </button>
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === dmpBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new-version/', row.id])"> <button *ngIf="row.belongsToCurrentTenant != false && (row.status === planBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/new-version/', row.id])">
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}} <mat-icon>queue</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
</button> </button>
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/clone/', row.id])"> <button mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/clone/', row.id])">
<mat-icon>content_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}} <mat-icon>content_copy</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
</button> </button>
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/versions/', row.groupId])"> <button mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/versions/', row.groupId])">
<mat-icon>library_books</mat-icon> <mat-icon>library_books</mat-icon>
{{'DMP-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}} {{'PLAN-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
</button> </button>
<button mat-menu-item (click)="export($event, row.id)"> <button mat-menu-item (click)="export($event, row.id)">
<mat-icon>download</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.DOWNLOAD-XML' | translate}} <mat-icon>download</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
</button> </button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)"> <button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
{{'DMP-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}} {{'PLAN-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
</button> </button>
</mat-menu> </mat-menu>
</div> </div>

View File

@ -2,13 +2,13 @@
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status'; import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status'; import { PlanBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
import { DmpBlueprintLookup } from '@app/core/query/plan-blueprint.lookup'; import { PlanBlueprintLookup } from '@app/core/query/plan-blueprint.lookup';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpBlueprintService } from '@app/core/services/plan/plan-blueprint.service'; import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
@ -28,7 +28,7 @@ import * as FileSaver from 'file-saver';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { ImportDmpBlueprintDialogComponent } from './import-plan-blueprint/import-plan-blueprint.dialog.component'; import { ImportPlanBlueprintDialogComponent } from './import-plan-blueprint/import-plan-blueprint.dialog.component';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@ -37,28 +37,28 @@ import { RouterUtilsService } from '@app/core/services/router/router-utils.servi
templateUrl: './plan-blueprint-listing.component.html', templateUrl: './plan-blueprint-listing.component.html',
styleUrls: ['./plan-blueprint-listing.component.scss'] styleUrls: ['./plan-blueprint-listing.component.scss']
}) })
export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBlueprint, DmpBlueprintLookup> implements OnInit { export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlueprint, PlanBlueprintLookup> implements OnInit {
publish = false; publish = false;
userSettingsKey = { key: 'DmpBlueprintListingUserSettings' }; userSettingsKey = { key: 'PlanBlueprintListingUserSettings' };
propertiesAvailableForOrder: ColumnDefinition[]; propertiesAvailableForOrder: ColumnDefinition[];
dmpBlueprintStatuses = DmpBlueprintStatus; planBlueprintStatuses = PlanBlueprintStatus;
mode; mode;
@ViewChild('dmpBlueprintStatus', { static: true }) dmpBlueprintStatus?: TemplateRef<any>; @ViewChild('planBlueprintStatus', { static: true }) planBlueprintStatus?: TemplateRef<any>;
@ViewChild('actions', { static: true }) actions?: TemplateRef<any>; @ViewChild('actions', { static: true }) actions?: TemplateRef<any>;
@ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent; @ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent;
private readonly lookupFields: string[] = [ private readonly lookupFields: string[] = [
nameof<DmpBlueprint>(x => x.id), nameof<PlanBlueprint>(x => x.id),
nameof<DmpBlueprint>(x => x.label), nameof<PlanBlueprint>(x => x.label),
nameof<DmpBlueprint>(x => x.status), nameof<PlanBlueprint>(x => x.status),
nameof<DmpBlueprint>(x => x.version), nameof<PlanBlueprint>(x => x.version),
nameof<DmpBlueprint>(x => x.groupId), nameof<PlanBlueprint>(x => x.groupId),
nameof<DmpBlueprint>(x => x.updatedAt), nameof<PlanBlueprint>(x => x.updatedAt),
nameof<DmpBlueprint>(x => x.createdAt), nameof<PlanBlueprint>(x => x.createdAt),
nameof<DmpBlueprint>(x => x.hash), nameof<PlanBlueprint>(x => x.hash),
nameof<DmpBlueprint>(x => x.isActive), nameof<PlanBlueprint>(x => x.isActive),
nameof<DmpBlueprint>(x => x.belongsToCurrentTenant) nameof<PlanBlueprint>(x => x.belongsToCurrentTenant)
]; ];
rowIdentity = x => x.id; rowIdentity = x => x.id;
@ -70,7 +70,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
protected uiNotificationService: UiNotificationService, protected uiNotificationService: UiNotificationService,
protected httpErrorHandlingService: HttpErrorHandlingService, protected httpErrorHandlingService: HttpErrorHandlingService,
protected queryParamsService: QueryParamsService, protected queryParamsService: QueryParamsService,
private dmpBlueprintService: DmpBlueprintService, private planBlueprintService: PlanBlueprintService,
public authService: AuthService, public authService: AuthService,
private pipeService: PipeService, private pipeService: PipeService,
public enumUtils: EnumUtils, public enumUtils: EnumUtils,
@ -87,21 +87,21 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
} }
ngOnInit() { ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintListing); this.analyticsService.trackPageView(AnalyticsService.PlanBlueprintListing);
super.ngOnInit(); super.ngOnInit();
} }
protected initializeLookup(): DmpBlueprintLookup { protected initializeLookup(): PlanBlueprintLookup {
const lookup = new DmpBlueprintLookup(); const lookup = new PlanBlueprintLookup();
lookup.metadata = { countAll: true }; lookup.metadata = { countAll: true };
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE }; lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
lookup.isActive = [IsActive.Active]; lookup.isActive = [IsActive.Active];
lookup.order = { items: [this.toDescSortField(nameof<DmpBlueprint>(x => x.createdAt))] }; lookup.order = { items: [this.toDescSortField(nameof<PlanBlueprint>(x => x.createdAt))] };
if (this.mode && this.mode == 'versions-listing') { if (this.mode && this.mode == 'versions-listing') {
lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))]; lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))];
lookup.versionStatuses = null; lookup.versionStatuses = null;
} else { } else {
lookup.versionStatuses = [DmpBlueprintVersionStatus.Current, DmpBlueprintVersionStatus.NotFinalized]; lookup.versionStatuses = [PlanBlueprintVersionStatus.Current, PlanBlueprintVersionStatus.NotFinalized];
} }
this.updateOrderUiFields(lookup.order); this.updateOrderUiFields(lookup.order);
@ -114,37 +114,37 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
protected setupColumns() { protected setupColumns() {
this.gridColumns.push(...[{ this.gridColumns.push(...[{
prop: nameof<DmpBlueprint>(x => x.label), prop: nameof<PlanBlueprint>(x => x.label),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.NAME' languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.NAME'
}, },
{ {
prop: nameof<DmpBlueprint>(x => x.status), prop: nameof<PlanBlueprint>(x => x.status),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.STATUS', languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.STATUS',
cellTemplate: this.dmpBlueprintStatus cellTemplate: this.planBlueprintStatus
}, },
{ {
prop: nameof<DmpBlueprint>(x => x.version), prop: nameof<PlanBlueprint>(x => x.version),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.VERSION' languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.VERSION'
}, },
{ {
prop: nameof<DmpBlueprint>(x => x.createdAt), prop: nameof<PlanBlueprint>(x => x.createdAt),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.CREATED-AT', languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.CREATED-AT',
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short') pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
}, },
{ {
prop: nameof<DmpBlueprint>(x => x.updatedAt), prop: nameof<PlanBlueprint>(x => x.updatedAt),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT', languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.UPDATED-AT',
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short') pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
}, },
{ {
prop: nameof<DmpBlueprint>(x => x.isActive), prop: nameof<PlanBlueprint>(x => x.isActive),
sortable: true, sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.IS-ACTIVE', languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.IS-ACTIVE',
pipe: this.pipeService.getPipe<IsActiveTypePipe>(IsActiveTypePipe) pipe: this.pipeService.getPipe<IsActiveTypePipe>(IsActiveTypePipe)
}, },
{ {
@ -176,8 +176,8 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
this.onPageLoad({ offset: 0 } as PageLoadEvent); this.onPageLoad({ offset: 0 } as PageLoadEvent);
} }
protected loadListing(): Observable<QueryResult<DmpBlueprint>> { protected loadListing(): Observable<QueryResult<PlanBlueprint>> {
return this.dmpBlueprintService.query(this.lookup); return this.planBlueprintService.query(this.lookup);
} }
public delete(id: Guid) { public delete(id: Guid) {
@ -192,7 +192,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) { if (result) {
this.dmpBlueprintService.delete(id).pipe(takeUntil(this._destroyed)) this.planBlueprintService.delete(id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
@ -209,7 +209,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
export(event: PointerEvent, id: Guid): void { export(event: PointerEvent, id: Guid): void {
event?.stopPropagation(); event?.stopPropagation();
this.dmpBlueprintService.downloadXML(id) this.planBlueprintService.downloadXML(id)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(response => { .subscribe(response => {
const blob = new Blob([response.body], { type: 'application/xml' }); const blob = new Blob([response.body], { type: 'application/xml' });
@ -220,12 +220,12 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
} }
import(): void { import(): void {
const dialogRef = this.dialog.open(ImportDmpBlueprintDialogComponent, { const dialogRef = this.dialog.open(ImportPlanBlueprintDialogComponent, {
restoreFocus: false, restoreFocus: false,
data: { data: {
message: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'), message: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'),
confirmButton: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'), confirmButton: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'),
cancelButton: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'), cancelButton: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'),
name: '', name: '',
file: FileList, file: FileList,
sucsess: false sucsess: false
@ -233,10 +233,10 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
if (data && data.sucsess && data.name != null && data.file != null) { if (data && data.sucsess && data.name != null && data.file != null) {
this.dmpBlueprintService.uploadFile(data.file, data.name) this.planBlueprintService.uploadFile(data.file, data.name)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(_ => { .subscribe(_ => {
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-BLUEPRINT-LISTING.MESSAGES.BLUEPRINT-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('PLAN-BLUEPRINT-LISTING.MESSAGES.BLUEPRINT-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
this.refresh(); this.refresh();
}, },
error => { error => {

View File

@ -9,11 +9,11 @@ import { TextFilterModule } from "@common/modules/text-filter/text-filter.module
import { UserSettingsModule } from "@common/modules/user-settings/user-settings.module"; import { UserSettingsModule } from "@common/modules/user-settings/user-settings.module";
import { CommonUiModule } from '@common/ui/common-ui.module'; import { CommonUiModule } from '@common/ui/common-ui.module';
import { NgxDropzoneModule } from "ngx-dropzone"; import { NgxDropzoneModule } from "ngx-dropzone";
import { DmpBlueprintRoutingModule } from './plan-blueprint.routing'; import { PlanBlueprintRoutingModule } from './plan-blueprint.routing';
import { DmpBlueprintEditorComponent } from './editor/plan-blueprint-editor.component'; import { PlanBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
import { DmpBlueprintListingComponent } from './listing/plan-blueprint-listing.component'; import { PlanBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
import { DmpBlueprintListingFiltersComponent } from "./listing/filters/plan-blueprint-listing-filters.component"; import { PlanBlueprintListingFiltersComponent } from "./listing/filters/plan-blueprint-listing-filters.component";
import { ImportDmpBlueprintDialogComponent } from './listing/import-plan-blueprint/import-plan-blueprint.dialog.component'; import { ImportPlanBlueprintDialogComponent } from './listing/import-plan-blueprint/import-plan-blueprint.dialog.component';
import { DescriptionTemplatePreviewDialogModule } from '../description-template/description-template-preview/description-template-preview-dialog.module'; import { DescriptionTemplatePreviewDialogModule } from '../description-template/description-template-preview/description-template-preview-dialog.module';
@NgModule({ @NgModule({
@ -21,7 +21,7 @@ import { DescriptionTemplatePreviewDialogModule } from '../description-template/
CommonUiModule, CommonUiModule,
CommonFormsModule, CommonFormsModule,
ConfirmationDialogModule, ConfirmationDialogModule,
DmpBlueprintRoutingModule, PlanBlueprintRoutingModule,
NgxDropzoneModule, NgxDropzoneModule,
DragDropModule, DragDropModule,
AutoCompleteModule, AutoCompleteModule,
@ -32,10 +32,10 @@ import { DescriptionTemplatePreviewDialogModule } from '../description-template/
DescriptionTemplatePreviewDialogModule DescriptionTemplatePreviewDialogModule
], ],
declarations: [ declarations: [
DmpBlueprintEditorComponent, PlanBlueprintEditorComponent,
DmpBlueprintListingComponent, PlanBlueprintListingComponent,
DmpBlueprintListingFiltersComponent, PlanBlueprintListingFiltersComponent,
ImportDmpBlueprintDialogComponent ImportPlanBlueprintDialogComponent
] ]
}) })
export class DmpBlueprintModule { } export class PlanBlueprintModule { }

View File

@ -1,22 +1,22 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { DmpBlueprintEditorComponent } from './editor/plan-blueprint-editor.component'; import { PlanBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
import { DmpBlueprintListingComponent } from './listing/plan-blueprint-listing.component'; import { PlanBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { AuthGuard } from '@app/core/auth-guard.service'; import { AuthGuard } from '@app/core/auth-guard.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service'; import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service';
import { DmpBlueprintEditorResolver } from './editor/plan-blueprint-editor.resolver'; import { PlanBlueprintEditorResolver } from './editor/plan-blueprint-editor.resolver';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: DmpBlueprintListingComponent, component: PlanBlueprintListingComponent,
canActivate: [AuthGuard] canActivate: [AuthGuard]
}, },
{ {
path: 'versions/:groupid', path: 'versions/:groupid',
component: DmpBlueprintListingComponent, component: PlanBlueprintListingComponent,
canActivate: [AuthGuard], canActivate: [AuthGuard],
data: { data: {
mode: 'versions-listing' mode: 'versions-listing'
@ -25,14 +25,14 @@ const routes: Routes = [
{ {
path: 'new', path: 'new',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DmpBlueprintEditorComponent, component: PlanBlueprintEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],
data: { data: {
authContext: { authContext: {
permissions: [AppPermission.EditDmpBlueprint] permissions: [AppPermission.EditPlanBlueprint]
}, },
...BreadcrumbService.generateRouteDataConfiguration({ ...BreadcrumbService.generateRouteDataConfiguration({
title: 'BREADCRUMBS.NEW-DMP-BLUEPRINT' title: 'BREADCRUMBS.NEW-PLAN-BLUEPRINT'
}), }),
getFromTitleService: true, getFromTitleService: true,
usePrefix: false usePrefix: false
@ -41,17 +41,17 @@ const routes: Routes = [
{ {
path: 'clone/:cloneid', path: 'clone/:cloneid',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DmpBlueprintEditorComponent, component: PlanBlueprintEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],
resolve: { resolve: {
'entity': DmpBlueprintEditorResolver 'entity': PlanBlueprintEditorResolver
}, },
data: { data: {
...BreadcrumbService.generateRouteDataConfiguration({ ...BreadcrumbService.generateRouteDataConfiguration({
skipNavigation: true skipNavigation: true
}), }),
authContext: { authContext: {
permissions: [AppPermission.EditDmpBlueprint] permissions: [AppPermission.EditPlanBlueprint]
}, },
getFromTitleService: true, getFromTitleService: true,
usePrefix: false, usePrefix: false,
@ -61,17 +61,17 @@ const routes: Routes = [
{ {
path: 'new-version/:newversionid', path: 'new-version/:newversionid',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DmpBlueprintEditorComponent, component: PlanBlueprintEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],
resolve: { resolve: {
'entity': DmpBlueprintEditorResolver 'entity': PlanBlueprintEditorResolver
}, },
data: { data: {
...BreadcrumbService.generateRouteDataConfiguration({ ...BreadcrumbService.generateRouteDataConfiguration({
skipNavigation: true skipNavigation: true
}), }),
authContext: { authContext: {
permissions: [AppPermission.EditDmpBlueprint] permissions: [AppPermission.EditPlanBlueprint]
}, },
getFromTitleService: true, getFromTitleService: true,
usePrefix: false, usePrefix: false,
@ -81,14 +81,14 @@ const routes: Routes = [
{ {
path: ':id', path: ':id',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DmpBlueprintEditorComponent, component: PlanBlueprintEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],
resolve: { resolve: {
'entity': DmpBlueprintEditorResolver 'entity': PlanBlueprintEditorResolver
}, },
data: { data: {
authContext: { authContext: {
permissions: [AppPermission.EditDmpBlueprint] permissions: [AppPermission.EditPlanBlueprint]
}, },
getFromTitleService: true, getFromTitleService: true,
usePrefix: false usePrefix: false
@ -101,6 +101,6 @@ const routes: Routes = [
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],
exports: [RouterModule], exports: [RouterModule],
providers: [DmpBlueprintEditorResolver] providers: [PlanBlueprintEditorResolver]
}) })
export class DmpBlueprintRoutingModule { } export class PlanBlueprintRoutingModule { }

View File

@ -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.dmpUsers.map(x => x.user.name); this.dmpUsersMentionNames = 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

@ -27,21 +27,21 @@
<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.hasDmps()" 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.DMP-QUESTION' | translate}}</p> <p *ngIf="!this.hasDmps()" class="card-title mb-0 pt-4">{{'DASHBOARD.PLAN-QUESTION' | translate}}</p>
<p *ngIf="!this.hasDmps()" class="card-content mb-0">{{'DASHBOARD.INFO-DMP-TEXT' | translate}}</p> <p *ngIf="!this.hasDmps()" 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.hasDmps()" 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.DMP-ABOUT-BEG' | translate}} <p *ngIf="this.hasDmps()" 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.DMP-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.hasDmps()" 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)="openNewDmpDialog()">{{'DASHBOARD.START-YOUR-FIRST-DMP' | 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.hasDmps()" class="col-auto p-0 new-description-tour add-description-btn col-auto d-flex">
@ -64,7 +64,7 @@
<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'" [includeDmps]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
</mat-tab>> </mat-tab>>
<mat-tab aria-label="dmps" label="{{'DASHBOARD.DMPS' | translate}}"> <mat-tab aria-label="dmps" label="{{'DASHBOARD.PLANS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'dmps'" [includeDmps]="true" type="dmps" [selectedType]="currentType"></app-recent-edited-activity> <app-recent-edited-activity [isActive]="currentType == 'dmps'" [includeDmps]="true" type="dmps" [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}}">
@ -85,7 +85,7 @@
</div> </div>
<div class="col-auto col-xl-12"> <div class="col-auto col-xl-12">
<div class="counter-zero" style="width: fit-content;"><span>0</span></div> <div class="counter-zero" style="width: fit-content;"><span>0</span></div>
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a> <a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.PLANS' | translate}}</a>
</div> </div>
<div class="col-auto col-xl-12"> <div class="col-auto col-xl-12">
<div class="counter-zero" style="width: fit-content;"><span>0</span></div> <div class="counter-zero" style="width: fit-content;"><span>0</span></div>
@ -110,7 +110,7 @@
<div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}" style="width: fit-content;"> <div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}" style="width: fit-content;">
<span>{{dashboardStatistics?.dmpCount}}</span> <span>{{dashboardStatistics?.dmpCount}}</span>
</div> </div>
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a> <a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.PLANS' | translate}}</a>
</div> </div>
<div class="col-auto col-xl-12"> <div class="col-auto col-xl-12">
<div [ngClass]="{'counter': dashboardStatistics?.descriptionCount != 0, 'counter-zero': dashboardStatistics?.descriptionCount == 0}" style="width: fit-content;"> <div [ngClass]="{'counter': dashboardStatistics?.descriptionCount != 0, 'counter-zero': dashboardStatistics?.descriptionCount == 0}" style="width: fit-content;">
@ -168,7 +168,7 @@
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="counter-zero"><span>0</span></div> <div class="counter-zero"><span>0</span></div>
<a class="link">{{'DASHBOARD.PUBLIC-DMPS' | translate}}</a> <a class="link">{{'DASHBOARD.PUBLIC-PLANS' | translate}}</a>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="counter-zero"><span>0</span></div> <div class="counter-zero"><span>0</span></div>
@ -190,7 +190,7 @@
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}"><span>{{dashboardStatistics?.dmpCount}}</span></div> <div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}"><span>{{dashboardStatistics?.dmpCount}}</span></div>
<a [routerLink]="['/explore-plans']" class="link">{{'DASHBOARD.PUBLIC-DMPS' | translate}}</a> <a [routerLink]="['/explore-plans']" class="link">{{'DASHBOARD.PUBLIC-PLANS' | translate}}</a>
</div> </div>
<div class="col-auto"> <div class="col-auto">

View File

@ -16,7 +16,7 @@ import moment from 'moment';
import { CookieService } from 'ngx-cookie-service'; import { CookieService } from 'ngx-cookie-service';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { StartNewDescriptionDialogComponent } from '../description/start-new-description-dialog/start-new-description-dialog.component'; import { StartNewDescriptionDialogComponent } from '../description/start-new-description-dialog/start-new-description-dialog.component';
import { StartNewDmpDialogComponent } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.component'; import { StartNewPlanDialogComponent } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.component';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@ -112,12 +112,12 @@ export class DashboardComponent extends BaseComponent implements OnInit {
return this.authentication.currentAccountIsAuthenticated(); return this.authentication.currentAccountIsAuthenticated();
} }
openNewDmpDialog() { openNewPlanDialog() {
if (this.dialog.openDialogs.length > 0) { if (this.dialog.openDialogs.length > 0) {
this.dialog.closeAll(); this.dialog.closeAll();
} }
else { else {
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, { const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
disableClose: false, disableClose: false,
data: { data: {
isDialog: true isDialog: true
@ -140,23 +140,23 @@ export class DashboardComponent extends BaseComponent implements OnInit {
if (addDescription == false) return; if (addDescription == false) return;
const formGroup = this.fb.group({ const formGroup = this.fb.group({
dmpId: this.fb.control(null, Validators.required), planId: this.fb.control(null, Validators.required),
}) })
const dialogRef = this.dialog.open(StartNewDescriptionDialogComponent, { const dialogRef = this.dialog.open(StartNewDescriptionDialogComponent, {
disableClose: false, disableClose: false,
restoreFocus: false, restoreFocus: false,
data: { data: {
startNewDmp: false, startNewPlan: false,
formGroup: formGroup formGroup: formGroup
} }
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) { if (result) {
if (result.startNewDmp) { if (result.startNewPlan) {
this.openNewDmpDialog(); this.openNewPlanDialog();
} else { } else {
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', result.formGroup.get('dmpId').value])]); this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', result.formGroup.get('planId').value])]);
} }
} }
}); });
@ -172,7 +172,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
orientation: Orientation.BottomRight, orientation: Orientation.BottomRight,
isStepUnique: false, isStepUnique: false,
highlightPadding: 10, highlightPadding: 10,
closeAction: () => this.openNewDmpDialog() closeAction: () => this.openNewPlanDialog()
}, },
{ {
selector: '.import-file', selector: '.import-file',
@ -200,7 +200,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
}; };
public setDashboardTourDmpText(): void { public setDashboardTourDmpText(): void {
const dmpText = this.language.instant('DASHBOARD.TOUR-GUIDE.DMP') + '\n\n' + const dmpText = 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 = dmpText;
} }

View File

@ -7,7 +7,7 @@ import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/co
import { CommonUiModule } from '@common/ui/common-ui.module'; import { CommonUiModule } from '@common/ui/common-ui.module';
import { DescriptionListingModule } from '../description/listing/description-listing.module'; import { DescriptionListingModule } from '../description/listing/description-listing.module';
import { DmpListingModule } from '../plan/listing/plan-listing.module'; import { DmpListingModule } from '../plan/listing/plan-listing.module';
import { StartNewDmpDialogModule } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.module'; import { StartNewPlanDialogModule } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.module';
import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component'; import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component';
@NgModule({ @NgModule({
@ -21,7 +21,7 @@ import { RecentEditedActivityComponent } from './recent-edited-activity/recent-e
DmpListingModule, DmpListingModule,
DescriptionListingModule, DescriptionListingModule,
StartNewDmpDialogModule StartNewPlanDialogModule
], ],
declarations: [ declarations: [
DashboardComponent, DashboardComponent,

View File

@ -1,13 +1,13 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12 d-flex justify-content-center" *ngIf="listingItems == null"> <div class="col-md-12 d-flex justify-content-center" *ngIf="listingItems == null">
<span class="empty-list">{{'DMP-LISTING.EMPTY-LIST' | translate}}</span> <span class="empty-list">{{'PLAN-LISTING.EMPTY-LIST' | translate}}</span>
</div> </div>
<div *ngIf="listingItems != null" id="results" class="col-12" #results> <div *ngIf="listingItems != null" id="results" class="col-12" #results>
<div class="row pt-4"> <div class="row pt-4">
<!-- Sort by --> <!-- Sort by -->
<div class="col-12 col-xl-auto pr-0 d-flex align-items-center"> <div class="col-12 col-xl-auto pr-0 d-flex align-items-center">
<span class="mb-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span> <span class="mb-4">{{'PLAN-LISTING.SORT-BY' | translate}}:</span>
</div> </div>
<div class="col-12 col-xl-auto"> <div class="col-12 col-xl-auto">
<mat-form-field appearance="outline" class="w-100 sort-form"> <mat-form-field appearance="outline" class="w-100 sort-form">
@ -31,7 +31,7 @@
<!-- End of Search Filter --> <!-- End of Search Filter -->
</div> </div>
<div *ngFor="let item of listingItems; let i = index"> <div *ngFor="let item of listingItems; let i = index">
<app-dmp-listing-item-component *ngIf="item.dmp" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.dmp" [isPublic]="false"></app-dmp-listing-item-component> <app-dmp-listing-item-component *ngIf="item.plan" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.plan" [isPublic]="false"></app-dmp-listing-item-component>
<app-description-listing-item-component *ngIf="item?.description" [showDivider]="i != (listingItems.length - 1)" [description]="item?.description" [isPublic]="false" ></app-description-listing-item-component> <app-description-listing-item-component *ngIf="item?.description" [showDivider]="i != (listingItems.length - 1)" [description]="item?.description" [isPublic]="false" ></app-description-listing-item-component>
</div> </div>
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize"> <div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize">

View File

@ -3,22 +3,22 @@ import { Component, Input, OnInit, Output } from '@angular/core';
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms'; import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item'; import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { Description } from '@app/core/model/description/description'; import { Description } from '@app/core/model/description/description';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan'; import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
import { DmpReference } from '@app/core/model/plan/plan-reference'; import { PlanReference } from '@app/core/model/plan/plan-reference';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup'; import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { DashboardService } from '@app/core/services/dashboard/dashboard.service'; import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
@ -79,7 +79,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
private authentication: AuthService, private authentication: AuthService,
private dashboardService: DashboardService, private dashboardService: DashboardService,
private location: Location, private location: Location,
private dmpService: DmpService, private planService: PlanService,
private analyticsService: AnalyticsService, private analyticsService: AnalyticsService,
private httpErrorHandlingService: HttpErrorHandlingService private httpErrorHandlingService: HttpErrorHandlingService
) { ) {
@ -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._getDmpLookup() : []), ...(this.includeDmps ? this._getPlanLookup() : []),
...(this.includeDescriptions ? this._getDescriptionLookup() : []) ...(this.includeDescriptions ? this._getDescriptionLookup() : [])
] ]
}; };
@ -207,15 +207,15 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
if (this.lookup.page.offset == 0) this.listingItems = []; if (this.lookup.page.offset == 0) this.listingItems = [];
response.forEach(item => { response.forEach(item => {
if (item.dmp){ if (item.plan){
if (item.dmp.descriptions) { if (item.plan.descriptions) {
if (item.dmp.status == DmpStatus.Finalized) { if (item.plan.status == PlanStatus.Finalized) {
item.dmp.descriptions = item.dmp.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized); item.plan.descriptions = item.plan.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
} else { } else {
item.dmp.descriptions = item.dmp.descriptions.filter(x => x.isActive === IsActive.Active && x.status != DescriptionStatus.Canceled); item.plan.descriptions = item.plan.descriptions.filter(x => x.isActive === IsActive.Active && x.status != DescriptionStatus.Canceled);
} }
} }
item.dmp.dmpUsers = item.dmp.dmpUsers.filter(x=> x.isActive === IsActive.Active); item.plan.planUsers = item.plan.planUsers.filter(x=> x.isActive === IsActive.Active);
this.listingItems.push(item); this.listingItems.push(item);
} }
if (item.description){ if (item.description){
@ -240,52 +240,52 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
this.updateUrl(); this.updateUrl();
} }
private _getDmpLookup(): string[] { private _getPlanLookup(): string[] {
return [ return [
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.description)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.description)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.version)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.version)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.versionStatus)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.versionStatus)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.groupId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.groupId)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.updatedAt)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.updatedAt)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.hash)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.hash)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.CreateNewVersionPlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.DeletePlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.ClonePlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.FinalizePlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.ExportPlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.AssignPlanUsers].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.EditPlan].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
]; ];
} }
@ -298,28 +298,28 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'), [nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
] ]
} }
} }

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('dmpId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-DMP' | translate}}" [configuration]="dmpAutoCompleteConfiguration"> <app-single-auto-complete [formControl]="data.formGroup.get('planId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-PLAN' | translate}}" [configuration]="dmpAutoCompleteConfiguration">
</app-single-auto-complete> </app-single-auto-complete>
</mat-form-field> </mat-form-field>
</div> </div>
@ -15,7 +15,7 @@
<div *ngIf="this.sections.length > 1" class="row"> <div *ngIf="this.sections.length > 1" class="row">
<div class="col-12"> <div class="col-12">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'DESCRIPTION-COPY-DIALOG.DMP-SECTION' | translate}}</mat-label> <mat-label>{{'DESCRIPTION-COPY-DIALOG.PLAN-SECTION' | translate}}</mat-label>
<mat-select [formControl]="data.formGroup.get('sectionId')"> <mat-select [formControl]="data.formGroup.get('sectionId')">
<mat-option *ngFor="let section of sections" [value]="section.id">{{section.label}}</mat-option> <mat-option *ngFor="let section of sections" [value]="section.id">{{section.label}}</mat-option>
</mat-select> </mat-select>

View File

@ -6,18 +6,18 @@ import { Observable } from "rxjs";
import { Inject } from "@angular/core"; import { Inject } from "@angular/core";
import { TranslateService } from "@ngx-translate/core"; import { TranslateService } from "@ngx-translate/core";
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 { Dmp, DmpDescriptionTemplate } from '@app/core/model/plan/plan'; import { Plan, PlanDescriptionTemplate } from '@app/core/model/plan/plan';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup'; import { PlanDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpLookup } from '@app/core/query/plan.lookup'; import { PlanLookup } from '@app/core/query/plan.lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { FilterService } from '@common/modules/text-filter/filter-service'; import { FilterService } from '@common/modules/text-filter/filter-service';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
@Component({ @Component({
selector: 'description-copy-dialog-component', selector: 'description-copy-dialog-component',
@ -26,54 +26,54 @@ import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, Dm
}) })
export class DescriptionCopyDialogComponent { export class DescriptionCopyDialogComponent {
dmpModel: Dmp; dmpModel: Plan;
sections: DmpBlueprintDefinitionSection[] = []; sections: PlanBlueprintDefinitionSection[] = [];
descriptionDescriptionTemplateLabel: String; descriptionDescriptionTemplateLabel: String;
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group. dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group.
initialItems: (data?: any) => this.dmpService.query(this.buildDmpLookup(null,null,null, this.dmpDescriptionTemplateLookup)).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.dmpService.query(this.buildDmpLookup(searchQuery, null, null, this.dmpDescriptionTemplateLookup)).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.dmpService.query(this.buildDmpLookup(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])),
displayFn: (item: Dmp) => item.label, displayFn: (item: Plan) => item.label,
titleFn: (item: Dmp) => item.label, titleFn: (item: Plan) => item.label,
valueAssign: (item: Dmp) => this.findSection(item), valueAssign: (item: Plan) => this.findSection(item),
}; };
dmpDescriptionTemplateLookup: DmpDescriptionTemplateLookup = { planDescriptionTemplateLookup: PlanDescriptionTemplateLookup = {
descriptionTemplateGroupIds: [this.data.descriptionTemplate.groupId], descriptionTemplateGroupIds: [this.data.descriptionTemplate.groupId],
isActive: [IsActive.Active] isActive: [IsActive.Active]
} as DmpDescriptionTemplateLookup; } as PlanDescriptionTemplateLookup;
private buildDmpLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup { private buildPlanLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
const lookup: DmpLookup = new DmpLookup(); const lookup: PlanLookup = new PlanLookup();
lookup.page = { size: 100, offset: 0 }; lookup.page = { size: 100, offset: 0 };
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
if (ids && ids.length > 0) { lookup.ids = ids; } if (ids && ids.length > 0) { lookup.ids = ids; }
lookup.isActive = [IsActive.Active]; lookup.isActive = [IsActive.Active];
lookup.statuses = [DmpStatus.Draft]; lookup.statuses = [PlanStatus.Draft];
lookup.project = { lookup.project = {
fields: [ fields: [
nameof<Dmp>(x => x.id), nameof<Plan>(x => x.id),
nameof<Dmp>(x => x.label), nameof<Plan>(x => x.label),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'), [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.ordinal)].join('.'), [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
] ]
}; };
if (dmpDescriptionTemplateSubQuery != null) lookup.dmpDescriptionTemplateSubQuery = dmpDescriptionTemplateSubQuery; if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
lookup.order = { items: [nameof<Dmp>(x => x.label)] }; lookup.order = { items: [nameof<Plan>(x => x.label)] };
if (like) { lookup.like = this.filterService.transformLike(like); } if (like) { lookup.like = this.filterService.transformLike(like); }
return lookup; return lookup;
} }
constructor( constructor(
public dialogRef: MatDialogRef<DescriptionCopyDialogComponent>, public dialogRef: MatDialogRef<DescriptionCopyDialogComponent>,
public dmpService: DmpService, public planService: PlanService,
public descriptionService: DescriptionService, public descriptionService: DescriptionService,
public language: TranslateService, public language: TranslateService,
private filterService: FilterService, private filterService: FilterService,
@ -83,8 +83,8 @@ export class DescriptionCopyDialogComponent {
ngOnInit() { ngOnInit() {
} }
findSection(dmp: Dmp){ findSection(dmp: Plan){
const availableSectionIds = dmp.dmpDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId); const availableSectionIds = dmp.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 = dmp.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);

View File

@ -23,7 +23,7 @@
<div class="heading">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION' | translate}}</div> <div class="heading">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION' | translate}}</div>
<span class="hint">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-HINT' | translate}}</span> <span class="hint">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-HINT' | translate}}</span>
<div class="description-form"> <div class="description-form">
<rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'DMP-EDITOR.PLACEHOLDER.DESCRIPTION'" [wrapperClasses]="'full-width editor ' + <rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'PLAN-EDITOR.PLACEHOLDER.DESCRIPTION'" [wrapperClasses]="'full-width editor ' +
((formGroup.get('description').touched && (formGroup.get('description').hasError('required') || formGroup.get('description').hasError('backendError'))) ? 'required' : '')" [editable]="!formGroup.get('description').disabled"> ((formGroup.get('description').touched && (formGroup.get('description').hasError('required') || formGroup.get('description').hasError('backendError'))) ? 'required' : '')" [editable]="!formGroup.get('description').disabled">
</rich-text-editor-component> </rich-text-editor-component>
<div [class]="(formGroup.get('description').touched && (formGroup.get('description').hasError('required') || formGroup.get('description').hasError('backendError'))) ? 'visible' : 'invisible'" class="mat-form-field form-field-subscript-wrapper"> <div [class]="(formGroup.get('description').touched && (formGroup.get('description').hasError('required') || formGroup.get('description').hasError('backendError'))) ? 'visible' : 'invisible'" class="mat-form-field form-field-subscript-wrapper">

View File

@ -6,7 +6,7 @@ import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/descript
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { Description } from '@app/core/model/description/description'; import { Description } from '@app/core/model/description/description';
import { DmpDescriptionTemplate } from '@app/core/model/plan/plan'; import { PlanDescriptionTemplate } from '@app/core/model/plan/plan';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.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';
@ -40,8 +40,8 @@ export class DescriptionBaseFieldsEditorComponent extends BaseComponent {
} }
private loadDescriptionTemplates(): void { private loadDescriptionTemplates(): void {
const dmpDescriptionTemplates: DmpDescriptionTemplate[] = this.description.dmp.dmpDescriptionTemplates.filter(x => x.sectionId == this.description.dmpDescriptionTemplate.sectionId && x.isActive == IsActive.Active); const planDescriptionTemplates: PlanDescriptionTemplate[] = this.description.plan.planDescriptionTemplates.filter(x => x.sectionId == this.description.planDescriptionTemplate.sectionId && x.isActive == IsActive.Active);
const currentVersionsOfDescriptionTemplates = dmpDescriptionTemplates.map(x => x.currentDescriptionTemplate); const currentVersionsOfDescriptionTemplates = planDescriptionTemplates.map(x => x.currentDescriptionTemplate);
this.availableDescriptionTemplates.push(...currentVersionsOfDescriptionTemplates); this.availableDescriptionTemplates.push(...currentVersionsOfDescriptionTemplates);
if (this.description?.descriptionTemplate != null) { if (this.description?.descriptionTemplate != null) {

View File

@ -16,10 +16,10 @@
<div class="description-title">{{'DESCRIPTION-EDITOR.TITLE-PREVIEW-DESCRIPTION' | translate}}</div> <div class="description-title">{{'DESCRIPTION-EDITOR.TITLE-PREVIEW-DESCRIPTION' | translate}}</div>
</ng-template> </ng-template>
<div *ngIf="item?.dmp?.id" class="d-flex flex-direction-row dmp-info"> <div *ngIf="item?.dmp?.id" class="d-flex flex-direction-row dmp-info">
<div class="col-auto description-to-dmp">{{'DESCRIPTION-EDITOR.TO-DMP' | translate}}</div> <div class="col-auto description-to-dmp">{{'DESCRIPTION-EDITOR.TO-PLAN' | translate}}</div>
<div class="dmp-title p-0">:&nbsp;{{ item?.dmp?.label }}</div> <div class="dmp-title p-0">:&nbsp;{{ item?.dmp?.label }}</div>
<div class="col-auto d-flex align-items-center"> <div class="col-auto d-flex align-items-center">
<a [routerLink]="routerUtils.generateUrl(['/plans/overview/', item.dmp.id])" target="_blank" class="pointer open-in-new-icon"> <a [routerLink]="routerUtils.generateUrl(['/plans/overview/', item.plan.id])" target="_blank" class="pointer open-in-new-icon">
<mat-icon class="size-18">open_in_new</mat-icon> <mat-icon class="size-18">open_in_new</mat-icon>
</a> </a>
</div> </div>
@ -67,7 +67,7 @@
<button [disabled]="saving" mat-menu-item (click)="saveAndContinue()" type="button">{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button> <button [disabled]="saving" mat-menu-item (click)="saveAndContinue()" type="button">{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
</mat-menu> </mat-menu>
<button [disabled]="saving" *ngIf="canEdit && !isLocked && !viewOnly && hasReversableStatus() == false && canEdit" mat-raised-button class="description-save-btn mr-2" type="button" (click)="finalize()">{{ 'DESCRIPTION-EDITOR.ACTIONS.FINALIZE' | translate }}</button> <button [disabled]="saving" *ngIf="canEdit && !isLocked && !viewOnly && hasReversableStatus() == false && canEdit" mat-raised-button class="description-save-btn mr-2" type="button" (click)="finalize()">{{ 'DESCRIPTION-EDITOR.ACTIONS.FINALIZE' | translate }}</button>
<button [disabled]="saving" *ngIf="isLocked" mat-raised-button disabled class="description-save-btn cursor-default" type="button">{{ 'DMP-OVERVIEW.LOCKED' | translate}}</button> <button [disabled]="saving" *ngIf="isLocked" mat-raised-button disabled class="description-save-btn cursor-default" type="button">{{ 'PLAN-OVERVIEW.LOCKED' | translate}}</button>
<button [disabled]="saving" *ngIf="hasReversableStatus() && !isLocked && canEdit" mat-raised-button class="description-save-btn mr-2" (click)="reverse()" type="button">{{ 'DESCRIPTION-EDITOR.ACTIONS.REVERSE' | translate }}</button> <button [disabled]="saving" *ngIf="hasReversableStatus() && !isLocked && canEdit" mat-raised-button class="description-save-btn mr-2" (click)="reverse()" type="button">{{ 'DESCRIPTION-EDITOR.ACTIONS.REVERSE' | translate }}</button>
</div> </div>
</div> </div>
@ -86,11 +86,11 @@
<div class="row editor-content"> <div class="row editor-content">
<div style="width: 22em;" class="d-flex flex-column"> <div style="width: 22em;" class="d-flex flex-column">
<div class="stepper-back row"> <div class="stepper-back row">
<div class="col-auto d-flex align-items-center back-to-dmp" (click)="backToDmp(this.formGroup.get('dmpId').value)"> <div class="col-auto d-flex align-items-center back-to-dmp" (click)="backToDmp(this.formGroup.get('planId').value)">
<mat-icon class="back-icon pointer">chevron_left</mat-icon> <mat-icon class="back-icon pointer">chevron_left</mat-icon>
<span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span> <span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span>
</div> </div>
<div class="col-auto dmp-label ml-1">{{'DESCRIPTION-EDITOR.DMP' | translate}}</div> <div class="col-auto dmp-label ml-1">{{'DESCRIPTION-EDITOR.PLAN' | translate}}</div>
</div> </div>
<div class="row stepper-title"> <div class="row stepper-title">
<div class="col-12 pl-0 mb-1"><span>{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</span></div> <div class="col-12 pl-0 mb-1"><span>{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</span></div>

View File

@ -4,15 +4,15 @@ import { MatDialog } from '@angular/material/dialog';
import { Title } from '@angular/platform-browser'; import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Params, Router } from '@angular/router'; import { ActivatedRoute, Params, Router } from '@angular/router';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type'; import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { LockTargetType } from '@app/core/common/enum/lock-target-type'; import { LockTargetType } from '@app/core/common/enum/lock-target-type';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { DescriptionTemplate, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplatePage, DescriptionTemplateSection } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplatePage, DescriptionTemplateSection } from '@app/core/model/description-template/description-template';
import { Description, DescriptionPersist, DescriptionStatusPersist } from '@app/core/model/description/description'; import { Description, DescriptionPersist, DescriptionStatusPersist } from '@app/core/model/description/description';
import { DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { DmpDescriptionTemplate } from '@app/core/model/plan/plan'; import { PlanDescriptionTemplate } from '@app/core/model/plan/plan';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
@ -135,9 +135,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
.subscribe((params: Params) => { .subscribe((params: Params) => {
const itemId = params['id']; const itemId = params['id'];
const dmpId = params['dmpId']; const planId = params['planId'];
const copyDmpId = params['copyDmpId']; const copyPlanId = params['copyPlanId'];
const dmpSectionId = params['dmpSectionId']; const planSectionId = params['planSectionId'];
const isPublicDescription = params['public']; const isPublicDescription = params['public'];
const newDmpId = params['newDmpId']; const newDmpId = params['newDmpId'];
@ -146,7 +146,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.anchorFieldsetId = params['fieldsetId'] ?? null; this.anchorFieldsetId = params['fieldsetId'] ?? null;
this.openAnnotation = this.route.snapshot.data['openAnnotation'] ?? false; this.openAnnotation = this.route.snapshot.data['openAnnotation'] ?? false;
if (copyDmpId && !dmpId && dmpSectionId) this.isCopy = true; if (copyPlanId && !planId && planSectionId) this.isCopy = true;
this.viewOnly = isPublicDescription; this.viewOnly = isPublicDescription;
@ -155,15 +155,15 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
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');
} }
else if (dmpId != null && dmpSectionId != null) { else if (planId != null && planSectionId != null) {
this.isNew = true; this.isNew = true;
const dialogRef = this.dialog.open(PrefillDescriptionDialogComponent, { const dialogRef = this.dialog.open(PrefillDescriptionDialogComponent, {
width: '590px', width: '590px',
minHeight: '200px', minHeight: '200px',
restoreFocus: false, restoreFocus: false,
data: { data: {
dmp: this.item.dmp, plan: this.item.plan,
dmpSectionId: dmpSectionId planSectionId: planSectionId
}, },
panelClass: 'custom-modalbox' panelClass: 'custom-modalbox'
}); });
@ -171,11 +171,11 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
if (result) { if (result) {
this.titleService.setTitle(result.label); this.titleService.setTitle(result.label);
result.dmp = this.item.dmp; result.plan = this.item.plan;
result.dmpDescriptionTemplate = this.item.dmpDescriptionTemplate; result.planDescriptionTemplate = this.item.planDescriptionTemplate;
const sectionId = this.item.dmpDescriptionTemplate.sectionId; const sectionId = this.item.planDescriptionTemplate.sectionId;
result.dmpDescriptionTemplate = this.item.dmp.dmpDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == result.descriptionTemplate.groupId); result.planDescriptionTemplate = this.item.plan.planDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == result.descriptionTemplate.groupId);
this.prepareForm(result); this.prepareForm(result);
this.changeDetectorRef.markForCheck(); // when prefilling a description the "prepareForm" has already being executed from the base-editor and we need to trigger the angular's change-detector manually this.changeDetectorRef.markForCheck(); // when prefilling a description the "prepareForm" has already being executed from the base-editor and we need to trigger the angular's change-detector manually
@ -210,14 +210,14 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
prepareForm(data: Description) { prepareForm(data: Description) {
try { try {
this.editorModel = data ? new DescriptionEditorModel().fromModel(data, data.descriptionTemplate) : new DescriptionEditorModel(); this.editorModel = data ? new DescriptionEditorModel().fromModel(data, data.descriptionTemplate) : new DescriptionEditorModel();
if (data && data?.dmp?.dmpUsers) data.dmp.dmpUsers = data.dmp.dmpUsers.filter(x => x.isActive === IsActive.Active); if (data && data?.plan?.planUsers) data.plan.planUsers = data.plan.planUsers.filter(x => x.isActive === IsActive.Active);
this.item = data; this.item = data;
this.initialTemplateId = data?.descriptionTemplate?.id?.toString(); this.initialTemplateId = data?.descriptionTemplate?.id?.toString();
if (data && data.dmpDescriptionTemplate?.sectionId && data.dmp?.blueprint?.definition?.sections?.length > 0 && data.dmp?.descriptions?.length > 0) { if (data && data.planDescriptionTemplate?.sectionId && data.plan?.blueprint?.definition?.sections?.length > 0 && data.plan?.descriptions?.length > 0) {
const section = data.dmp?.blueprint?.definition?.sections.find(x => x.id == data.dmpDescriptionTemplate?.sectionId); const section = data.plan?.blueprint?.definition?.sections.find(x => x.id == data.planDescriptionTemplate?.sectionId);
if (section.hasTemplates) { if (section.hasTemplates) {
const notAvailableDescriptionTemplates = this.calculateMultiplicityRejectedDmpDescriptionTemplates(section, data.dmp.descriptions.filter(x => x.isActive == IsActive.Active)); const notAvailableDescriptionTemplates = this.calculateMultiplicityRejectedPlanDescriptionTemplates(section, data.plan.descriptions.filter(x => x.isActive == IsActive.Active));
this.item.dmp.dmpDescriptionTemplates = data.dmp.dmpDescriptionTemplates.filter(x => !notAvailableDescriptionTemplates.map(y => y.id).includes(x.id)) this.item.plan.planDescriptionTemplates = data.plan.planDescriptionTemplates.filter(x => !notAvailableDescriptionTemplates.map(y => y.id).includes(x.id))
} }
} }
this.isDeleted = data ? data.isActive === IsActive.Inactive : false; this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
@ -233,8 +233,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
} }
buildForm() { buildForm() {
this.canEdit = this.permissionPerSection && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()] && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()].some(x => x === AppPermission.EditDescription); this.canEdit = this.permissionPerSection && this.permissionPerSection[this.item.planDescriptionTemplate.sectionId.toString()] && this.permissionPerSection[this.item.planDescriptionTemplate.sectionId.toString()].some(x => x === AppPermission.EditDescription);
this.canReview = this.permissionPerSection && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()] && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()].some(x => x === AppPermission.ReviewDescription); this.canReview = this.permissionPerSection && this.permissionPerSection[this.item.planDescriptionTemplate.sectionId.toString()] && this.permissionPerSection[this.item.planDescriptionTemplate.sectionId.toString()].some(x => x === AppPermission.ReviewDescription);
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.canEdit, this.visibilityRulesService); this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.canEdit, this.visibilityRulesService);
if (this.item.descriptionTemplate?.definition) this.visibilityRulesService.setContext(this.item.descriptionTemplate.definition, this.formGroup.get('properties')); if (this.item.descriptionTemplate?.definition) this.visibilityRulesService.setContext(this.item.descriptionTemplate.definition, this.formGroup.get('properties'));
if (this.item.descriptionTemplate?.definition) this.pageToFieldSetMap = this.mapPageToFieldSet(this.item.descriptionTemplate);; if (this.item.descriptionTemplate?.definition) this.pageToFieldSetMap = this.mapPageToFieldSet(this.item.descriptionTemplate);;
@ -252,21 +252,21 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.registerFormListeners(); this.registerFormListeners();
} }
calculateMultiplicityRejectedDmpDescriptionTemplates(section: DmpBlueprintDefinitionSection, descriptions: Description[]): DmpDescriptionTemplate[] { calculateMultiplicityRejectedPlanDescriptionTemplates(section: PlanBlueprintDefinitionSection, descriptions: Description[]): PlanDescriptionTemplate[] {
if (section.descriptionTemplates?.length > 0) { if (section.descriptionTemplates?.length > 0) {
descriptions = descriptions?.filter(x => x?.dmpDescriptionTemplate?.sectionId === section.id) || []; descriptions = descriptions?.filter(x => x?.planDescriptionTemplate?.sectionId === section.id) || [];
let rejectedDmpDescriptionTemplates: DmpDescriptionTemplate[] = []; let rejectedPlanDescriptionTemplates: PlanDescriptionTemplate[] = [];
section.descriptionTemplates.forEach(sectionDescriptionTemplate => { section.descriptionTemplates.forEach(sectionDescriptionTemplate => {
if (sectionDescriptionTemplate.maxMultiplicity != null) { if (sectionDescriptionTemplate.maxMultiplicity != null) {
const commonDescriptions = descriptions.filter(x => x.dmpDescriptionTemplate.descriptionTemplateGroupId == sectionDescriptionTemplate.descriptionTemplateGroupId); const commonDescriptions = descriptions.filter(x => x.planDescriptionTemplate.descriptionTemplateGroupId == sectionDescriptionTemplate.descriptionTemplateGroupId);
if (commonDescriptions && commonDescriptions.length >= sectionDescriptionTemplate.maxMultiplicity) { if (commonDescriptions && commonDescriptions.length >= sectionDescriptionTemplate.maxMultiplicity) {
rejectedDmpDescriptionTemplates.push.apply(rejectedDmpDescriptionTemplates, commonDescriptions.map(x => x.dmpDescriptionTemplate)); rejectedPlanDescriptionTemplates.push.apply(rejectedPlanDescriptionTemplates, commonDescriptions.map(x => x.planDescriptionTemplate));
} }
} }
}) })
return rejectedDmpDescriptionTemplates; return rejectedPlanDescriptionTemplates;
} else { } else {
return []; return [];
} }
@ -319,7 +319,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
formSubmit(onSuccess?: (response) => void): void { formSubmit(onSuccess?: (response) => void): void {
this.formService.removeAllBackEndErrors(this.formGroup); this.formService.removeAllBackEndErrors(this.formGroup);
if (this.formGroup.get('label').valid && this.formGroup.get('dmpId').valid && this.formGroup.get('dmpDescriptionTemplateId').valid if (this.formGroup.get('label').valid && this.formGroup.get('planId').valid && this.formGroup.get('planDescriptionTemplateId').valid
&& this.formGroup.get('descriptionTemplateId').valid && this.formGroup.get('status').valid) { && this.formGroup.get('descriptionTemplateId').valid && this.formGroup.get('status').valid) {
this.persistEntity(onSuccess); this.persistEntity(onSuccess);
} else { } else {
@ -331,9 +331,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
saveAndClose() { saveAndClose() {
this.formSubmit((data) => { this.formSubmit((data) => {
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
const dmpId = this.formGroup.get('dmpId').value; const planId = this.formGroup.get('planId').value;
this.formGroup = null; this.formGroup = null;
this.backToDmp(dmpId); this.backToDmp(planId);
}); });
} }
@ -414,8 +414,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.formService.validateAllFormFields(this.formGroup); this.formService.validateAllFormFields(this.formGroup);
} }
backToDmp(dmpId) { backToDmp(planId) {
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', dmpId])]); this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', planId])]);
} }
private showSaveStateValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) { private showSaveStateValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
@ -547,8 +547,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
} }
hasReversableStatus(): boolean { hasReversableStatus(): boolean {
if (this.item?.dmp) { if (this.item?.plan) {
return (this.item.dmp.status == DmpStatus.Draft && this.isFinalized); return (this.item.plan.status == PlanStatus.Draft && this.isFinalized);
} else { } else {
return false; return false;
} }
@ -641,9 +641,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.formGroup.setControl('properties', this.editorModel.buildProperties(this.visibilityRulesService)); this.formGroup.setControl('properties', this.editorModel.buildProperties(this.visibilityRulesService));
this.item.descriptionTemplate = descriptionTemplate; this.item.descriptionTemplate = descriptionTemplate;
const sectionId = this.item.dmpDescriptionTemplate.sectionId; const sectionId = this.item.planDescriptionTemplate.sectionId;
this.item.dmpDescriptionTemplate = this.item.dmp.dmpDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == descriptionTemplate.groupId); this.item.planDescriptionTemplate = this.item.plan.planDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == descriptionTemplate.groupId);
this.formGroup.get('dmpDescriptionTemplateId').setValue(this.item.dmpDescriptionTemplate.id); this.formGroup.get('planDescriptionTemplateId').setValue(this.item.planDescriptionTemplate.id);
if (descriptionTemplate.definition) this.visibilityRulesService.setContext(this.item.descriptionTemplate.definition, this.formGroup.get('properties')); if (descriptionTemplate.definition) this.visibilityRulesService.setContext(this.item.descriptionTemplate.definition, this.formGroup.get('properties'));
if (descriptionTemplate.definition) this.pageToFieldSetMap = this.mapPageToFieldSet(this.item.descriptionTemplate); if (descriptionTemplate.definition) this.pageToFieldSetMap = this.mapPageToFieldSet(this.item.descriptionTemplate);

View File

@ -15,8 +15,8 @@ import { VisibilityRulesService } from "./description-form/visibility-rules/visi
export class DescriptionEditorModel extends BaseEditorModel implements DescriptionPersist { export class DescriptionEditorModel extends BaseEditorModel implements DescriptionPersist {
label: string; label: string;
dmpId: Guid; planId: Guid;
dmpDescriptionTemplateId: Guid; planDescriptionTemplateId: Guid;
descriptionTemplateId: Guid; descriptionTemplateId: Guid;
status: DescriptionStatus; status: DescriptionStatus;
description: string; description: string;
@ -33,8 +33,8 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
if (item) { if (item) {
super.fromModel(item); super.fromModel(item);
this.label = item.label; this.label = item.label;
this.dmpId = item.dmp?.id; this.planId = item.plan?.id;
this.dmpDescriptionTemplateId = item.dmpDescriptionTemplate?.id; this.planDescriptionTemplateId = item.planDescriptionTemplate?.id;
this.descriptionTemplateId = item.descriptionTemplate?.id; this.descriptionTemplateId = item.descriptionTemplate?.id;
this.status = item.status ?? DescriptionStatus.Draft; this.status = item.status ?? DescriptionStatus.Draft;
this.description = item.description; this.description = item.description;
@ -50,8 +50,8 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
return this.formBuilder.group({ return this.formBuilder.group({
id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
dmpId: [{ value: this.dmpId, disabled: disabled }, context.getValidation('dmpId').validators], planId: [{ value: this.planId, disabled: disabled }, context.getValidation('planId').validators],
dmpDescriptionTemplateId: [{ value: this.dmpDescriptionTemplateId, disabled: disabled }, context.getValidation('dmpDescriptionTemplateId').validators], planDescriptionTemplateId: [{ value: this.planDescriptionTemplateId, disabled: disabled }, context.getValidation('planDescriptionTemplateId').validators],
descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId').validators], descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId').validators],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators], description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
@ -73,8 +73,8 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
const baseValidationArray: Validation[] = new Array<Validation>(); const baseValidationArray: Validation[] = new Array<Validation>();
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] }); baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
baseValidationArray.push({ key: 'label', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'label')] }); baseValidationArray.push({ key: 'label', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'label')] });
baseValidationArray.push({ key: 'dmpId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'dmpId')] }); baseValidationArray.push({ key: 'planId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'planId')] });
baseValidationArray.push({ key: 'dmpDescriptionTemplateId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'dmpDescriptionTemplateId')] }); baseValidationArray.push({ key: 'planDescriptionTemplateId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'planDescriptionTemplateId')] });
baseValidationArray.push({ key: 'descriptionTemplateId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'descriptionTemplateId')] }); baseValidationArray.push({ key: 'descriptionTemplateId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'descriptionTemplateId')] });
baseValidationArray.push({ key: 'status', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'status')] }); baseValidationArray.push({ key: 'status', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'status')] });
baseValidationArray.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] }); baseValidationArray.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] });

View File

@ -83,7 +83,7 @@ const routes: Routes = [
} }
}, },
{ {
path: ':dmpId/:dmpSectionId', path: ':planId/:planSectionId',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DescriptionEditorComponent, component: DescriptionEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],
@ -99,7 +99,7 @@ const routes: Routes = [
} }
}, },
{ {
path: 'copy/:id/:copyDmpId/:dmpSectionId', path: 'copy/:id/:copyPlanId/:planSectionId',
canActivate: [AuthGuard], canActivate: [AuthGuard],
component: DescriptionEditorComponent, component: DescriptionEditorComponent,
canDeactivate: [PendingChangesGuard], canDeactivate: [PendingChangesGuard],

View File

@ -20,7 +20,7 @@ import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { DmpUser } from '@app/core/model/plan/plan'; import { PlanUser } from '@app/core/model/plan/plan';
@Component({ @Component({
selector: 'app-description-form-field-set', selector: 'app-description-form-field-set',
@ -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: DmpUser[] = []; @Input() dmpUsers: PlanUser[] = [];
get isMultiplicityEnabled() { get isMultiplicityEnabled() {
return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null; return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null;

View File

@ -81,7 +81,7 @@
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<mat-label>{{ field.data.label }}</mat-label> <mat-label>{{ field.data.label }}</mat-label>
<app-multiple-auto-complete [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="dmpService.multipleAutocompleteConfiguration"> <app-multiple-auto-complete [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="planService.multipleAutocompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('textListValue').getError('backendError').message}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('textListValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
@ -91,7 +91,7 @@
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<mat-label>{{ field.data.label }}</mat-label> <mat-label>{{ field.data.label }}</mat-label>
<app-single-auto-complete [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="dmpService.singleAutocompleteConfiguration"> <app-single-auto-complete [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="planService.singleAutocompleteConfiguration">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('textValue').getError('backendError').message}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('textValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>

View File

@ -8,7 +8,7 @@ import { DescriptionTemplateFieldValidationType } from '@app/core/common/enum/de
import { DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateLabelAndMultiplicityData, DescriptionTemplateUploadData } from '@app/core/model/description-template/description-template'; import { DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateLabelAndMultiplicityData, DescriptionTemplateUploadData } from '@app/core/model/description-template/description-template';
import { StorageFile } from '@app/core/model/storage-file/storage-file'; import { StorageFile } from '@app/core/model/storage-file/storage-file';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { SnackBarNotificationLevel, UiNotificationService } from "@app/core/services/notification/ui-notification-service"; import { SnackBarNotificationLevel, UiNotificationService } from "@app/core/services/notification/ui-notification-service";
import { ReferenceService } from '@app/core/services/reference/reference.service'; import { ReferenceService } from '@app/core/services/reference/reference.service';
import { StorageFileService } from '@app/core/services/storage-file/storage-file.service'; import { StorageFileService } from '@app/core/services/storage-file/storage-file.service';
@ -80,7 +80,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
constructor( constructor(
private language: TranslateService, private language: TranslateService,
public dmpService: DmpService, public planService: PlanService,
public descriptionService: DescriptionService, public descriptionService: DescriptionService,
public tagService: TagService, public tagService: TagService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,

View File

@ -8,7 +8,7 @@ import { ToCEntryType } from '../../../table-of-contents/models/toc-entry-type.e
import { LinkToScroll } from '../../../table-of-contents/table-of-contents.component'; import { LinkToScroll } from '../../../table-of-contents/table-of-contents.component';
import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service'; import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { DmpUser } from '@app/core/model/plan/plan'; import { PlanUser } from '@app/core/model/plan/plan';
@Component({ @Component({
@ -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: DmpUser[] = []; @Input() dmpUsers: PlanUser[] = [];
// @Input() descriptionTemplateId: String; // @Input() descriptionTemplateId: String;

View File

@ -8,7 +8,7 @@ import { Guid } from '@common/types/guid';
import { LinkToScroll } from '../table-of-contents/table-of-contents.component'; import { LinkToScroll } from '../table-of-contents/table-of-contents.component';
import { DescriptionFormAnnotationService } from './description-form-annotation.service'; import { DescriptionFormAnnotationService } from './description-form-annotation.service';
import { VisibilityRulesService } from './visibility-rules/visibility-rules.service'; import { VisibilityRulesService } from './visibility-rules/visibility-rules.service';
import { DmpUser } from '@app/core/model/plan/plan'; import { PlanUser } from '@app/core/model/plan/plan';
@Component({ @Component({
selector: 'app-description-form', selector: 'app-description-form',
@ -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: DmpUser[] = []; @Input() dmpUsers: PlanUser[] = [];
@Output() formChanged: EventEmitter<any> = new EventEmitter(); @Output() formChanged: EventEmitter<any> = new EventEmitter();

View File

@ -3,7 +3,7 @@ import { UntypedFormGroup } from "@angular/forms";
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog"; import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
import { DescriptionPrefillingRequest, PrefillingSearchRequest } from "@app/core/model/description-prefilling-request/description-prefilling-request"; import { DescriptionPrefillingRequest, PrefillingSearchRequest } from "@app/core/model/description-prefilling-request/description-prefilling-request";
import { DescriptionTemplate } from "@app/core/model/description-template/description-template"; import { DescriptionTemplate } from "@app/core/model/description-template/description-template";
import { Dmp } from "@app/core/model/plan/plan"; import { Plan } from "@app/core/model/plan/plan";
import { Prefilling } from "@app/core/model/prefilling-source/prefilling-source"; import { Prefilling } from "@app/core/model/prefilling-source/prefilling-source";
import { PrefillingSourceService } from "@app/core/services/prefilling-source/prefilling-source.service"; import { PrefillingSourceService } from "@app/core/services/prefilling-source/prefilling-source.service";
import { ProgressIndicationService } from "@app/core/services/progress-indication/progress-indication-service"; import { ProgressIndicationService } from "@app/core/services/progress-indication/progress-indication-service";
@ -31,8 +31,8 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
prefillSelected: boolean = false; prefillSelected: boolean = false;
prefillForm: UntypedFormGroup; prefillForm: UntypedFormGroup;
dmp: Dmp; dmp: Plan;
dmpSectionId: Guid; planSectionId: Guid;
availableDescriptionTemplates: DescriptionTemplate[] = []; availableDescriptionTemplates: DescriptionTemplate[] = [];
constructor(public dialogRef: MatDialogRef<PrefillDescriptionDialogComponent>, constructor(public dialogRef: MatDialogRef<PrefillDescriptionDialogComponent>,
@ -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.dmp; this.dmp = data.plan;
this.dmpSectionId = data.dmpSectionId; this.planSectionId = data.planSectionId;
this.availableDescriptionTemplates = this.dmp.dmpDescriptionTemplates.filter(x => x.sectionId == this.dmpSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate); this.availableDescriptionTemplates = this.dmp.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.dmpSectionId)[0].prefillingSources?.map(x => x.id) || null; const availablePrefillingSourcesIds = this.dmp.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

@ -4,14 +4,14 @@ import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { Description, DescriptionExternalIdentifier, DescriptionField, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionReference, DescriptionReferenceData, DescriptionTag } from '@app/core/model/description/description'; import { Description, DescriptionExternalIdentifier, DescriptionField, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionReference, DescriptionReferenceData, DescriptionTag } from '@app/core/model/description/description';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan'; import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source'; import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
import { Tag } from '@app/core/model/tag/tag'; import { Tag } from '@app/core/model/tag/tag';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { BaseEditorResolver } from '@common/base/base-editor.resolver'; import { BaseEditorResolver } from '@common/base/base-editor.resolver';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
@ -26,7 +26,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
private descriptionService: DescriptionService, private descriptionService: DescriptionService,
private breadcrumbService: BreadcrumbService, private breadcrumbService: BreadcrumbService,
private language: TranslateService, private language: TranslateService,
private dmpService: DmpService private planService: PlanService
) { ) {
super(); super();
} }
@ -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.dmp)), ...DescriptionEditorEntityResolver.dmpLookupFields(nameof<Description>(x => x.plan)),
...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(), ...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(),
] ]
} }
@ -60,9 +60,9 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
[nameof<Description>(x => x.authorizationFlags), AppPermission.FinalizeDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.FinalizeDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.ReviewDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.ReviewDescription].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'), [nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'), [nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'),
@ -117,44 +117,44 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
public static dmpLookupFields(prefix?: string): string[] { public static dmpLookupFields(prefix?: string): string[] {
return [ return [
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.label)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.status)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.status)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.isActive)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.authorizationFlags), AppPermission.EditPlan].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.isActive)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.ordinal)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.maxMultiplicity)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.maxMultiplicity)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.prefillingSources), nameof<PrefillingSource>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.version)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.currentDescriptionTemplate), nameof<DescriptionTemplate>(x => x.version)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.sectionId)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.sectionId)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.name)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.name)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'), (prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
] ]
} }
@ -164,46 +164,46 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
...DescriptionEditorEntityResolver.lookupFields() ...DescriptionEditorEntityResolver.lookupFields()
]; ];
const id = route.paramMap.get('id'); const id = route.paramMap.get('id');
const dmpId = route.paramMap.get('dmpId'); const planId = route.paramMap.get('planId');
const dmpSectionId = route.paramMap.get('dmpSectionId'); const planSectionId = route.paramMap.get('planSectionId');
const copyDmpId = route.paramMap.get('copyDmpId'); const copyPlanId = route.paramMap.get('copyPlanId');
const fieldsetId = route.paramMap.get('fieldsetId'); const fieldsetId = route.paramMap.get('fieldsetId');
if (id != null && copyDmpId == null && dmpSectionId == null) { if (id != null && copyPlanId == null && planSectionId == null) {
if (fieldsetId != null) { if (fieldsetId != null) {
this.breadcrumbService.addExcludedParam(fieldsetId, true); this.breadcrumbService.addExcludedParam(fieldsetId, true);
this.breadcrumbService.addExcludedParam('f', true); this.breadcrumbService.addExcludedParam('f', true);
this.breadcrumbService.addExcludedParam('annotation', true); this.breadcrumbService.addExcludedParam('annotation', true);
} }
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 (dmpId != null && dmpSectionId != null && copyDmpId == null) { } else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorEntityResolver.dmpLookupFields()) return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addExcludedParam(dmpId, true); this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(dmpSectionId, 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(dmp => {
const description: Description = {}; const description: Description = {};
description.dmp = dmp; description.plan = dmp;
description.dmpDescriptionTemplate = { description.planDescriptionTemplate = {
sectionId: Guid.parse(dmpSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;
})); }));
} else if (copyDmpId != null && id != null && dmpSectionId != null) { } else if (copyPlanId != null && id != null && planSectionId != null) {
return this.dmpService.getSingle(Guid.parse(copyDmpId), 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.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
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(copyDmpId, true) this.breadcrumbService.addExcludedParam(copyPlanId, true)
this.breadcrumbService.addExcludedParam(dmpSectionId, true) this.breadcrumbService.addExcludedParam(planSectionId, true)
this.breadcrumbService.addIdResolvedValue(id, x.label) this.breadcrumbService.addIdResolvedValue(id, x.label)
}), takeUntil(this._destroyed), map(description => { }), takeUntil(this._destroyed), map(description => {
description.id = null; description.id = null;
description.hash = null; description.hash = null;
description.status = DescriptionStatus.Draft; description.status = DescriptionStatus.Draft;
description.dmp = dmp; description.plan = dmp;
description.dmpDescriptionTemplate = { description.planDescriptionTemplate = {
id: dmp.dmpDescriptionTemplates.filter(x => x.sectionId == Guid.parse(dmpSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(dmpSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;
})); }));

View File

@ -3,7 +3,7 @@ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { Description, DescriptionSectionPermissionResolver } from '@app/core/model/description/description'; import { Description, DescriptionSectionPermissionResolver } from '@app/core/model/description/description';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { BaseEditorResolver } from '@common/base/base-editor.resolver'; import { BaseEditorResolver } from '@common/base/base-editor.resolver';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
@ -19,7 +19,7 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
private descriptionService: DescriptionService, private descriptionService: DescriptionService,
private breadcrumbService: BreadcrumbService, private breadcrumbService: BreadcrumbService,
private language: TranslateService, private language: TranslateService,
private dmpService: DmpService private planService: PlanService
) { ) {
super(); super();
} }
@ -30,66 +30,66 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
...DescriptionEditorEntityResolver.lookupFields() ...DescriptionEditorEntityResolver.lookupFields()
]; ];
const id = route.paramMap.get('id'); const id = route.paramMap.get('id');
const dmpId = route.paramMap.get('dmpId'); const planId = route.paramMap.get('planId');
const dmpSectionId = route.paramMap.get('dmpSectionId'); const planSectionId = route.paramMap.get('planSectionId');
const copyDmpId = route.paramMap.get('copyDmpId'); const copyPlanId = route.paramMap.get('copyPlanId');
// const cloneid = route.paramMap.get('cloneid'); // const cloneid = route.paramMap.get('cloneid');
if (id != null && copyDmpId == null && dmpSectionId == null) { if (id != null && copyPlanId == null && planSectionId == null) {
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)))
.pipe(mergeMap( description => { .pipe(mergeMap( description => {
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = { const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
dmpId: description.dmp.id, planId: description.plan.id,
sectionIds: [description.dmpDescriptionTemplate.sectionId], sectionIds: [description.planDescriptionTemplate.sectionId],
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription] permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
} }
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed)); return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
})); }));
} else if (dmpId != null && dmpSectionId != null && copyDmpId == null) { } else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorEntityResolver.dmpLookupFields()) return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addExcludedParam(dmpId, true); this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(dmpSectionId, 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(dmp => {
const description: Description = {}; const description: Description = {};
description.dmp = dmp; description.plan = dmp;
description.dmpDescriptionTemplate = { description.planDescriptionTemplate = {
sectionId: Guid.parse(dmpSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;
})) }))
.pipe(mergeMap( description => { .pipe(mergeMap( description => {
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = { const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
dmpId: description.dmp.id, planId: description.plan.id,
sectionIds: [description.dmpDescriptionTemplate.sectionId], sectionIds: [description.planDescriptionTemplate.sectionId],
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription] permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
} }
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed)); return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
})); }));
} else if (copyDmpId != null && id != null && dmpSectionId != null) { } else if (copyPlanId != null && id != null && planSectionId != null) {
return this.dmpService.getSingle(Guid.parse(copyDmpId), 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.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
//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 => {
this.breadcrumbService.addExcludedParam(copyDmpId, true) this.breadcrumbService.addExcludedParam(copyPlanId, true)
this.breadcrumbService.addExcludedParam(dmpSectionId, true) this.breadcrumbService.addExcludedParam(planSectionId, true)
this.breadcrumbService.addIdResolvedValue(id, x.label) this.breadcrumbService.addIdResolvedValue(id, x.label)
}), takeUntil(this._destroyed), map(description => { }), takeUntil(this._destroyed), map(description => {
description.id = null; description.id = null;
description.hash = null; description.hash = null;
description.status = DescriptionStatus.Draft; description.status = DescriptionStatus.Draft;
description.dmp = dmp; description.plan = dmp;
description.dmpDescriptionTemplate = { description.planDescriptionTemplate = {
id: dmp.dmpDescriptionTemplates.filter(x => x.sectionId == Guid.parse(dmpSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(dmpSectionId) sectionId: Guid.parse(planSectionId)
} }
return description; return description;
})); }));
})).pipe(mergeMap( description => { })).pipe(mergeMap( description => {
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = { const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
dmpId: description.dmp.id, planId: description.plan.id,
sectionIds: [description.dmpDescriptionTemplate.sectionId], sectionIds: [description.planDescriptionTemplate.sectionId],
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription] permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
} }
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed)); return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));

View File

@ -27,7 +27,7 @@
</button> </button>
</div> </div>
</div> </div>
<div *ngIf="listingItems && listingItems.length > 0 || lookup.like || lookup.descriptionTemplateSubQuery || lookup.dmpSubQuery || lookup.descriptionTagSubQuery || lookup.descriptionReferenceSubQuery" <div *ngIf="listingItems && listingItems.length > 0 || lookup.like || lookup.descriptionTemplateSubQuery || lookup.planSubQuery || lookup.descriptionTagSubQuery || lookup.descriptionReferenceSubQuery"
class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()"> class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before"> <button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon> <mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
@ -40,7 +40,7 @@
<div class="row pt-4"> <div class="row pt-4">
<!-- Sort by --> <!-- Sort by -->
<div class="col-auto d-flex align-items-center order-1"> <div class="col-auto d-flex align-items-center order-1">
<span class="mb-1 mb-xl-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span> <span class="mb-1 mb-xl-4">{{'PLAN-LISTING.SORT-BY' | translate}}:</span>
</div> </div>
<div class="col-12 col-xl-auto order-3 order-xl-2"> <div class="col-12 col-xl-auto order-3 order-xl-2">
<mat-form-field class="sort-form w-100"> <mat-form-field class="sort-form w-100">

View File

@ -9,9 +9,9 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { BaseDescription, Description } from '@app/core/model/description/description'; import { BaseDescription, Description } from '@app/core/model/description/description';
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan'; import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
import { DmpReference } from '@app/core/model/plan/plan-reference'; import { PlanReference } from '@app/core/model/plan/plan-reference';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
import { DescriptionLookup, ReferencesWithType } from '@app/core/query/description.lookup'; import { DescriptionLookup, ReferencesWithType } from '@app/core/query/description.lookup';
@ -21,7 +21,7 @@ import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
import { StartNewDmpDialogComponent } from '@app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component'; import { StartNewPlanDialogComponent } from '@app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component';
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service'; import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
import { PageLoadEvent, SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component'; import { PageLoadEvent, SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
@ -51,7 +51,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
titlePrefix: String; titlePrefix: String;
dmpId: string; planId: string;
status: Number; status: Number;
totalCount: number; totalCount: number;
dmpSearchEnabled = true; dmpSearchEnabled = true;
@ -71,7 +71,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
scrollbar: boolean; scrollbar: boolean;
order = RecentActivityOrder; order = RecentActivityOrder;
dmpText: string; planText: string;
descriptionText: string; descriptionText: string;
private _sortDirection: SortDirection = SortDirection.Descending; private _sortDirection: SortDirection = SortDirection.Descending;
@ -95,7 +95,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
} }
get hasFilters(): boolean { get hasFilters(): boolean {
return (this.lookup.like != null && this.lookup.like != '') || this.lookup.statuses != null || return (this.lookup.like != null && this.lookup.like != '') || this.lookup.statuses != null ||
this.lookup.dmpSubQuery != null || this.lookup.descriptionTemplateSubQuery != null || this.lookup.planSubQuery != null || this.lookup.descriptionTemplateSubQuery != null ||
this.lookup.descriptionTagSubQuery != null || this.lookup.descriptionReferenceSubQuery != null; this.lookup.descriptionTagSubQuery != null || this.lookup.descriptionReferenceSubQuery != null;
} }
@ -211,7 +211,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
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
@ -244,13 +244,13 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
orderByChanged() { orderByChanged() {
if (this.formGroup.get('order').value == RecentActivityOrder.Status) { if (this.formGroup.get('order').value == RecentActivityOrder.Status) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.status)] }; this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Plan>(x => x.status)] };
} else if (this.formGroup.get('order').value == RecentActivityOrder.Label) { } else if (this.formGroup.get('order').value == RecentActivityOrder.Label) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.label)] }; this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Plan>(x => x.label)] };
} else if (this.formGroup.get('order').value == RecentActivityOrder.PublishedAt) { } else if (this.formGroup.get('order').value == RecentActivityOrder.PublishedAt) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.finalizedAt)] }; this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Plan>(x => x.finalizedAt)] };
}else { }else {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.updatedAt)] }; this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Plan>(x => x.updatedAt)] };
} }
this.filterChanged(this.lookup); this.filterChanged(this.lookup);
} }
@ -296,11 +296,11 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
} }
public setDashboardTourDmpText(): void { public setDashboardTourDmpText(): void {
this.dmpText = this.language.instant('DMP-LISTING.TEXT-INFO') + '\n\n' + this.planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' + this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' + this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
this.language.instant('DMP-LISTING.GET-IDEA'); this.language.instant('PLAN-LISTING.GET-IDEA');
this.dashboardTour.steps[0].title = this.dmpText; this.dashboardTour.steps[0].title = this.planText;
} }
public setDashboardTourDescriptionText(): void { public setDashboardTourDescriptionText(): void {
@ -310,12 +310,12 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
this.dashboardTour.steps[1].title = this.descriptionText; this.dashboardTour.steps[1].title = this.descriptionText;
} }
openNewDmpDialog() { openNewPlanDialog() {
if (this.dialog.openDialogs.length > 0) { if (this.dialog.openDialogs.length > 0) {
this.dialog.closeAll(); this.dialog.closeAll();
} }
else { else {
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, { const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
disableClose: false, disableClose: false,
data: { data: {
isDialog: true isDialog: true
@ -326,23 +326,23 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
addNewDescription() { addNewDescription() {
const formGroup = this.fb.group({ const formGroup = this.fb.group({
dmpId: this.fb.control(null, Validators.required), planId: this.fb.control(null, Validators.required),
}) })
const dialogRef = this.dialog.open(StartNewDescriptionDialogComponent, { const dialogRef = this.dialog.open(StartNewDescriptionDialogComponent, {
disableClose: false, disableClose: false,
restoreFocus: false, restoreFocus: false,
data: { data: {
startNewDmp: false, startNewPlan: false,
formGroup: formGroup, formGroup: formGroup,
} }
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) { if (result) {
if (result.startNewDmp) { if (result.startNewPlan) {
this.openNewDmpDialog(); this.openNewPlanDialog();
} else { } else {
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', result.formGroup.get('dmpId').value])]); this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', result.formGroup.get('planId').value])]);
} }
} }
}); });
@ -395,15 +395,15 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
let dmps = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = dmps && dmps?.length > 0; let dmps = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = dmps && dmps?.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.dmpSubQuery = DescriptionFilterService.initializeDmpLookup(); lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
if (addDmps) lookup.dmpSubQuery.ids = dmps?.length > 0 ? dmps : null; if (addDmps) lookup.planSubQuery.ids = dmps?.length > 0 ? dmps : null;
if (addRoles) { if (addRoles) {
lookup.dmpSubQuery.dmpUserSubQuery = DescriptionFilterService.initializeDmpUserLookup(); lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
lookup.dmpSubQuery.dmpUserSubQuery.userRoles = roles; lookup.planSubQuery.planUserSubQuery.userRoles = roles;
} }
} else lookup.dmpSubQuery = null; } else lookup.planSubQuery = null;
// Tags // Tags
let tags = formGroup.get("tags")?.value ?? null; let tags = formGroup.get("tags")?.value ?? null;
@ -432,9 +432,9 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
_buildFormFromLookup(lookup: DescriptionLookup, referenceFilters: ReferencesWithType[]): UntypedFormGroup { _buildFormFromLookup(lookup: DescriptionLookup, referenceFilters: ReferencesWithType[]): UntypedFormGroup {
return (new UntypedFormBuilder()).group({ return (new UntypedFormBuilder()).group({
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null], status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
role: lookup.dmpSubQuery?.dmpUserSubQuery?.userRoles ? lookup.dmpSubQuery?.dmpUserSubQuery?.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.dmpSubQuery?.ids ? [lookup.dmpSubQuery?.ids] : [], associatedDmpIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [],
tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [], tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [],
}); });
} }
@ -445,9 +445,9 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
if (lookup.statuses) count += lookup.statuses.length; if (lookup.statuses) count += lookup.statuses.length;
if (lookup.descriptionTemplateSubQuery) count += lookup.descriptionTemplateSubQuery.ids?.length; if (lookup.descriptionTemplateSubQuery) count += lookup.descriptionTemplateSubQuery.ids?.length;
if (lookup.descriptionTagSubQuery) count += lookup.descriptionTagSubQuery.tagIds?.length; if (lookup.descriptionTagSubQuery) count += lookup.descriptionTagSubQuery.tagIds?.length;
if (lookup.dmpSubQuery) { if (lookup.planSubQuery) {
if (lookup.dmpSubQuery.ids) count += lookup.dmpSubQuery.ids?.length; if (lookup.planSubQuery.ids) count += lookup.planSubQuery.ids?.length;
if (lookup.dmpSubQuery.dmpUserSubQuery) count += lookup.dmpSubQuery.dmpUserSubQuery.userRoles?.length; if (lookup.planSubQuery.planUserSubQuery) count += lookup.planSubQuery.planUserSubQuery.userRoles?.length;
} }
if (lookup.descriptionReferenceSubQuery) count += lookup.descriptionReferenceSubQuery.referenceIds?.length; if (lookup.descriptionReferenceSubQuery) count += lookup.descriptionReferenceSubQuery.referenceIds?.length;
@ -465,35 +465,35 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
[nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.finalizedAt)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.finalizedAt)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
]; ];
} }
} }

View File

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

View File

@ -34,9 +34,9 @@
<!-- Related DMP Filters --> <!-- Related DMP Filters -->
<div class="col-10"> <div class="col-10">
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-DMPS.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-DMPS.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('associatedDmpIds')" [configuration]="dmpAutoCompleteConfiguration"></app-multiple-auto-complete>
</mat-form-field> </mat-form-field>
<hr> <hr>

View File

@ -2,14 +2,14 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { AbstractControl, FormBuilder, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { AbstractControl, FormBuilder, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
import { ReferencesWithType } from '@app/core/query/description.lookup'; import { ReferencesWithType } from '@app/core/query/description.lookup';
import { ReferenceLookup } from '@app/core/query/reference.lookup'; import { ReferenceLookup } from '@app/core/query/reference.lookup';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service'; import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
import { ReferenceService } from '@app/core/services/reference/reference.service'; import { ReferenceService } from '@app/core/services/reference/reference.service';
import { TagService } from '@app/core/services/tag/tag.service'; import { TagService } from '@app/core/services/tag/tag.service';
@ -41,7 +41,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
public filteringTagsAsync = false; public filteringTagsAsync = false;
statuses = DescriptionStatus; statuses = DescriptionStatus;
dmpRole = DmpUserRole; dmpRole = PlanUserRole;
options: UntypedFormGroup; options: UntypedFormGroup;
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
@ -54,7 +54,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
public enumUtils: EnumUtils, public enumUtils: EnumUtils,
private authentication: AuthService, private authentication: AuthService,
private descriptionTemplateService: DescriptionTemplateService, private descriptionTemplateService: DescriptionTemplateService,
private dmpService: DmpService, private planService: PlanService,
private tagService: TagService, private tagService: TagService,
private referenceService: ReferenceService, private referenceService: ReferenceService,
private referenceTypeService: ReferenceTypeService, private referenceTypeService: ReferenceTypeService,
@ -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.dmpService.multipleAutocompleteConfiguration; this.dmpAutoCompleteConfiguration = 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

@ -1,12 +1,12 @@
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
import { DescriptionTemplate } from "@app/core/model/description-template/description-template"; import { DescriptionTemplate } from "@app/core/model/description-template/description-template";
import { Description, DescriptionReference, DescriptionTag } from "@app/core/model/description/description"; import { Description, DescriptionReference, DescriptionTag } from "@app/core/model/description/description";
import { Dmp, DmpUser } from "@app/core/model/plan/plan"; import { Plan, PlanUser } from "@app/core/model/plan/plan";
import { Reference } from "@app/core/model/reference/reference"; import { Reference } from "@app/core/model/reference/reference";
import { Tag } from "@app/core/model/tag/tag"; import { Tag } from "@app/core/model/tag/tag";
import { DescriptionTemplateLookup } from "@app/core/query/description-template.lookup"; import { DescriptionTemplateLookup } from "@app/core/query/description-template.lookup";
import { DmpUserLookup } from "@app/core/query/plan-user.lookup"; import { PlanUserLookup } from "@app/core/query/plan-user.lookup";
import { DmpLookup } from "@app/core/query/plan.lookup"; import { PlanLookup } from "@app/core/query/plan.lookup";
import { DescriptionReferenceLookup } from "@app/core/query/reference.lookup"; import { DescriptionReferenceLookup } from "@app/core/query/reference.lookup";
import { DescriptionTagLookup } from "@app/core/query/tag.lookup"; import { DescriptionTagLookup } from "@app/core/query/tag.lookup";
import { IsActive } from "@notification-service/core/enum/is-active.enum"; import { IsActive } from "@notification-service/core/enum/is-active.enum";
@ -41,26 +41,26 @@ export class DescriptionFilterService {
return lookup; return lookup;
} }
public static initializeDmpLookup(): DmpLookup { public static initializePlanLookup(): PlanLookup {
const lookup = new DmpLookup(); const lookup = new PlanLookup();
lookup.metadata = { countAll: true }; lookup.metadata = { countAll: true };
lookup.isActive = [IsActive.Active]; lookup.isActive = [IsActive.Active];
lookup.project = { lookup.project = {
fields: [ fields: [
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
] ]
}; };
return lookup; return lookup;
} }
public static initializeDmpUserLookup(): DmpUserLookup { public static initializePlanUserLookup(): PlanUserLookup {
const lookup = new DmpUserLookup(); const lookup = new PlanUserLookup();
lookup.metadata = { countAll: true }; lookup.metadata = { countAll: true };
lookup.isActive = [IsActive.Active]; lookup.isActive = [IsActive.Active];
lookup.project = { lookup.project = {
fields: [ fields: [
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
] ]
}; };

View File

@ -3,29 +3,29 @@
<div class="d-flex flex-direction-row"> <div class="d-flex flex-direction-row">
<div class="col-auto description-label">{{'DESCRIPTION-LISTING.DESCRIPTION' | translate}}</div> <div class="col-auto description-label">{{'DESCRIPTION-LISTING.DESCRIPTION' | translate}}</div>
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeFormatter: "d MMMM y"}}</div> <div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeFormatter: "d MMMM y"}}</div>
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.dmp?.finalizedAt | dateTimeFormatter: "d MMMM y"}}</div> <div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.plan?.finalizedAt | dateTimeFormatter: "d MMMM y"}}</div>
</div> </div>
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div> <div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
<div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div> <div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
<div class="description-subtitle"> <div class="description-subtitle">
<span *ngIf="isUserDMPRelated()" class="col-auto">{{ enumUtils.toDmpUserRolesString(dmpService.getCurrentUserRolesInDmp(description?.dmp?.dmpUsers)) }}</span> <span *ngIf="isUserDMPRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</span>
<span *ngIf="isUserDMPRelated()">.</span> <span *ngIf="isUserDMPRelated()">.</span>
<span class="col-auto" *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType === dmpAccessTypeEnum.Public"><span class="material-icons icon-align">public</span>{{'DESCRIPTION-LISTING.STATES.PUBLIC' | translate}}</span> <span class="col-auto" *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType === planAccessTypeEnum.Public"><span class="material-icons icon-align">public</span>{{'DESCRIPTION-LISTING.STATES.PUBLIC' | translate}}</span>
<span *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType != dmpAccessTypeEnum.Public" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span> <span *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType != planAccessTypeEnum.Public" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
<span *ngIf="description.status === descriptionStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span> <span *ngIf="description.status === descriptionStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
<span>.</span> <span>.</span>
<span class="col">{{'DESCRIPTION-LISTING.GRANT' | translate}}: {{referenceService.getReferencesForTypesFirstSafe(description?.dmp?.dmpReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span> <span class="col">{{'DESCRIPTION-LISTING.GRANT' | translate}}: {{referenceService.getReferencesForTypesFirstSafe(description?.plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
</div> </div>
<div class="d-flex flex-direction-row pt-3 pb-3"> <div class="d-flex flex-direction-row pt-3 pb-3">
<div class="col-auto description-subtitle pr-0">{{'DESCRIPTION-LISTING.PART-OF' | translate}} <div class="col-auto description-subtitle pr-0">{{'DESCRIPTION-LISTING.PART-OF' | translate}}
<div class="col-auto dmp-label ml-3">{{'DESCRIPTION-LISTING.DMP' | translate}}</div> <div class="col-auto dmp-label ml-3">{{'DESCRIPTION-LISTING.PLAN' | translate}}</div>
</div> </div>
<div class="col dmp-title">{{description.dmp?.label}}</div> <div class="col dmp-title">{{description.plan?.label}}</div>
</div> </div>
</a> </a>
<div class="description-card-actions"> <div class="description-card-actions">
<a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a> <a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a> <a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a> <a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a> <a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
</div> </div>

View File

@ -3,12 +3,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { UntypedFormBuilder, Validators } from '@angular/forms'; import { UntypedFormBuilder, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { DmpAccessType } from '@app/core/common/enum/plan-access-type'; import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { Description } from '@app/core/model/description/description'; import { Description } from '@app/core/model/description/description';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service'; import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
import { LockService } from '@app/core/services/lock/lock.service'; import { LockService } from '@app/core/services/lock/lock.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
@ -47,10 +47,10 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
isUserOwner: boolean; isUserOwner: boolean;
descriptionStatusEnum = DescriptionStatus; descriptionStatusEnum = DescriptionStatus;
fileTransformerEntityTypeEnum = FileTransformerEntityType; fileTransformerEntityTypeEnum = FileTransformerEntityType;
dmpAccessTypeEnum = DmpAccessType; planAccessTypeEnum = PlanAccessType;
canDelete: boolean = false; canDelete: boolean = false;
canEdit: boolean = false; canEdit: boolean = false;
canInviteDmpUsers: boolean = false; canInvitePlanUsers: boolean = false;
constructor( constructor(
@ -65,7 +65,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
private lockService: LockService, private lockService: LockService,
private location: Location, private location: Location,
private fileUtils: FileUtils, private fileUtils: FileUtils,
public dmpService: DmpService, public planService: PlanService,
public referenceService: ReferenceService, public referenceService: ReferenceService,
public referenceTypeService: ReferenceTypeService, public referenceTypeService: ReferenceTypeService,
public fileTransformerService: FileTransformerService, public fileTransformerService: FileTransformerService,
@ -96,8 +96,8 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
this.canEdit = (this.authService.hasPermission(AppPermission.EditDescription) || this.canEdit = (this.authService.hasPermission(AppPermission.EditDescription) ||
this.description.authorizationFlags?.some(x => x === AppPermission.EditDescription)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.EditDescription)) && this.description.belongsToCurrentTenant != false;
this.canInviteDmpUsers = (this.authService.hasPermission(AppPermission.InviteDmpUsers) || this.canInvitePlanUsers = (this.authService.hasPermission(AppPermission.InvitePlanUsers) ||
this.description.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false;
} }
@ -111,7 +111,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
isUserDMPRelated() { isUserDMPRelated() {
const principalId: Guid = this.authService.userId(); const principalId: Guid = this.authService.userId();
return this.description.dmp.dmpUsers?.some(x => (x.user.id === principalId)); return this.description.plan.planUsers?.some(x => (x.user.id === principalId));
} }
public isAuthenticated(): boolean { public isAuthenticated(): boolean {
@ -123,7 +123,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
} }
getDmpLink(): string[] { getDmpLink(): string[] {
return this.isPublic ? [`/explore-plans/overview/public/${this.description.dmp.id}`] : [`/plans/edit/${this.description.dmp.id}`]; return this.isPublic ? [`/explore-plans/overview/public/${this.description.plan.id}`] : [`/plans/edit/${this.description.plan.id}`];
} }
openShareDialog() { openShareDialog() {
@ -134,16 +134,16 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
autoFocus: false, autoFocus: false,
restoreFocus: false, restoreFocus: false,
data: { data: {
dmpId: this.description.dmp.id, planId: this.description.plan.id,
dmpName: this.description.dmp.label, dmpName: this.description.plan.label,
blueprint: this.description.dmp.blueprint blueprint: this.description.plan.blueprint
} }
}); });
} }
copyToDmp(description: Description) { copyToDmp(description: Description) {
const formGroup = this.fb.group({ const formGroup = this.fb.group({
dmpId: this.fb.control(null, Validators.required), planId: this.fb.control(null, Validators.required),
sectionId: this.fb.control(null, Validators.required), sectionId: this.fb.control(null, Validators.required),
}) })
const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, { const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, {
@ -162,7 +162,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)) dialogRef.afterClosed().pipe(takeUntil(this._destroyed))
.subscribe(formGroup => { .subscribe(formGroup => {
if (formGroup) { if (formGroup) {
this.router.navigate([this.routerUtils.generateUrl(['descriptions/edit/copy', description.id.toString(), formGroup.get('dmpId').value, formGroup.get('sectionId').value], '/')]); this.router.navigate([this.routerUtils.generateUrl(['descriptions/edit/copy', description.id.toString(), formGroup.get('planId').value, formGroup.get('sectionId').value], '/')]);
} }
}); });
} }

View File

@ -20,14 +20,14 @@
</div> </div>
<div class="row d-flex align-items-center mt-3 mb-4 label-txt"> <div class="row d-flex align-items-center mt-3 mb-4 label-txt">
<div *ngIf="!isPublicView" class="col-auto d-flex"> <div *ngIf="!isPublicView" class="col-auto d-flex">
<p class="ml-0 mb-0 label2-txt">{{ enumUtils.toDmpUserRolesString(dmpService.getCurrentUserRolesInDmp(description?.dmp?.dmpUsers)) }}</p> <p class="ml-0 mb-0 label2-txt">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</p>
</div> </div>
<div *ngIf="canEdit" class="col-auto"><span>.</span></div> <div *ngIf="canEdit" class="col-auto"><span>.</span></div>
<div *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType === dmpAccessTypeEnum.Public" class="col-auto d-flex"> <div *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType === planAccessTypeEnum.Public" class="col-auto d-flex">
<mat-icon class="status-icon">public</mat-icon> <mat-icon class="status-icon">public</mat-icon>
{{'DESCRIPTION-OVERVIEW.PUBLIC' | translate}} {{'DESCRIPTION-OVERVIEW.PUBLIC' | translate}}
</div> </div>
<div *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType === dmpAccessTypeEnum.Public" class="col-auto d-flex"><span>.</span></div> <div *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType === planAccessTypeEnum.Public" class="col-auto d-flex"><span>.</span></div>
<div *ngIf="isLocked" class="col-auto d-flex flex-row"> <div *ngIf="isLocked" class="col-auto d-flex flex-row">
<mat-icon class="status-icon">lock_outline</mat-icon> <mat-icon class="status-icon">lock_outline</mat-icon>
{{'DESCRIPTION-OVERVIEW.LOCKED' | translate}} {{'DESCRIPTION-OVERVIEW.LOCKED' | translate}}
@ -72,9 +72,9 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 col-lg-7"> <div class="col-12 col-lg-7">
<button class="w-100 dmp-btn p-1" (click)="dmpClicked(description.dmp)"> <button class="w-100 dmp-btn p-1" (click)="dmpClicked(description.plan)">
<div class="dmp-btn-label"> <div class="dmp-btn-label">
{{ this.description.dmp.label }} {{ this.description.plan.label }}
</div> </div>
<div class="w-auto"> <div class="w-auto">
<mat-icon>launch</mat-icon> <mat-icon>launch</mat-icon>
@ -82,29 +82,29 @@
</button> </button>
</div> </div>
</div> </div>
<ng-container *ngIf="referenceService.hasRerefenceOfTypes(description?.dmp?.dmpReferences, [this.referenceTypeService.getGrantReferenceType()])"> <ng-container *ngIf="referenceService.hasRerefenceOfTypes(description?.plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])">
<div class="row header"> <div class="row header">
<div class="col-auto">{{'DESCRIPTION-OVERVIEW.GRANT' | translate}}</div> <div class="col-auto">{{'DESCRIPTION-OVERVIEW.GRANT' | translate}}</div>
</div> </div>
<div class="row description-label"> <div class="row description-label">
<div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(description?.dmp?.dmpReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div> <div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(description?.plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div>
</div> </div>
</ng-container> </ng-container>
<div class="row header"> <div class="row header">
<div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div> <div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12" *ngFor="let dmpReference of researchers let last = last"> <div class="col-12" *ngFor="let planReference of researchers let last = last">
<span *ngIf="isOrcid(dmpReference.reference)"> <span *ngIf="isOrcid(planReference.reference)">
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher align-items-center"> <a href="{{ getOrcidPathForResearcher(planReference.reference?.reference) }}" target="blank" class="researcher align-items-center">
<div class="id-btn" [matTooltip]="unauthorizedTootipText">&nbsp;</div> <div class="id-btn" [matTooltip]="unauthorizedTootipText">&nbsp;</div>
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div> <div *ngIf="!last">{{ planReference.reference?.label }}, </div>
<div *ngIf="last">{{ dmpReference.reference?.label }}</div> <div *ngIf="last">{{ planReference.reference?.label }}</div>
</a> </a>
</span> </span>
<span *ngIf="!isOrcid(dmpReference.reference)"> <span *ngIf="!isOrcid(planReference.reference)">
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div> <div *ngIf="!last">{{ planReference.reference?.label }}, </div>
<div *ngIf="last">{{ dmpReference.reference?.label }}</div> <div *ngIf="last">{{ planReference.reference?.label }}</div>
</span> </span>
</div> </div>
</div> </div>
@ -190,15 +190,15 @@
<p class="header">{{ 'DESCRIPTION-OVERVIEW.DESCRIPTION-AUTHORS' | translate }}</p> <p class="header">{{ 'DESCRIPTION-OVERVIEW.DESCRIPTION-AUTHORS' | translate }}</p>
</div> </div>
<div class="col-12"> <div class="col-12">
<div *ngFor="let dmpUser of description.dmp?.dmpUsers; let i=index" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(dmpUser.user?.id, i)}" (mouseover)="focusOnAuthor(dmpUser.user?.id, i)" (mouseout)="resetAuthorFocus()"> <div *ngFor="let planUser of description.plan?.planUsers; let i=index" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(planUser.user?.id, i)}" (mouseover)="focusOnAuthor(planUser.user?.id, i)" (mouseout)="resetAuthorFocus()">
<div class="col-auto d-flex flex-row pr-0"> <div class="col-auto d-flex flex-row pr-0">
<button class="account_btn mr-3 pl-0"> <button class="account_btn mr-3 pl-0">
<mat-icon class="account-icon" [ngClass]="{'author-icon-focused': authorFocus && authorFocus == dmpUser.user?.id}">account_circle</mat-icon> <mat-icon class="account-icon" [ngClass]="{'author-icon-focused': authorFocus && authorFocus == planUser.user?.id}">account_circle</mat-icon>
</button> </button>
</div> </div>
<div class="col pl-0" style="min-width: 0;"> <div class="col pl-0" style="min-width: 0;">
<ng-container *ngIf="!isUserAuthor(dmpUser.user?.id); else you"> <ng-container *ngIf="!isUserAuthor(planUser.user?.id); else you">
<p class="authors-label">{{ dmpUser.user?.name }}</p> <p class="authors-label">{{ planUser.user?.name }}</p>
</ng-container> </ng-container>
<ng-template #you> <ng-template #you>
<p *ngIf="userName" class="authors-label">{{ userName }} <p *ngIf="userName" class="authors-label">{{ userName }}
@ -207,19 +207,19 @@
</ng-template> </ng-template>
<p class="authors-role"> <p class="authors-role">
<span>{{ enumUtils.toDmpUserRoleString(dmpUser.role) }} - </span> <span>{{ enumUtils.toPlanUserRoleString(planUser.role) }} - </span>
<span *ngIf="!dmpUser.sectionId">{{ 'DESCRIPTION-OVERVIEW.ROLES.ALL-SECTIONS' | translate}}</span> <span *ngIf="!planUser.sectionId">{{ 'DESCRIPTION-OVERVIEW.ROLES.ALL-SECTIONS' | translate}}</span>
<span *ngIf="dmpUser.sectionId">{{ getSectionNameById(dmpUser.sectionId) }}</span> <span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
</p> </p>
</div> </div>
<div class="col-auto" *ngIf="canInviteDmpUsers && description.dmp?.status === dmpStatusEnum.Draft && dmpUser.role != dmpUserRoleEnum.Owner"> <div class="col-auto" *ngIf="canInvitePlanUsers && description.plan?.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner">
<button (click)="removeUserFromDmp(dmpUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above"> <button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon> <mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button> </button>
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="canInviteDmpUsers" class="col-12 d-flex justify-content-center mt-2"> <div *ngIf="canInvitePlanUsers" class="col-12 d-flex justify-content-center mt-2">
<button mat-raised-button class="invite-btn" (click)="openShareDialog()"> <button mat-raised-button class="invite-btn" (click)="openShareDialog()">
<mat-icon>group_add</mat-icon> <mat-icon>group_add</mat-icon>
{{'DESCRIPTION-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}} {{'DESCRIPTION-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}

View File

@ -4,24 +4,24 @@ import { UntypedFormBuilder, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router'; import { ActivatedRoute, Params, Router } from '@angular/router';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { DmpAccessType } from '@app/core/common/enum/plan-access-type'; import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type'; import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { Description, DescriptionStatusPersist } from '@app/core/model/description/description'; import { Description, DescriptionStatusPersist } from '@app/core/model/description/description';
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { Dmp, DmpDescriptionTemplate, DmpUser, DmpUserRemovePersist } from '@app/core/model/plan/plan'; import { Plan, PlanDescriptionTemplate, PlanUser, PlanUserRemovePersist } from '@app/core/model/plan/plan';
import { DmpReference } from '@app/core/model/plan/plan-reference'; import { PlanReference } from '@app/core/model/plan/plan-reference';
import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { ReferenceType } from '@app/core/model/reference-type/reference-type';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
import { User } from '@app/core/model/user/user'; import { User } from '@app/core/model/user/user';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service'; import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
import { LockService } from '@app/core/services/lock/lock.service'; import { LockService } from '@app/core/services/lock/lock.service';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
@ -54,7 +54,7 @@ import { RouterUtilsService } from '@app/core/services/router/router-utils.servi
export class DescriptionOverviewComponent extends BaseComponent implements OnInit { export class DescriptionOverviewComponent extends BaseComponent implements OnInit {
description: any; description: any;
researchers: DmpReference[] = []; researchers: PlanReference[] = [];
isNew = true; isNew = true;
isFinalized = false; isFinalized = false;
isPublicView = true; isPublicView = true;
@ -62,16 +62,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
expand = false; expand = false;
isLocked: Boolean; isLocked: Boolean;
descriptionStatusEnum = DescriptionStatus; descriptionStatusEnum = DescriptionStatus;
dmpAccessTypeEnum = DmpAccessType; planAccessTypeEnum = PlanAccessType;
dmpStatusEnum = DmpStatus; planStatusEnum = PlanStatus;
dmpUserRoleEnum = DmpUserRole; planUserRoleEnum = PlanUserRole;
fileTransformerEntityTypeEnum = FileTransformerEntityType; fileTransformerEntityTypeEnum = FileTransformerEntityType;
canEdit = false; canEdit = false;
canDelete = false; canDelete = false;
canFinalize = false; canFinalize = false;
canReview = false; canReview = false;
canInviteDmpUsers = false; canInvitePlanUsers = false;
authorFocus: string; authorFocus: string;
userName: string; userName: string;
@ -86,7 +86,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
private language: TranslateService, private language: TranslateService,
private uiNotificationService: UiNotificationService, private uiNotificationService: UiNotificationService,
private configurationService: ConfigurationService, private configurationService: ConfigurationService,
private dmpService: DmpService, private planService: PlanService,
public referenceService: ReferenceService, public referenceService: ReferenceService,
private location: Location, private location: Location,
public enumUtils: EnumUtils, public enumUtils: EnumUtils,
@ -110,7 +110,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
this.canDelete = false; this.canDelete = false;
this.canEdit = false; this.canEdit = false;
this.canFinalize = false; this.canFinalize = false;
this.canInviteDmpUsers = false; this.canInvitePlanUsers = false;
// Gets description data using parameter id // Gets description data using parameter id
this.route.params this.route.params
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
@ -126,9 +126,9 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label); this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
this.description = data; this.description = data;
this.description.dmp.dmpUsers = data.dmp.dmpUsers.filter(x => x.isActive === IsActive.Active); this.description.plan.planUsers = data.plan.planUsers.filter(x => x.isActive === IsActive.Active);
this.researchers = this.referenceService.getReferencesForTypes(this.description?.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]); this.researchers = this.referenceService.getReferencesForTypes(this.description?.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
// this.users = this.description.dmp.users; // this.users = this.description.plan.users;
this.checkLockStatus(this.description.id); this.checkLockStatus(this.description.id);
this.canDelete = (this.authService.hasPermission(AppPermission.DeleteDescription) || this.canDelete = (this.authService.hasPermission(AppPermission.DeleteDescription) ||
this.description.authorizationFlags?.some(x => x === AppPermission.DeleteDescription)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.DeleteDescription)) && this.description.belongsToCurrentTenant != false;
@ -142,8 +142,8 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
this.canFinalize = (this.authService.hasPermission(AppPermission.FinalizeDescription) || this.canFinalize = (this.authService.hasPermission(AppPermission.FinalizeDescription) ||
this.description.authorizationFlags?.some(x => x === AppPermission.FinalizeDescription)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.FinalizeDescription)) && this.description.belongsToCurrentTenant != false;
this.canInviteDmpUsers = (this.authService.hasPermission(AppPermission.InviteDmpUsers) || this.canInvitePlanUsers = (this.authService.hasPermission(AppPermission.InvitePlanUsers) ||
this.description.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false;
// const breadCrumbs = []; // const breadCrumbs = [];
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DESCRIPTION-DESCRIPTIONS'), url: "/descriptions" }); // breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DESCRIPTION-DESCRIPTIONS'), url: "/descriptions" });
// breadCrumbs.push({ parentComponentName: 'DescriptionListingComponent', label: this.description.label, url: '/descriptions/overview/' + this.description.id }); // breadCrumbs.push({ parentComponentName: 'DescriptionListingComponent', label: this.description.label, url: '/descriptions/overview/' + this.description.id });
@ -171,8 +171,8 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label); this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
this.description = data; this.description = data;
this.researchers = this.referenceService.getReferencesForTypes(this.description?.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]); this.researchers = this.referenceService.getReferencesForTypes(this.description?.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
// this.users = this.description.dmp.users; // this.users = this.description.plan.users;
// const breadCrumbs = []; // const breadCrumbs = [];
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC DESCRIPTIONS'), url: "/explore" }); // breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC DESCRIPTIONS'), url: "/explore" });
// breadCrumbs.push({ parentComponentName: 'DescriptionListingComponent', label: this.description.label, url: '/descriptions/overview/public/' + this.description.id }); // breadCrumbs.push({ parentComponentName: 'DescriptionListingComponent', label: this.description.label, url: '/descriptions/overview/public/' + this.description.id });
@ -265,9 +265,9 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
autoFocus: false, autoFocus: false,
restoreFocus: false, restoreFocus: false,
data: { data: {
dmpId: this.description.dmp.id, planId: this.description.plan.id,
dmpName: this.description.dmp.label, dmpName: this.description.plan.label,
blueprint: this.description.dmp.blueprint blueprint: this.description.plan.blueprint
} }
}); });
} }
@ -308,7 +308,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
}); });
} }
dmpClicked(dmp: Dmp) { dmpClicked(dmp: 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/', dmp.id.toString()])]);
} else { } else {
@ -355,14 +355,14 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
getSectionNameById(sectionId: Guid): string { getSectionNameById(sectionId: Guid): string {
if (sectionId == null) return ''; if (sectionId == null) return '';
let sections: DmpBlueprintDefinitionSection[] = this.description?.dmp?.blueprint?.definition?.sections?.filter((section: DmpBlueprintDefinitionSection) => sectionId === section.id); let sections: PlanBlueprintDefinitionSection[] = this.description?.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
return sections == null ? '' : sections[0].label; return sections == null ? '' : sections[0].label;
} }
openCopyToDmpDialog() { openCopyToDmpDialog() {
const formGroup = this.fb.group({ const formGroup = this.fb.group({
dmpId: this.fb.control(null, Validators.required), planId: this.fb.control(null, Validators.required),
sectionId: this.fb.control(null, Validators.required), sectionId: this.fb.control(null, Validators.required),
}) })
const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, { const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, {
@ -372,7 +372,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
formGroup: formGroup, formGroup: formGroup,
descriptionId: this.description.id, descriptionId: this.description.id,
descriptionTemplate: this.description.descriptionTemplate, descriptionTemplate: this.description.descriptionTemplate,
dmpDescriptionTemplate: this.description.dmpDescriptionTemplate, planDescriptionTemplate: this.description.planDescriptionTemplate,
descriptionProfileExist: false, descriptionProfileExist: false,
confirmButton: this.language.instant('DESCRIPTION-OVERVIEW.COPY-DIALOG.COPY'), confirmButton: this.language.instant('DESCRIPTION-OVERVIEW.COPY-DIALOG.COPY'),
cancelButton: this.language.instant('DESCRIPTION-OVERVIEW.COPY-DIALOG.CANCEL') cancelButton: this.language.instant('DESCRIPTION-OVERVIEW.COPY-DIALOG.CANCEL')
@ -382,12 +382,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)) dialogRef.afterClosed().pipe(takeUntil(this._destroyed))
.subscribe(formGroup => { .subscribe(formGroup => {
if (formGroup) { if (formGroup) {
this.router.navigate([this.routerUtils.generateUrl(['descriptions/edit/copy', this.description.id, formGroup.get('dmpId').value, formGroup.get('sectionId').value], '/')]); this.router.navigate([this.routerUtils.generateUrl(['descriptions/edit/copy', this.description.id, formGroup.get('planId').value, formGroup.get('sectionId').value], '/')]);
} }
}); });
} }
removeUserFromDmp(dmpUser: DmpUser) { removeUserFromDmp(dmpUser: PlanUser) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, { const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'), message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
@ -398,12 +398,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (result) { if (result) {
const dmpUserRemovePersist: DmpUserRemovePersist = { const dmpUserRemovePersist: PlanUserRemovePersist = {
id: dmpUser.id, id: dmpUser.id,
dmpId: this.description.dmp.id, planId: this.description.plan.id,
role: dmpUser.role role: dmpUser.role
}; };
this.dmpService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
.subscribe(data => { .subscribe(data => {
this.reloadPage(); this.reloadPage();
}, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error)); }, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error));
@ -450,7 +450,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
} }
hasReversableStatus(description: Description): boolean { hasReversableStatus(description: Description): boolean {
return description.dmp.status == DmpStatus.Draft && description.status == DescriptionStatus.Finalized && this.canFinalize return description.plan.status == PlanStatus.Draft && description.status == DescriptionStatus.Finalized && this.canFinalize
} }
reverseFinalization(description: Description) { reverseFinalization(description: Description) {
@ -494,38 +494,38 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
[nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.FinalizeDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.FinalizeDescription].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
[nameof<Description>(x => x.authorizationFlags), AppPermission.ReviewDescription].join('.'), [nameof<Description>(x => x.authorizationFlags), AppPermission.ReviewDescription].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'), [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'), [nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.sectionId)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.sectionId)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.name)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.name)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.source)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.source)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'), [nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
] ]
} }

View File

@ -1,7 +1,7 @@
<div class="form-container"> <div class="form-container">
<div mat-dialog-title class="row d-flex p-0 mb-4"> <div mat-dialog-title class="row d-flex p-0 mb-4">
<div class="col p-0"> <div class="col p-0">
<span class="title">{{'DASHBOARD.SELECT-DMP' | translate}}</span> <span class="title">{{'DASHBOARD.SELECT-PLAN' | translate}}</span>
</div> </div>
<div class="col-auto p-0"> <div class="col-auto p-0">
<mat-icon class="close-icon" (click)="close()">close</mat-icon> <mat-icon class="close-icon" (click)="close()">close</mat-icon>
@ -10,13 +10,13 @@
<div class="row mt-2 mb-4"> <div class="row mt-2 mb-4">
<div class="col-12"> <div class="col-12">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<app-single-auto-complete [required]="true" [formControl]="formGroup.get('dmpId')" placeholder="{{'START-NEW-DESCRIPTION-DIALOG.SELECT-DMP' | translate}}" [configuration]="dmpAutoCompleteConfiguration"></app-single-auto-complete> <app-single-auto-complete [required]="true" [formControl]="formGroup.get('planId')" placeholder="{{'START-NEW-DESCRIPTION-DIALOG.SELECT-PLAN' | translate}}" [configuration]="planAutoCompleteConfiguration"></app-single-auto-complete>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div class="row mt-2"> <div class="row mt-2">
<div class="col-auto pb-4"> <div class="col-auto pb-4">
<span>{{'DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS-NOT-ENOUGH' | translate}}</span>&nbsp;<span class="new-dmp" (click)="startNewDmp()">{{'DASHBOARD.ADD-NEW-DESCRIPTION.START-NEW-DMP' | translate}}</span> <span>{{'DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS-NOT-ENOUGH' | translate}}</span>&nbsp;<span class="new-dmp" (click)="startNewPlan()">{{'DASHBOARD.ADD-NEW-DESCRIPTION.START-NEW-PLAN' | translate}}</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View File

@ -1,14 +1,14 @@
import { Component, Inject } from '@angular/core'; import { Component, Inject } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
import { DmpStatus } from '@app/core/common/enum/plan-status'; import { PlanStatus } from '@app/core/common/enum/plan-status';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
import { Dmp } from '@app/core/model/plan/plan'; import { Plan } from '@app/core/model/plan/plan';
import { DateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe'; import { DateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
import { DmpDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup'; import { PlanDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
import { DmpLookup } from '@app/core/query/plan.lookup'; import { PlanLookup } from '@app/core/query/plan.lookup';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.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 { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
import { FilterService } from '@common/modules/text-filter/filter-service'; import { FilterService } from '@common/modules/text-filter/filter-service';
@ -26,34 +26,34 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
public isDialog: boolean = false; public isDialog: boolean = false;
public formGroup: UntypedFormGroup; public formGroup: UntypedFormGroup;
public sections: DmpBlueprintDefinitionSection[] = []; public sections: PlanBlueprintDefinitionSection[] = [];
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.dmpService.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)), initialItems: (data?: any) => this.planService.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.dmpService.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.dmpService.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.planService.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: Dmp) => item.label, displayFn: (item: Plan) => item.label,
subtitleFn: (item: Dmp) => `${this.language.instant('DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS.CREATED-AT')} ${this.dateTimeFormatPipe.transform(item.createdAt, 'dd/MM/yyyy')}`, subtitleFn: (item: Plan) => `${this.language.instant('DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS.CREATED-AT')} ${this.dateTimeFormatPipe.transform(item.createdAt, 'dd/MM/yyyy')}`,
titleFn: (item: Dmp) => item.label, titleFn: (item: Plan) => item.label,
valueAssign: (item: Dmp) => item.id, valueAssign: (item: Plan) => item.id,
}; };
private buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpStatus[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup { private buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanStatus[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
const lookup: DmpLookup = new DmpLookup(); const lookup: PlanLookup = new PlanLookup();
lookup.page = { size: 100, offset: 0 }; lookup.page = { size: 100, offset: 0 };
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
if (ids && ids.length > 0) { lookup.ids = ids; } if (ids && ids.length > 0) { lookup.ids = ids; }
lookup.isActive = [IsActive.Active]; lookup.isActive = [IsActive.Active];
lookup.statuses = [DmpStatus.Draft]; lookup.statuses = [PlanStatus.Draft];
lookup.project = { lookup.project = {
fields: [ fields: [
nameof<Dmp>(x => x.id), nameof<Plan>(x => x.id),
nameof<Dmp>(x => x.label), nameof<Plan>(x => x.label),
nameof<Dmp>(x => x.createdAt), nameof<Plan>(x => x.createdAt),
] ]
}; };
if (dmpDescriptionTemplateSubQuery != null) lookup.dmpDescriptionTemplateSubQuery = dmpDescriptionTemplateSubQuery; if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
lookup.order = { items: [nameof<Dmp>(x => x.label)] }; lookup.order = { items: [nameof<Plan>(x => x.label)] };
if (like) { lookup.like = this.filterService.transformLike(like); } if (like) { lookup.like = this.filterService.transformLike(like); }
return lookup; return lookup;
} }
@ -63,7 +63,7 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
@Inject(MAT_DIALOG_DATA) public data: any, @Inject(MAT_DIALOG_DATA) public data: any,
public dialog: MatDialog, public dialog: MatDialog,
private language: TranslateService, private language: TranslateService,
private dmpService: DmpService, private planService: PlanService,
private filterService: FilterService, private filterService: FilterService,
private dateTimeFormatPipe: DateTimeFormatPipe private dateTimeFormatPipe: DateTimeFormatPipe
) { ) {
@ -87,8 +87,8 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
this.dialogRef.close(this.data); this.dialogRef.close(this.data);
} }
startNewDmp() { startNewPlan() {
this.data.startNewDmp = true; this.data.startNewPlan = true;
this.dialogRef.close(this.data); this.dialogRef.close(this.data);
} }

View File

@ -21,7 +21,7 @@
<div class="collapse navbar-collapse justify-content-end" id="navigation"> <div class="collapse navbar-collapse justify-content-end" id="navigation">
<div class="new-dmp-dialog col-md-auto ml-auto"> <div class="new-dmp-dialog col-md-auto ml-auto">
<button type="button" class="normal-btn" (click)="openNewDmpDialog()">{{ 'NAV-BAR.START-NEW-DMP' | translate }}</button> <button type="button" class="normal-btn" (click)="openNewPlanDialog()">{{ 'NAV-BAR.START-NEW-PLAN' | translate }}</button>
</div> </div>
<div class="col-md-auto pl-0" *ngIf="!(isAuthenticated() && onInvalidUrl())"> <div class="col-md-auto pl-0" *ngIf="!(isAuthenticated() && onInvalidUrl())">
<a class="ml-4 mr-4 faq-title" (click)="openFaqDialog()"><b>{{ 'FAQ.TITLE' | translate }}</b></a> <a class="ml-4 mr-4 faq-title" (click)="openFaqDialog()"><b>{{ 'FAQ.TITLE' | translate }}</b></a>
@ -101,7 +101,7 @@
</ng-container> </ng-container>
</li> </li>
<li class="d-flex justify-content-center"> <li class="d-flex justify-content-center">
<button type="button" class="normal-btn" (click)="openNewDmpDialog()">{{ 'NAV-BAR.START-NEW-DMP' | translate }}</button> <button type="button" class="normal-btn" (click)="openNewPlanDialog()">{{ 'NAV-BAR.START-NEW-PLAN' | translate }}</button>
</li> </li>
<li *ngIf="isAuthenticated()" class="d-flex justify-content-center"> <li *ngIf="isAuthenticated()" class="d-flex justify-content-center">
<button type="button" class="default-btn" (click)="logout()">{{ 'USER-DIALOG.LOG-OUT' | translate }}</button> <button type="button" class="default-btn" (click)="logout()">{{ 'USER-DIALOG.LOG-OUT' | translate }}</button>

View File

@ -24,7 +24,7 @@ import { MineInAppNotificationListingDialogComponent } from '@notification-servi
import { timer } from 'rxjs'; import { timer } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators'; import { map, takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { StartNewDmpDialogComponent } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.component'; import { StartNewPlanDialogComponent } from '../plan/new/start-new-plan-dialogue/start-new-plan-dialog.component';
import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component'; import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component';
import { UserDialogComponent } from './user-dialog/user-dialog.component'; import { UserDialogComponent } from './user-dialog/user-dialog.component';
@ -294,13 +294,13 @@ export class NavbarComponent extends BaseComponent implements OnInit {
this.sidenavService.toggle(); this.sidenavService.toggle();
} }
openNewDmpDialog() { openNewPlanDialog() {
if (this.dialog.openDialogs.length > 0) { if (this.dialog.openDialogs.length > 0) {
this.dialog.closeAll(); this.dialog.closeAll();
} else if (!this.isAuthenticated()) { } else if (!this.isAuthenticated()) {
this.router.navigate(['/login']); this.router.navigate(['/login']);
} else { } else {
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, { const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
disableClose: false, disableClose: false,
data: { data: {
isDialog: true isDialog: true

View File

@ -5,7 +5,7 @@
<mat-divider class="top-divider"></mat-divider> <mat-divider class="top-divider"></mat-divider>
<div class="profile-settings"> <div class="profile-settings">
<a mat-button class="profile mt-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToProfile()">{{'USER-DIALOG.USER-PROFILE-SETTINGS' | translate}}</a> <a mat-button class="profile mt-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToProfile()">{{'USER-DIALOG.USER-PROFILE-SETTINGS' | translate}}</a>
<a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyDmps()">{{'USER-PROFILE.ASSOCIATED-DMPS' | translate}}</a> <a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyDmps()">{{'USER-PROFILE.ASSOCIATED-PLANS' | translate}}</a>
</div> </div>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<div> <div>

View File

@ -1,16 +1,16 @@
<div class="clone-dialog container-fluid"> <div class="clone-dialog container-fluid">
<div class="row mt-3"> <div class="row mt-3">
<div class="col heading-1">{{'DMP-CLONE-DIALOG.TITLE' | translate}}</div> <div class="col heading-1">{{'PLAN-CLONE-DIALOG.TITLE' | translate}}</div>
<span class="col-auto ml-auto align-self-center" (click)="close()"><mat-icon class="close-icon">close</mat-icon></span> <span class="col-auto ml-auto align-self-center" (click)="close()"><mat-icon class="close-icon">close</mat-icon></span>
</div> </div>
<!-- Title Field --> <!-- Title Field -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">{{'DMP-CLONE-DIALOG.FIELDS.LABEL' | translate}}*</div> <div class="heading">{{'PLAN-CLONE-DIALOG.FIELDS.LABEL' | translate}}*</div>
</div> </div>
<div class="col-12 title-form"> <div class="col-12 title-form">
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<input matInput placeholder="{{'DMP-CLONE-DIALOG.FIELDS.LABEL' | translate}}" type="text" name="label" [formControl]="formGroup.get('label')" required> <input matInput placeholder="{{'PLAN-CLONE-DIALOG.FIELDS.LABEL' | translate}}" type="text" name="label" [formControl]="formGroup.get('label')" required>
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error> <mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
@ -19,25 +19,25 @@
<!-- Description field --> <!-- Description field -->
<div class="row"> <div class="row">
<div class="col-12 pb-4"> <div class="col-12 pb-4">
<div class="heading">{{'DMP-CLONE-DIALOG.FIELDS.DESCRIPTION' | translate}}</div> <div class="heading">{{'PLAN-CLONE-DIALOG.FIELDS.DESCRIPTION' | translate}}</div>
</div> </div>
<div class="col-12 hint">{{'DMP-CLONE-DIALOG.FIELDS.DESCRIPTION-HINT' | translate}}</div> <div class="col-12 hint">{{'PLAN-CLONE-DIALOG.FIELDS.DESCRIPTION-HINT' | translate}}</div>
<div class="col-12 basic-info-input"> <div class="col-12 basic-info-input">
<rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'DMP-CLONE-DIALOG.FIELDS.DESCRIPTION-PLACEHOLDER'"> <rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="'PLAN-CLONE-DIALOG.FIELDS.DESCRIPTION-PLACEHOLDER'">
</rich-text-editor-component> </rich-text-editor-component>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">{{'DMP-CLONE-DIALOG.FIELDS.DESCRIPTIONS' | translate}}</div> <div class="heading">{{'PLAN-CLONE-DIALOG.FIELDS.DESCRIPTIONS' | translate}}</div>
</div> </div>
<div class="col-12" *ngIf="hasDescriptions()"> <div class="col-12" *ngIf="hasDescriptions()">
<h5>{{'DMP-CLONE-DIALOG.FIELDS.DESCRIPTIONS-HINT' | translate}}</h5> <h5>{{'PLAN-CLONE-DIALOG.FIELDS.DESCRIPTIONS-HINT' | translate}}</h5>
</div> </div>
<div class="col-12" *ngIf="hasDescriptions()"> <div class="col-12" *ngIf="hasDescriptions()">
<mat-card class="mat-card"> <mat-card class="mat-card">
<mat-card-header> <mat-card-header>
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'DMP-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox> <mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
</mat-card-header> </mat-card-header>
<mat-selection-list #selectedItems [formControl]="formGroup.get('descriptions')"> <mat-selection-list #selectedItems [formControl]="formGroup.get('descriptions')">
<mat-list-option *ngFor="let description of dmp.descriptions;" [value]="description.id"> <mat-list-option *ngFor="let description of dmp.descriptions;" [value]="description.id">
@ -47,12 +47,12 @@
</mat-card> </mat-card>
</div> </div>
<div class="col-12" *ngIf="!hasDescriptions()"> <div class="col-12" *ngIf="!hasDescriptions()">
<h5 mat-subheader class="p-3">{{'DMP-CLONE-DIALOG.NO-DESCRIPTIONS' | translate}}</h5> <h5 mat-subheader class="p-3">{{'PLAN-CLONE-DIALOG.NO-DESCRIPTIONS' | translate}}</h5>
</div> </div>
</div> </div>
<div class="row pt-4"> <div class="row pt-4">
<div class="col"></div> <div class="col"></div>
<div class="col-auto"><button mat-raised-button type="button" class="cancel-btn" (click)="cancel()">{{'DMP-CLONE-DIALOG.ACTIONS.CANCEL' | translate}}</button></div> <div class="col-auto"><button mat-raised-button type="button" class="cancel-btn" (click)="cancel()">{{'PLAN-CLONE-DIALOG.ACTIONS.CANCEL' | translate}}</button></div>
<div class="col-auto"><button mat-raised-button type="button" class="confirm-btn" (click)="confirm()" color="accent">{{'DMP-CLONE-DIALOG.ACTIONS.CLONE' | translate}}</button></div> <div class="col-auto"><button mat-raised-button type="button" class="confirm-btn" (click)="confirm()" color="accent">{{'PLAN-CLONE-DIALOG.ACTIONS.CLONE' | translate}}</button></div>
</div> </div>
</div> </div>

View File

@ -1,14 +1,14 @@
import { Component, Inject } from '@angular/core'; import { Component, Inject } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CloneDmpPersist, Dmp } from '@app/core/model/plan/plan'; import { ClonePlanPersist, Plan } from '@app/core/model/plan/plan';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { DmpCloneDialogEditorModel } from './plan-clone-dialog.editor.model'; import { PlanCloneDialogEditorModel } from './plan-clone-dialog.editor.model';
import { DmpEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver'; import { PlanEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver';
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service'; import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
@ -17,22 +17,22 @@ import { HttpErrorResponse } from '@angular/common/http';
templateUrl: './plan-clone-dialog.component.html', templateUrl: './plan-clone-dialog.component.html',
styleUrls: ['./plan-clone-dialog.component.scss'] styleUrls: ['./plan-clone-dialog.component.scss']
}) })
export class CloneDmpDialogComponent extends BaseComponent { export class ClonePlanDialogComponent extends BaseComponent {
dmp: Dmp; dmp: Plan;
editorModel: DmpCloneDialogEditorModel; editorModel: PlanCloneDialogEditorModel;
formGroup: UntypedFormGroup; formGroup: UntypedFormGroup;
constructor( constructor(
public dialogRef: MatDialogRef<CloneDmpDialogComponent>, public dialogRef: MatDialogRef<ClonePlanDialogComponent>,
private dmpService: DmpService, private planService: PlanService,
private uiNotificationService: UiNotificationService, private uiNotificationService: UiNotificationService,
private httpErrorHandlingService: HttpErrorHandlingService, private httpErrorHandlingService: HttpErrorHandlingService,
private language: TranslateService, private language: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any @Inject(MAT_DIALOG_DATA) public data: any
) { ) {
super(); super();
this.dmp = data.dmp; this.dmp = data.plan;
} }
@ -53,7 +53,7 @@ export class CloneDmpDialogComponent extends BaseComponent {
} }
ngOnInit() { ngOnInit() {
this.editorModel = new DmpCloneDialogEditorModel().fromModel(this.data.dmp); this.editorModel = new PlanCloneDialogEditorModel().fromModel(this.data.plan);
this.formGroup = this.editorModel.buildForm(); this.formGroup = this.editorModel.buildForm();
} }
@ -71,8 +71,8 @@ export class CloneDmpDialogComponent extends BaseComponent {
confirm() { confirm() {
if (!this.formGroup.valid) { return; } if (!this.formGroup.valid) { return; }
const value: CloneDmpPersist = this.formGroup.value; const value: ClonePlanPersist = this.formGroup.value;
this.dmpService.clone(value, DmpEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe( this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
dmp => this.dialogRef.close(dmp), dmp => this.dialogRef.close(dmp),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );

View File

@ -1,11 +1,11 @@
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { CloneDmpPersist, Dmp } from "@app/core/model/plan/plan"; import { ClonePlanPersist, Plan } from "@app/core/model/plan/plan";
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 DmpCloneDialogEditorModel implements CloneDmpPersist { export class PlanCloneDialogEditorModel implements ClonePlanPersist {
id: Guid; id: Guid;
label: string; label: string;
description: String; description: String;
@ -16,7 +16,7 @@ export class DmpCloneDialogEditorModel implements CloneDmpPersist {
constructor() { } constructor() { }
public fromModel(item: Dmp): DmpCloneDialogEditorModel { public fromModel(item: Plan): PlanCloneDialogEditorModel {
if (item) { if (item) {
this.id = item.id; this.id = item.id;
this.label = item.label + " New"; this.label = item.label + " New";

View File

@ -1,15 +1,15 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonUiModule } from '@common/ui/common-ui.module'; import { CommonUiModule } from '@common/ui/common-ui.module';
import { CloneDmpDialogComponent } from './plan-clone-dialog.component'; import { ClonePlanDialogComponent } from './plan-clone-dialog.component';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module"; import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module";
@NgModule({ @NgModule({
imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule], imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule],
declarations: [CloneDmpDialogComponent], declarations: [ClonePlanDialogComponent],
exports: [CloneDmpDialogComponent] exports: [ClonePlanDialogComponent]
}) })
export class CloneDmpDialogModule { export class ClonePlanDialogModule {
constructor() { } constructor() { }
} }

View File

@ -5,7 +5,7 @@
</button> </button>
</div> </div>
<div class="col-auto pl-0"> <div class="col-auto pl-0">
<p class="mb-0 pl-2 frame-txt">{{ 'DMP-LISTING.ACTIONS.DEPOSIT' | translate }}</p> <p class="mb-0 pl-2 frame-txt">{{ 'PLAN-LISTING.ACTIONS.DEPOSIT' | translate }}</p>
</div> </div>
</div> </div>
<mat-menu #depositMenu="matMenu"> <mat-menu #depositMenu="matMenu">

View File

@ -4,7 +4,7 @@ import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
import { DepositConfigurationStatus } from '@app/core/common/enum/deposit-configuration-status'; import { DepositConfigurationStatus } from '@app/core/common/enum/deposit-configuration-status';
import { DepositConfiguration } from '@app/core/model/deposit/deposit-configuration'; import { DepositConfiguration } from '@app/core/model/deposit/deposit-configuration';
import { DepositAuthenticateRequest, DepositRequest, DepositRequestFields} from '@app/core/model/deposit/deposit-request'; import { DepositAuthenticateRequest, DepositRequest, DepositRequestFields} from '@app/core/model/deposit/deposit-request';
import { Dmp } from '@app/core/model/plan/plan'; import { Plan } from '@app/core/model/plan/plan';
import { EntityDoi } from '@app/core/model/entity-doi/entity-doi'; import { EntityDoi } from '@app/core/model/entity-doi/entity-doi';
import { DepositService } from '@app/core/services/deposit/deposit.service'; import { DepositService } from '@app/core/services/deposit/deposit.service';
import { import {
@ -26,7 +26,7 @@ import { nameof } from 'ts-simple-nameof';
}) })
export class DmpDepositDropdown extends BaseComponent implements OnInit { export class DmpDepositDropdown extends BaseComponent implements OnInit {
@Input() inputRepos: DepositConfiguration[]; @Input() inputRepos: DepositConfiguration[];
@Input() dmp: Dmp; @Input() dmp: 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[]>();
@ -69,8 +69,8 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
maxWidth: '600px', maxWidth: '600px',
restoreFocus: false, restoreFocus: false,
data: { data: {
message: this.language.instant('DMP-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'), message: this.language.instant('PLAN-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'),
titles: [this.language.instant('DMP-OVERVIEW.DEPOSIT.LOGIN', { 'repository': repo.repositoryId }), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')] titles: [this.language.instant('PLAN-OVERVIEW.DEPOSIT.LOGIN', { 'repository': repo.repositoryId }), this.language.instant('PLAN-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
} }
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
@ -81,7 +81,7 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
case 1: case 1:
const depositRequest: DepositRequest = { const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId, repositoryId: repo.repositoryId,
dmpId: this.dmp.id, planId: this.dmp.id,
authorizationCode: null, authorizationCode: null,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };
@ -99,7 +99,7 @@ export class DmpDepositDropdown 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,
dmpId: this.dmp.id, planId: this.dmp.id,
authorizationCode: null, authorizationCode: null,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };
@ -114,21 +114,21 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
} }
onDOICallbackSuccess(): void { onDOICallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('PLAN-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
} }
onDOICallbackError(error) { onDOICallbackError(error) {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-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: Dmp) { showOauth2Dialog(url: string, repo: DepositConfiguration, dmp: 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,
dmpId: dmp.id, planId: dmp.id,
authorizationCode: code, authorizationCode: code,
project: this.EntityDoiFields() project: this.EntityDoiFields()
}; };

View File

@ -1,7 +1,7 @@
<div class="dmp-invitation-dialog container-fluid" *ngIf="formGroup"> <div class="dmp-invitation-dialog container-fluid" *ngIf="formGroup">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1 class="title">{{'DMP-USER-INVITATION-DIALOG.TITLE' | translate}}</h1> <h1 class="title">{{'PLAN-USER-INVITATION-DIALOG.TITLE' | translate}}</h1>
</div> </div>
<div class="col-auto" (click)="closeDialog()"> <div class="col-auto" (click)="closeDialog()">
<mat-icon class="close-icon">close</mat-icon> <mat-icon class="close-icon">close</mat-icon>
@ -12,7 +12,7 @@
<app-plan-user-field-component [form]="formGroup" [validationErrorModel]="editorModel.validationErrorModel" [sections]="selectedBlueprint.definition.sections" [viewOnly]="false" [initializeUsers]="true" [enableSorting]="false"></app-plan-user-field-component> <app-plan-user-field-component [form]="formGroup" [validationErrorModel]="editorModel.validationErrorModel" [sections]="selectedBlueprint.definition.sections" [viewOnly]="false" [initializeUsers]="true" [enableSorting]="false"></app-plan-user-field-component>
</div> </div>
<div class="col mt-2"> <div class="col mt-2">
<button mat-raised-button *ngIf="hasValue()" [disabled]="inProgressSendButton" (click)="send()" type="button" class="invite-btn">{{'DMP-USER-INVITATION-DIALOG.ACTIONS.INVITE' | translate}}</button> <button mat-raised-button *ngIf="hasValue()" [disabled]="inProgressSendButton" (click)="send()" type="button" class="invite-btn">{{'PLAN-USER-INVITATION-DIALOG.ACTIONS.INVITE' | translate}}</button>
<mat-error *ngIf="formGroup.get('users').hasError('backendError')">{{formGroup.get('users').getError('backendError').message}}</mat-error> <mat-error *ngIf="formGroup.get('users').hasError('backendError')">{{formGroup.get('users').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('users').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="formGroup.get('users').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>

View File

@ -5,10 +5,10 @@ import { Component, Inject, OnInit } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { DmpUserRole } from '@app/core/common/enum/plan-user-role'; import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
import { DmpBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint'; import { PlanBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
import { DmpUserPersist } from '@app/core/model/plan/plan'; import { PlanUserPersist } from '@app/core/model/plan/plan';
import { DmpService } from '@app/core/services/plan/plan.service'; import { PlanService } from '@app/core/services/plan/plan.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
@ -17,7 +17,7 @@ import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/erro
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { DmpEditorModel } from '../../plan-editor-blueprint/plan-editor.model'; import { PlanEditorModel } from '../../plan-editor-blueprint/plan-editor.model';
@Component({ @Component({
selector: 'app-invitation-dialog-component', selector: 'app-invitation-dialog-component',
@ -26,11 +26,11 @@ import { DmpEditorModel } from '../../plan-editor-blueprint/plan-editor.model';
}) })
export class DmpInvitationDialogComponent extends BaseComponent implements OnInit { export class DmpInvitationDialogComponent extends BaseComponent implements OnInit {
dmpId: Guid; planId: Guid;
editorModel: DmpEditorModel; editorModel: PlanEditorModel;
formGroup: UntypedFormGroup; formGroup: UntypedFormGroup;
dmpUserRoleEnum = DmpUserRole; planUserRoleEnum = PlanUserRole;
selectedBlueprint: DmpBlueprint; selectedBlueprint: PlanBlueprint;
inProgressSendButton = false; inProgressSendButton = false;
readonly separatorKeysCodes: number[] = [ENTER, COMMA]; readonly separatorKeysCodes: number[] = [ENTER, COMMA];
@ -42,13 +42,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>, public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
private uiNotificationService: UiNotificationService, private uiNotificationService: UiNotificationService,
private httpErrorHandlingService: HttpErrorHandlingService, private httpErrorHandlingService: HttpErrorHandlingService,
private dmpService: DmpService, private planService: PlanService,
private formService: FormService, private formService: FormService,
@Inject(MAT_DIALOG_DATA) public data: any @Inject(MAT_DIALOG_DATA) public data: any
) { ) {
super(); super();
this.dmpId = data.dmpId; this.planId = data.planId;
this.editorModel = data ? new DmpEditorModel().fromModel(data) : new DmpEditorModel(); this.editorModel = data ? new PlanEditorModel().fromModel(data) : new PlanEditorModel();
this.selectedBlueprint = data?.blueprint; this.selectedBlueprint = data?.blueprint;
} }
@ -62,9 +62,9 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
if (!this.formGroup.get("users").valid) { return; } if (!this.formGroup.get("users").valid) { return; }
this.inProgressSendButton = true; this.inProgressSendButton = true;
const userFormData = this.formGroup.get("users").value as DmpUserPersist[]; const userFormData = this.formGroup.get("users").value as PlanUserPersist[];
this.dmpService.inviteUsers(this.dmpId, { users: userFormData }) this.planService.inviteUsers(this.planId, { users: userFormData })
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => { complete => {
@ -84,13 +84,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
} }
onCallbackSuccess(): void { onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-USER-INVITATION-DIALOG.SUCCESS'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('PLAN-USER-INVITATION-DIALOG.SUCCESS'), SnackBarNotificationLevel.Success);
} }
onCallbackError(errorResponse: HttpErrorResponse) { onCallbackError(errorResponse: HttpErrorResponse) {
this.inProgressSendButton = false; this.inProgressSendButton = false;
let errorOverrides = new Map<number, string>(); let errorOverrides = new Map<number, string>();
errorOverrides.set(-1, this.language.instant('DMP-USER-INVITATION-DIALOG.ERROR')); errorOverrides.set(-1, this.language.instant('PLAN-USER-INVITATION-DIALOG.ERROR'));
this.httpErrorHandlingService.handleBackedRequestError(errorResponse, errorOverrides, SnackBarNotificationLevel.Error); this.httpErrorHandlingService.handleBackedRequestError(errorResponse, errorOverrides, SnackBarNotificationLevel.Error);
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse); const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);

View File

@ -4,10 +4,10 @@ import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.mod
import { RichTextEditorModule } from "@app/library/rich-text-editor/rich-text-editor.module"; import { RichTextEditorModule } from "@app/library/rich-text-editor/rich-text-editor.module";
import { CommonUiModule } from '@common/ui/common-ui.module'; import { CommonUiModule } from '@common/ui/common-ui.module';
import { DmpInvitationDialogComponent } from './plan-invitation-dialog.component'; import { DmpInvitationDialogComponent } from './plan-invitation-dialog.component';
import { DmpUserFieldModule } from '../../plan-user-field/plan-user-field.module'; import { PlanUserFieldModule } from '../../plan-user-field/plan-user-field.module';
@NgModule({ @NgModule({
imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule, DmpUserFieldModule], imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule, PlanUserFieldModule],
declarations: [DmpInvitationDialogComponent], declarations: [DmpInvitationDialogComponent],
exports: [DmpInvitationDialogComponent] exports: [DmpInvitationDialogComponent]
}) })

Some files were not shown because too many files have changed in this diff Show More