rename frontend dmp to plan (in progress)
This commit is contained in:
parent
a6ecac7524
commit
a5b9aaccd8
|
@ -48,7 +48,7 @@ const appRoutes: Routes = [
|
|||
loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewMyDmpPage]
|
||||
permissions: [AppPermission.ViewMyPlanPage]
|
||||
},
|
||||
breadcrumb: true,
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
|
@ -69,14 +69,14 @@ const appRoutes: Routes = [
|
|||
}
|
||||
},
|
||||
{
|
||||
path: 'dmp-blueprints',
|
||||
loadChildren: () => import('./ui/admin/plan-blueprint/plan-blueprint.module').then(m => m.DmpBlueprintModule),
|
||||
path: 'plan-blueprints',
|
||||
loadChildren: () => import('./ui/admin/plan-blueprint/plan-blueprint.module').then(m => m.PlanBlueprintModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewDmpBlueprintPage]
|
||||
permissions: [AppPermission.ViewPlanBlueprintPage]
|
||||
},
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.DMP-BLUEPRINTS'
|
||||
title: 'BREADCRUMBS.PLAN-BLUEPRINTS'
|
||||
}),
|
||||
title: 'GENERAL.TITLES.BLUEPRINTS'
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export enum LockTargetType {
|
||||
Dmp = 0,
|
||||
Description = 1,
|
||||
DmpBlueprint = 2,
|
||||
PlanBlueprint = 2,
|
||||
DescriptionTemplate= 3
|
||||
}
|
|
@ -5,9 +5,9 @@ export enum AppPermission {
|
|||
//Public
|
||||
PublicBrowseDescription = "PublicBrowseDescription",
|
||||
PublicBrowseDescriptionTemplate = "PublicBrowseDescriptionTemplate",
|
||||
PublicBrowseDmp = "PublicBrowseDmp",
|
||||
PublicBrowseDmpReference = "PublicBrowseDmpReference",
|
||||
PublicBrowseDmpUser = "PublicBrowseDmpUser",
|
||||
PublicBrowsePlan = "PublicBrowsePlan",
|
||||
PublicBrowsePlanReference = "PublicBrowsePlanReference",
|
||||
PublicBrowsePlanUser = "PublicBrowsePlanUser",
|
||||
PublicBrowseReference = "PublicBrowseReference",
|
||||
PublicBrowseUser = "PublicBrowseUser",
|
||||
PublicBrowseDashboardStatistics = "PublicBrowseDashboardStatistics",
|
||||
|
@ -55,7 +55,7 @@ export enum AppPermission {
|
|||
EditUser = "EditUser",
|
||||
DeleteUser = "DeleteUser",
|
||||
ExportUsers = "ExportUsers",
|
||||
BrowseDmpAssociatedUser = "BrowseDmpAssociatedUser",
|
||||
BrowsePlanAssociatedUser = "BrowsePlanAssociatedUser",
|
||||
|
||||
|
||||
//StorageFile
|
||||
|
@ -68,38 +68,38 @@ export enum AppPermission {
|
|||
EditDescriptionTemplateType = "EditDescriptionTemplateType",
|
||||
DeleteDescriptionTemplateType = "DeleteDescriptionTemplateType",
|
||||
|
||||
//Dmp
|
||||
BrowseDmp = "BrowseDmp",
|
||||
EditDmp = "EditDmp",
|
||||
NewDmp = "NewDmp",
|
||||
DepositDmp = "DepositDmp",
|
||||
DeleteDmp = "DeleteDmp",
|
||||
CloneDmp = "CloneDmp",
|
||||
ExportDmp = "ExportDmp",
|
||||
CreateNewVersionDmp = "CreateNewVersionDmp",
|
||||
FinalizeDmp = "FinalizeDmp",
|
||||
UndoFinalizeDmp = "UndoFinalizeDmp",
|
||||
AssignDmpUsers = "AssignDmpUsers",
|
||||
InviteDmpUsers = "InviteDmpUsers",
|
||||
//Plan
|
||||
BrowsePlan = "BrowsePlan",
|
||||
EditPlan = "EditPlan",
|
||||
NewPlan = "NewPlan",
|
||||
DepositPlan = "DepositPlan",
|
||||
DeletePlan = "DeletePlan",
|
||||
ClonePlan = "ClonePlan",
|
||||
ExportPlan = "ExportPlan",
|
||||
CreateNewVersionPlan = "CreateNewVersionPlan",
|
||||
FinalizePlan = "FinalizePlan",
|
||||
UndoFinalizePlan = "UndoFinalizePlan",
|
||||
AssignPlanUsers = "AssignPlanUsers",
|
||||
InvitePlanUsers = "InvitePlanUsers",
|
||||
|
||||
//DmpBlueprint
|
||||
BrowseDmpBlueprint = "BrowseDmpBlueprint",
|
||||
EditDmpBlueprint = "EditDmpBlueprint",
|
||||
DeleteDmpBlueprint = "DeleteDmpBlueprint",
|
||||
CloneDmpBlueprint = "CloneDmpBlueprint",
|
||||
CreateNewVersionDmpBlueprint = "CreateNewVersionDmpBlueprint",
|
||||
ExportDmpBlueprint = "ExportDmpBlueprint",
|
||||
ImportDmpBlueprint = "ImportDmpBlueprint",
|
||||
//PlanBlueprint
|
||||
BrowsePlanBlueprint = "BrowsePlanBlueprint",
|
||||
EditPlanBlueprint = "EditPlanBlueprint",
|
||||
DeletePlanBlueprint = "DeletePlanBlueprint",
|
||||
ClonePlanBlueprint = "ClonePlanBlueprint",
|
||||
CreateNewVersionPlanBlueprint = "CreateNewVersionPlanBlueprint",
|
||||
ExportPlanBlueprint = "ExportPlanBlueprint",
|
||||
ImportPlanBlueprint = "ImportPlanBlueprint",
|
||||
|
||||
//DmpDescriptionTemplate
|
||||
BrowseDmpDescriptionTemplate = "BrowseDmpDescriptionTemplate",
|
||||
EditDmpDescriptionTemplate = "EditDmpDescriptionTemplate",
|
||||
DeleteDmpDescriptionTemplate = "DeleteDmpDescriptionTemplate",
|
||||
//PlanDescriptionTemplate
|
||||
BrowsePlanDescriptionTemplate = "BrowsePlanDescriptionTemplate",
|
||||
EditPlanDescriptionTemplate = "EditPlanDescriptionTemplate",
|
||||
DeletePlanDescriptionTemplate = "DeletePlanDescriptionTemplate",
|
||||
|
||||
//DmpUser
|
||||
BrowseDmpUser = "BrowseDmpUser",
|
||||
EditDmpUser = "EditDmpUser",
|
||||
DeleteDmpUser = "DeleteDmpUser",
|
||||
//PlanUser
|
||||
BrowsePlanUser = "BrowsePlanUser",
|
||||
EditPlanUser = "EditPlanUser",
|
||||
DeletePlanUser = "DeletePlanUser",
|
||||
|
||||
//Description
|
||||
BrowseDescription = "BrowseDescription",
|
||||
|
@ -137,10 +137,10 @@ export enum AppPermission {
|
|||
EditTag = "EditTag",
|
||||
DeleteTag = "DeleteTag",
|
||||
|
||||
//DmpReference
|
||||
BrowseDmpReference = "BrowseDmpReference",
|
||||
EditDmpReference = "EditDmpReference",
|
||||
DeleteDmpReference = "DeleteDmpReference",
|
||||
//PlanReference
|
||||
BrowsePlanReference = "BrowsePlanReference",
|
||||
EditPlanReference = "EditPlanReference",
|
||||
DeletePlanReference = "DeletePlanReference",
|
||||
|
||||
//DescriptionReference
|
||||
BrowseDescriptionReference = "BrowseDescriptionReference",
|
||||
|
@ -216,11 +216,11 @@ export enum AppPermission {
|
|||
ViewReferencePage = "ViewReferencePage",
|
||||
ViewEntityLockPage = "ViewEntityLockPage",
|
||||
ViewDescriptionTemplatePage = "ViewDescriptionTemplatePage",
|
||||
ViewDmpBlueprintPage = "ViewDmpBlueprintPage",
|
||||
ViewPlanBlueprintPage = "ViewPlanBlueprintPage",
|
||||
ViewPublicDescriptionPage = "ViewPublicDescriptionPage",
|
||||
ViewPublicDmpPage = "ViewPublicDmpPage",
|
||||
ViewMyDescriptionPage = "ViewMyDescriptionPage",
|
||||
ViewMyDmpPage = "ViewMyDmpPage",
|
||||
ViewMyPlanPage = "ViewMyPlanPage",
|
||||
ViewHomePage = "ViewHomePage",
|
||||
ViewMineInAppNotificationPage = "ViewMineInAppNotificationPage",
|
||||
ViewTenantConfigurationPage = "ViewTenantConfigurationPage",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpAccessType {
|
||||
export enum PlanAccessType {
|
||||
Public = 0,
|
||||
Restricted = 1
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintExtraFieldDataType {
|
||||
export enum PlanBlueprintExtraFieldDataType {
|
||||
TEXT = 0,
|
||||
RICH_TEXT = 1,
|
||||
DATE = 2,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintFieldCategory {
|
||||
export enum PlanBlueprintFieldCategory {
|
||||
System = 0,
|
||||
Extra = 1,
|
||||
ReferenceType = 2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintExtraFieldDataType {
|
||||
export enum PlanBlueprintExtraFieldDataType {
|
||||
Text = 0,
|
||||
RichText = 1,
|
||||
Date = 2,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintStatus {
|
||||
export enum PlanBlueprintStatus {
|
||||
Draft = 0,
|
||||
Finalized = 1
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintSystemFieldType {
|
||||
export enum PlanBlueprintSystemFieldType {
|
||||
Title = 0,
|
||||
Description = 1,
|
||||
// RESEARCHERS = 2,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export enum DmpBlueprintType {
|
||||
export enum PlanBlueprintType {
|
||||
Input = 0
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpBlueprintVersionStatus {
|
||||
export enum PlanBlueprintVersionStatus {
|
||||
Current = 0,
|
||||
Previous = 1,
|
||||
NotFinalized = 2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpStatus {
|
||||
export enum PlanStatus {
|
||||
Draft = 0,
|
||||
Finalized = 1
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpUserRole {
|
||||
export enum PlanUserRole {
|
||||
Owner = 0,
|
||||
Viewer = 1,
|
||||
DescriptionContributor = 2,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpUserType {
|
||||
export enum PlanUserType {
|
||||
Internal = 0,
|
||||
External = 1
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum DmpVersionStatus {
|
||||
export enum PlanVersionStatus {
|
||||
Current = 0,
|
||||
Previous = 1,
|
||||
NotFinalized = 2
|
||||
|
|
|
@ -18,12 +18,12 @@ export enum ResponseErrorCode {
|
|||
MultipleDmpVersionsNotSupported = 118,
|
||||
DmpIsFinalized = 119,
|
||||
DmpCanNotChange = 120,
|
||||
DmpDescriptionTemplateCanNotChange = 121,
|
||||
PlanDescriptionTemplateCanNotChange = 121,
|
||||
InvalidDescriptionTemplate = 122,
|
||||
DescriptionIsFinalized = 123,
|
||||
DmpBlueprintHasNoDescriptionTemplates = 124,
|
||||
DmpBlueprintNewVersionConflict = 125,
|
||||
DmpDescriptionTemplateCanNotRemove = 126,
|
||||
PlanBlueprintHasNoDescriptionTemplates = 124,
|
||||
PlanBlueprintNewVersionConflict = 125,
|
||||
PlanDescriptionTemplateCanNotRemove = 126,
|
||||
TenantTampering = 127,
|
||||
TenantConfigurationTypeCanNotChange = 128,
|
||||
MultipleTenantConfigurationTypeNotAllowed = 129,
|
||||
|
@ -33,10 +33,10 @@ export enum ResponseErrorCode {
|
|||
DescriptionTemplateMissingUserContactInfo = 133,
|
||||
DmpInactiveUser = 134,
|
||||
DmpMissingUserContactInfo = 135,
|
||||
ImportDescriptionWithoutDmpDescriptionTemplate = 136,
|
||||
DuplicateDmpUser = 137,
|
||||
ImportDescriptionWithoutPlanDescriptionTemplate = 136,
|
||||
DuplicatePlanUser = 137,
|
||||
DescriptionTemplateNewVersionAlreadyCreatedDraft = 138,
|
||||
DmpBlueprintNewVersionAlreadyCreatedDraft = 139,
|
||||
PlanBlueprintNewVersionAlreadyCreatedDraft = 139,
|
||||
ReferenceTypeCodeExists = 140,
|
||||
PrefillingSourceCodeExists = 141,
|
||||
InviteUserAlreadyConfirmed = 142,
|
||||
|
@ -80,27 +80,27 @@ export class ResponseErrorCodeHelper {
|
|||
case ResponseErrorCode.MultipleDescriptionTemplateVersionsNotSupported:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DESCRIPTION-TEMPLATE-VERSIONS-NOT-SUPPORTED");
|
||||
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:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-IS-NOT-FINALIZED");
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED");
|
||||
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:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-IS-FINALIZED");
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED");
|
||||
case ResponseErrorCode.DmpCanNotChange:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-CAN-NOT-CHANGE");
|
||||
case ResponseErrorCode.DmpDescriptionTemplateCanNotChange:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE");
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE");
|
||||
case ResponseErrorCode.PlanDescriptionTemplateCanNotChange:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE");
|
||||
case ResponseErrorCode.InvalidDescriptionTemplate:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.INVALID-DESCRIPTION-TEMPLATE");
|
||||
case ResponseErrorCode.DescriptionIsFinalized:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-IS-FINALIZED");
|
||||
case ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-HAS-NO-DESCRIPTION-TEMPLATES");
|
||||
case ResponseErrorCode.DmpBlueprintNewVersionConflict:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-NEW-VERSION-CONFLICT");
|
||||
case ResponseErrorCode.DmpDescriptionTemplateCanNotRemove:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-DESCRIPTION-TEMPLATE-CAN-NOT-REMOVE");
|
||||
case ResponseErrorCode.PlanBlueprintHasNoDescriptionTemplates:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-HAS-NO-DESCRIPTION-TEMPLATES");
|
||||
case ResponseErrorCode.PlanBlueprintNewVersionConflict:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-NEW-VERSION-CONFLICT");
|
||||
case ResponseErrorCode.PlanDescriptionTemplateCanNotRemove:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-REMOVE");
|
||||
case ResponseErrorCode.TenantTampering:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.TENANT-TAMPERING");
|
||||
case ResponseErrorCode.TenantConfigurationTypeCanNotChange:
|
||||
|
@ -110,21 +110,21 @@ export class ResponseErrorCodeHelper {
|
|||
case ResponseErrorCode.TenantCodeExists:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS");
|
||||
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:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-INACTIVE-USER");
|
||||
case ResponseErrorCode.DescriptionTemplateMissingUserContactInfo:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-MISSING-USER-CONTACT-INFO");
|
||||
case ResponseErrorCode.DmpInactiveUser:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-INACTIVE-USER");
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER");
|
||||
case ResponseErrorCode.DmpMissingUserContactInfo:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-MISSING-USER-CONTACT-INFO");
|
||||
case ResponseErrorCode.ImportDescriptionWithoutDmpDescriptionTemplate:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-DMP-DESCRIPTION-TEMPLATE");
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO");
|
||||
case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE");
|
||||
case ResponseErrorCode.InvalidApiKey:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.INVALID-API-KEY");
|
||||
case ResponseErrorCode.DuplicateDmpUser:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DUPLICATE-DMP-USER");
|
||||
case ResponseErrorCode.DuplicatePlanUser:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DUPLICATE-PLAN-USER");
|
||||
case ResponseErrorCode.StaleApiKey:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.STALE-API-KEY");
|
||||
case ResponseErrorCode.SensitiveInfo:
|
||||
|
@ -143,8 +143,8 @@ export class ResponseErrorCodeHelper {
|
|||
return language.instant("GENERAL.BACKEND-ERRORS.OVERLAPPING-TENANT-CONFIGURATION-NOTIFIER-LIST");
|
||||
case ResponseErrorCode.DescriptionTemplateNewVersionAlreadyCreatedDraft:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-NEW-VERSION-ALREADY-CREATED-DRAFT");
|
||||
case ResponseErrorCode.DmpBlueprintNewVersionAlreadyCreatedDraft:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.DMP-BLUEPRINT-NEW-VERSION-ALREADY-CREATED-DRAFT");
|
||||
case ResponseErrorCode.PlanBlueprintNewVersionAlreadyCreatedDraft:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-NEW-VERSION-ALREADY-CREATED-DRAFT");
|
||||
case ResponseErrorCode.ReferenceTypeCodeExists:
|
||||
return language.instant("GENERAL.BACKEND-ERRORS.REFERENCE-TYPE-CODE-EXISTS");
|
||||
case ResponseErrorCode.PrefillingSourceCodeExists:
|
||||
|
|
|
@ -8,8 +8,8 @@ import { LanguageInfoService } from './services/culture/language-info-service';
|
|||
import { DashboardService } from './services/dashboard/dashboard.service';
|
||||
import { DepositService } from './services/deposit/deposit.service';
|
||||
import { DescriptionTemplateTypeService } from './services/description-template-type/description-template-type.service';
|
||||
import { DmpBlueprintService } from './services/plan/plan-blueprint.service';
|
||||
import { DmpService } from './services/plan/plan.service';
|
||||
import { PlanBlueprintService } from './services/plan/plan-blueprint.service';
|
||||
import { PlanService } from './services/plan/plan.service';
|
||||
import { BaseHttpV2Service } from './services/http/base-http-v2.service';
|
||||
import { LanguageService } from './services/language/language.service';
|
||||
import { LockService } from './services/lock/lock.service';
|
||||
|
@ -79,7 +79,7 @@ export class CoreServiceModule {
|
|||
LoggingService,
|
||||
DashboardService,
|
||||
DepositService,
|
||||
DmpBlueprintService,
|
||||
PlanBlueprintService,
|
||||
ContactSupportService,
|
||||
LanguageService,
|
||||
LockService,
|
||||
|
@ -100,7 +100,7 @@ export class CoreServiceModule {
|
|||
TenantService,
|
||||
UserService,
|
||||
LanguageHttpService,
|
||||
DmpService,
|
||||
PlanService,
|
||||
DescriptionService,
|
||||
MaintenanceService,
|
||||
TagService,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { RecentActivityItemType } from "@app/core/common/enum/recent-activity-item-type";
|
||||
import { Description } from "../description/description";
|
||||
import { Dmp } from "../plan/plan";
|
||||
import { Plan } from "../plan/plan";
|
||||
|
||||
export interface RecentActivityItem {
|
||||
type: RecentActivityItemType;
|
||||
dmp: Dmp;
|
||||
plan: Plan;
|
||||
description: Description;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Guid } from "@common/types/guid";
|
|||
|
||||
export class DepositRequest {
|
||||
repositoryId: string;
|
||||
dmpId: Guid;
|
||||
planId: Guid;
|
||||
authorizationCode: String;
|
||||
project: DepositRequestFields;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { DescriptionStatus } from "@app/core/common/enum/description-status";
|
|||
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
||||
import { Guid } from "@common/types/guid";
|
||||
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 { Tag, TagPersist } from "../tag/tag";
|
||||
import { User } from "../user/user";
|
||||
|
@ -17,8 +17,8 @@ export interface Description extends BaseDescription {
|
|||
descriptionReferences?: DescriptionReference[];
|
||||
descriptionTags?: DescriptionTag[];
|
||||
descriptionTemplate?: DescriptionTemplate;
|
||||
dmpDescriptionTemplate?: DmpDescriptionTemplate;
|
||||
dmp?: Dmp;
|
||||
planDescriptionTemplate?: PlanDescriptionTemplate;
|
||||
plan?: Plan;
|
||||
authorizationFlags?: AppPermission[];
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,8 @@ export interface DescriptionTag extends BaseEntity {
|
|||
//
|
||||
export interface DescriptionPersist extends BaseEntityPersist {
|
||||
label: string;
|
||||
dmpId: Guid;
|
||||
dmpDescriptionTemplateId: Guid;
|
||||
planId: Guid;
|
||||
planDescriptionTemplateId: Guid;
|
||||
descriptionTemplateId: Guid;
|
||||
status: DescriptionStatus;
|
||||
description: string;
|
||||
|
@ -134,13 +134,13 @@ export interface PublicDescription extends BaseDescription {
|
|||
description?: string;
|
||||
finalizedAt?: Date;
|
||||
descriptionTemplate?: PublicDescriptionTemplate;
|
||||
dmpDescriptionTemplate?: PublicDmpDescriptionTemplate;
|
||||
dmp?: PublicDmp;
|
||||
planDescriptionTemplate?: PublicPlanDescriptionTemplate;
|
||||
plan?: PublicPlan;
|
||||
}
|
||||
|
||||
export interface PublicDmpDescriptionTemplate {
|
||||
export interface PublicPlanDescriptionTemplate {
|
||||
id: Guid;
|
||||
dmp: PublicDmp;
|
||||
plan: PublicPlan;
|
||||
}
|
||||
|
||||
export interface PublicDescriptionTemplate {
|
||||
|
@ -149,7 +149,7 @@ export interface PublicDescriptionTemplate {
|
|||
description: string;
|
||||
}
|
||||
export interface DescriptionSectionPermissionResolver {
|
||||
dmpId: Guid;
|
||||
planId: Guid;
|
||||
sectionIds: Guid[];
|
||||
permissions: string[];
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import { DmpBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
|
||||
import { DmpBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
|
||||
import { DmpBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
|
||||
import { DmpBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
|
||||
import { PlanBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
|
||||
import { PlanBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
|
||||
import { PlanBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
|
||||
import { PlanBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
|
||||
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { ReferenceType } from "../reference-type/reference-type";
|
||||
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;
|
||||
definition: DmpBlueprintDefinition;
|
||||
status: DmpBlueprintStatus;
|
||||
definition: PlanBlueprintDefinition;
|
||||
status: PlanBlueprintStatus;
|
||||
version: number;
|
||||
versionStatus: DmpBlueprintVersionStatus;
|
||||
versionStatus: PlanBlueprintVersionStatus;
|
||||
groupId: Guid;
|
||||
}
|
||||
|
||||
export interface DmpBlueprintDefinition {
|
||||
sections?: DmpBlueprintDefinitionSection[];
|
||||
export interface PlanBlueprintDefinition {
|
||||
sections?: PlanBlueprintDefinitionSection[];
|
||||
}
|
||||
|
||||
|
||||
export interface DmpBlueprintDefinitionSection {
|
||||
export interface PlanBlueprintDefinitionSection {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: string;
|
||||
|
@ -43,7 +43,7 @@ export interface DescriptionTemplatesInSection {
|
|||
|
||||
export interface FieldInSection {
|
||||
id: Guid;
|
||||
category: DmpBlueprintFieldCategory;
|
||||
category: PlanBlueprintFieldCategory;
|
||||
label: string;
|
||||
placeholder: string;
|
||||
description: string;
|
||||
|
@ -53,11 +53,11 @@ export interface FieldInSection {
|
|||
}
|
||||
|
||||
export interface SystemFieldInSection extends FieldInSection {
|
||||
systemFieldType: DmpBlueprintSystemFieldType;
|
||||
systemFieldType: PlanBlueprintSystemFieldType;
|
||||
}
|
||||
|
||||
export interface ExtraFieldInSection extends FieldInSection {
|
||||
dataType: DmpBlueprintExtraFieldDataType;
|
||||
dataType: PlanBlueprintExtraFieldDataType;
|
||||
}
|
||||
|
||||
export interface ReferenceTypeFieldInSection extends FieldInSection {
|
||||
|
@ -68,23 +68,23 @@ export interface ReferenceTypeFieldInSection extends FieldInSection {
|
|||
//
|
||||
// Persist
|
||||
//
|
||||
export interface DmpBlueprintPersist extends BaseEntityPersist {
|
||||
export interface PlanBlueprintPersist extends BaseEntityPersist {
|
||||
label: string;
|
||||
definition: DmpBlueprintDefinitionPersist;
|
||||
status: DmpBlueprintStatus;
|
||||
definition: PlanBlueprintDefinitionPersist;
|
||||
status: PlanBlueprintStatus;
|
||||
}
|
||||
|
||||
export interface NewVersionDmpBlueprintPersist {
|
||||
export interface NewVersionPlanBlueprintPersist {
|
||||
label: string;
|
||||
definition: DmpBlueprintDefinitionPersist;
|
||||
status: DmpBlueprintStatus;
|
||||
definition: PlanBlueprintDefinitionPersist;
|
||||
status: PlanBlueprintStatus;
|
||||
}
|
||||
|
||||
export interface DmpBlueprintDefinitionPersist {
|
||||
sections?: DmpBlueprintDefinitionSectionPersist[];
|
||||
export interface PlanBlueprintDefinitionPersist {
|
||||
sections?: PlanBlueprintDefinitionSectionPersist[];
|
||||
}
|
||||
|
||||
export interface DmpBlueprintDefinitionSectionPersist {
|
||||
export interface PlanBlueprintDefinitionSectionPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: string;
|
||||
|
@ -104,7 +104,7 @@ export interface DescriptionTemplatesInSectionPersist {
|
|||
|
||||
export interface FieldInSectionPersist {
|
||||
id: Guid;
|
||||
category: DmpBlueprintFieldCategory;
|
||||
category: PlanBlueprintFieldCategory;
|
||||
label: string;
|
||||
placeholder: string;
|
||||
description: string;
|
||||
|
@ -114,11 +114,11 @@ export interface FieldInSectionPersist {
|
|||
}
|
||||
|
||||
export interface SystemFieldInSectionPersist extends FieldInSectionPersist {
|
||||
systemFieldType: DmpBlueprintSystemFieldType;
|
||||
systemFieldType: PlanBlueprintSystemFieldType;
|
||||
}
|
||||
|
||||
export interface ExtraFieldInSectionPersist extends FieldInSectionPersist {
|
||||
dataType: DmpBlueprintExtraFieldDataType;
|
||||
dataType: PlanBlueprintExtraFieldDataType;
|
||||
}
|
||||
|
||||
export interface ReferenceTypeFieldInSectionPersist extends FieldInSectionPersist {
|
||||
|
|
|
@ -2,14 +2,14 @@ import { Guid } from "@common/types/guid";
|
|||
import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "../description/description-import";
|
||||
|
||||
// preprocessing
|
||||
export interface PreprocessingDmpModel {
|
||||
export interface PreprocessingPlanModel {
|
||||
label: string;
|
||||
blueprintId: Guid;
|
||||
preprocessingDescriptionModels: PreprocessingDescriptionModel[];
|
||||
}
|
||||
|
||||
// rda config
|
||||
export interface DmpCommonModelConfig {
|
||||
export interface PlanCommonModelConfig {
|
||||
fileId: Guid;
|
||||
label: string;
|
||||
blueprintId: Guid;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { BaseEntity } from "@common/base/base-entity.model";
|
||||
import { Reference } from "../reference/reference";
|
||||
import { Dmp } from "./plan";
|
||||
import { Plan } from "./plan";
|
||||
import { Guid } from "@common/types/guid";
|
||||
|
||||
export interface DmpReference extends BaseEntity {
|
||||
dmp?: Dmp;
|
||||
export interface PlanReference extends BaseEntity {
|
||||
plan?: Plan;
|
||||
reference?: Reference;
|
||||
data: DmpReferenceData;
|
||||
data: PlanReferenceData;
|
||||
}
|
||||
|
||||
export interface DmpReferenceData {
|
||||
export interface PlanReferenceData {
|
||||
blueprintFieldId: Guid;
|
||||
}
|
|
@ -1,71 +1,71 @@
|
|||
import { DmpAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { DmpStatus } from '@app/core/common/enum/plan-status';
|
||||
import { DmpUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { DmpVersionStatus } from '@app/core/common/enum/plan-version-status';
|
||||
import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { PlanStatus } from '@app/core/common/enum/plan-status';
|
||||
import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { PlanVersionStatus } from '@app/core/common/enum/plan-version-status';
|
||||
import { BaseEntity, BaseEntityPersist } from '@common/base/base-entity.model';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { DescriptionTemplate } from '../description-template/description-template';
|
||||
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 { ReferencePersist } from '../reference/reference';
|
||||
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 { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { EntityType } from '@app/core/common/enum/entity-type';
|
||||
|
||||
export interface Dmp extends BaseDmp {
|
||||
export interface Plan extends BasePlan {
|
||||
label?: string;
|
||||
version?: number;
|
||||
versionStatus?: DmpVersionStatus;
|
||||
properties?: DmpProperties;
|
||||
versionStatus?: PlanVersionStatus;
|
||||
properties?: PlanProperties;
|
||||
groupId?: String;
|
||||
description?: String;
|
||||
finalizedAt?: Date;
|
||||
publishedAt?: Date;
|
||||
creator?: User;
|
||||
accessType?: DmpAccessType;
|
||||
blueprint?: DmpBlueprint;
|
||||
accessType?: PlanAccessType;
|
||||
blueprint?: PlanBlueprint;
|
||||
language?: String;
|
||||
publicAfter?: Date;
|
||||
dmpReferences?: DmpReference[];
|
||||
dmpUsers?: DmpUser[];
|
||||
planReferences?: PlanReference[];
|
||||
planUsers?: PlanUser[];
|
||||
descriptions?: Description[];
|
||||
dmpDescriptionTemplates?: DmpDescriptionTemplate[];
|
||||
planDescriptionTemplates?: PlanDescriptionTemplate[];
|
||||
entityDois?: EntityDoi[];
|
||||
otherDmpVersions?: Dmp[];
|
||||
otherPlanVersions?: Plan[];
|
||||
authorizationFlags?: AppPermission[];
|
||||
}
|
||||
|
||||
export interface DmpProperties {
|
||||
dmpBlueprintValues: DmpBlueprintValue[];
|
||||
contacts: DmpContact[];
|
||||
export interface PlanProperties {
|
||||
planBlueprintValues: PlanBlueprintValue[];
|
||||
contacts: PlanContact[];
|
||||
}
|
||||
|
||||
export interface DmpBlueprintValue {
|
||||
export interface PlanBlueprintValue {
|
||||
fieldId: Guid;
|
||||
fieldValue: string;
|
||||
dateValue: Date;
|
||||
numberValue: number;
|
||||
}
|
||||
|
||||
export interface DmpContact {
|
||||
export interface PlanContact {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
|
||||
export interface DmpUser extends BaseEntity {
|
||||
dmp: Dmp;
|
||||
export interface PlanUser extends BaseEntity {
|
||||
plan: Plan;
|
||||
user: User;
|
||||
role: DmpUserRole;
|
||||
role: PlanUserRole;
|
||||
sectionId: Guid;
|
||||
}
|
||||
|
||||
export interface DmpDescriptionTemplate extends BaseEntity {
|
||||
dmp?: Dmp;
|
||||
export interface PlanDescriptionTemplate extends BaseEntity {
|
||||
plan?: Plan;
|
||||
currentDescriptionTemplate?: DescriptionTemplate; //TODO: what is this?
|
||||
descriptionTemplates?: DescriptionTemplate[]; //TODO: why it is array?
|
||||
descriptionTemplateGroupId?: Guid;
|
||||
|
@ -75,112 +75,112 @@ export interface DmpDescriptionTemplate extends BaseEntity {
|
|||
//
|
||||
// Persist
|
||||
//
|
||||
export interface DmpPersist extends BaseEntityPersist {
|
||||
export interface PlanPersist extends BaseEntityPersist {
|
||||
label: string;
|
||||
status: DmpStatus;
|
||||
properties: DmpPropertiesPersist;
|
||||
status: PlanStatus;
|
||||
properties: PlanPropertiesPersist;
|
||||
description: String;
|
||||
language: String;
|
||||
blueprint: Guid;
|
||||
accessType: DmpAccessType;
|
||||
descriptionTemplates: DmpDescriptionTemplatePersist[];
|
||||
users: DmpUserPersist[];
|
||||
accessType: PlanAccessType;
|
||||
descriptionTemplates: PlanDescriptionTemplatePersist[];
|
||||
users: PlanUserPersist[];
|
||||
}
|
||||
|
||||
export interface DmpPropertiesPersist {
|
||||
dmpBlueprintValues: Map<Guid, DmpBlueprintValuePersist>;
|
||||
contacts: DmpContactPersist[];
|
||||
export interface PlanPropertiesPersist {
|
||||
planBlueprintValues: Map<Guid, PlanBlueprintValuePersist>;
|
||||
contacts: PlanContactPersist[];
|
||||
}
|
||||
|
||||
export interface DmpBlueprintValuePersist {
|
||||
export interface PlanBlueprintValuePersist {
|
||||
fieldId: Guid;
|
||||
fieldValue: string;
|
||||
dateValue: Date;
|
||||
numberValue: number;
|
||||
references: DmpReferencePersist[];
|
||||
reference: DmpReferencePersist;
|
||||
references: PlanReferencePersist[];
|
||||
reference: PlanReferencePersist;
|
||||
}
|
||||
|
||||
export interface DmpContactPersist {
|
||||
export interface PlanContactPersist {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface DmpReferencePersist {
|
||||
export interface PlanReferencePersist {
|
||||
reference?: ReferencePersist;
|
||||
data?: DmpReferenceDataPersist;
|
||||
data?: PlanReferenceDataPersist;
|
||||
}
|
||||
|
||||
export interface DmpReferenceDataPersist {
|
||||
export interface PlanReferenceDataPersist {
|
||||
blueprintFieldId: Guid;
|
||||
}
|
||||
|
||||
export interface DmpDescriptionTemplatePersist {
|
||||
export interface PlanDescriptionTemplatePersist {
|
||||
descriptionTemplateGroupId: Guid;
|
||||
sectionId: Guid;
|
||||
}
|
||||
|
||||
export interface CloneDmpPersist {
|
||||
export interface ClonePlanPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: String;
|
||||
descriptions: Guid[];
|
||||
}
|
||||
|
||||
export interface NewVersionDmpPersist {
|
||||
export interface NewVersionPlanPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: String;
|
||||
blueprintId: Guid;
|
||||
descriptions: NewVersionDmpDescriptionPersist[];
|
||||
descriptions: NewVersionPlanDescriptionPersist[];
|
||||
hash?: string;
|
||||
}
|
||||
|
||||
export interface NewVersionDmpDescriptionPersist {
|
||||
export interface NewVersionPlanDescriptionPersist {
|
||||
descriptionId: Guid;
|
||||
blueprintSectionId: Guid;
|
||||
}
|
||||
|
||||
export interface DmpUserPersist {
|
||||
export interface PlanUserPersist {
|
||||
user: Guid;
|
||||
role: DmpUserRole;
|
||||
role: PlanUserRole;
|
||||
email: string;
|
||||
sectionId: string;
|
||||
}
|
||||
|
||||
export interface DmpUserRemovePersist {
|
||||
export interface PlanUserRemovePersist {
|
||||
id: Guid;
|
||||
dmpId: Guid;
|
||||
role: DmpUserRole;
|
||||
planId: Guid;
|
||||
role: PlanUserRole;
|
||||
}
|
||||
|
||||
export interface DmpUserInvitePersist {
|
||||
users: DmpUserPersist[];
|
||||
export interface PlanUserInvitePersist {
|
||||
users: PlanUserPersist[];
|
||||
}
|
||||
|
||||
//
|
||||
// Public
|
||||
//
|
||||
|
||||
export interface PublicDmp extends BaseDmp {
|
||||
export interface PublicPlan extends BasePlan {
|
||||
label?: string;
|
||||
version?: number;
|
||||
description?: string;
|
||||
finalizedAt?: Date;
|
||||
publishedAt?: Date;
|
||||
groupId?: String;
|
||||
accessType: DmpAccessType;
|
||||
dmpReferences: PublicDmpReference[];
|
||||
dmpUsers: PublicDmpUser[];
|
||||
accessType: PlanAccessType;
|
||||
planReferences: PublicPlanReference[];
|
||||
planUsers: PublicPlanUser[];
|
||||
descriptions: PublicDescription[];
|
||||
entityDois: PublicEntityDoi[];
|
||||
otherDmpVersions?: PublicDmp[];
|
||||
otherPlanVersions?: PublicPlan[];
|
||||
}
|
||||
|
||||
export interface PublicDmpReference {
|
||||
export interface PublicPlanReference {
|
||||
id: Guid;
|
||||
dmp: PublicDmp;
|
||||
plan: PublicPlan;
|
||||
reference: PublicReference;
|
||||
isActive?: IsActive;
|
||||
}
|
||||
|
@ -199,11 +199,11 @@ export interface PublicReferenceType {
|
|||
code: string;
|
||||
}
|
||||
|
||||
export interface PublicDmpUser {
|
||||
export interface PublicPlanUser {
|
||||
id: Guid;
|
||||
dmp: PublicDmp;
|
||||
plan: PublicPlan;
|
||||
user: PublicUser;
|
||||
role: DmpUserRole;
|
||||
role: PlanUserRole;
|
||||
}
|
||||
|
||||
export interface PublicUser {
|
||||
|
@ -219,7 +219,7 @@ export interface PublicEntityDoi {
|
|||
doi: string;
|
||||
}
|
||||
|
||||
export interface BaseDmp extends BaseEntity {
|
||||
status?: DmpStatus;
|
||||
export interface BasePlan extends BaseEntity {
|
||||
status?: PlanStatus;
|
||||
descriptions?: BaseDescription[];
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import { DescriptionTemplateField, DescriptionTemplateLabelAndMultiplicityData,
|
|||
import { DescriptionFieldPersist } from "../model/description/description";
|
||||
import { StorageFile } from "../model/storage-file/storage-file";
|
||||
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 { DateTimeFormatPipe } from "./date-time-format.pipe";
|
||||
|
||||
|
@ -19,7 +19,7 @@ export class FieldValuePipe implements PipeTransform {
|
|||
|
||||
constructor(
|
||||
private dateTimeFormatPipe: DateTimeFormatPipe,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private storageFileService: StorageFileService,
|
||||
private descriptionService: DescriptionService,
|
||||
private language: TranslateService) {
|
||||
|
@ -77,9 +77,9 @@ export class FieldValuePipe implements PipeTransform {
|
|||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: {
|
||||
const data = <DescriptionTemplateLabelAndMultiplicityData>field.data;
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Lookup } from '@common/model/lookup';
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '../common/enum/is-active.enum';
|
||||
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 { DescriptionReferenceLookup } from './reference.lookup';
|
||||
import { DescriptionTagLookup } from './tag.lookup';
|
||||
|
@ -19,7 +19,7 @@ export class DescriptionLookup extends Lookup implements DescriptionFilter {
|
|||
isActive: IsActive[];
|
||||
statuses: DescriptionStatus[];
|
||||
|
||||
dmpSubQuery: DmpLookup;
|
||||
planSubQuery: PlanLookup;
|
||||
descriptionTemplateSubQuery: DescriptionTemplateLookup;
|
||||
descriptionTagSubQuery: DescriptionTagLookup;
|
||||
descriptionReferenceSubQuery: DescriptionReferenceLookup;
|
||||
|
@ -40,7 +40,7 @@ export interface DescriptionFilter {
|
|||
isActive: IsActive[];
|
||||
statuses: DescriptionStatus[];
|
||||
|
||||
dmpSubQuery: DmpLookup;
|
||||
planSubQuery: PlanLookup;
|
||||
descriptionTemplateSubQuery: DescriptionTemplateLookup;
|
||||
descriptionTagSubQuery: DescriptionTagLookup;
|
||||
descriptionReferenceSubQuery: DescriptionReferenceLookup;
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
import { Lookup } from '@common/model/lookup';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '../common/enum/is-active.enum';
|
||||
import { DmpBlueprintStatus } from '../common/enum/plan-blueprint-status';
|
||||
import { DmpBlueprintVersionStatus } from '../common/enum/plan-blueprint-version-status';
|
||||
import { PlanBlueprintStatus } from '../common/enum/plan-blueprint-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[];
|
||||
excludedIds: Guid[];
|
||||
like: string;
|
||||
isActive: IsActive[];
|
||||
statuses: DmpBlueprintStatus[];
|
||||
statuses: PlanBlueprintStatus[];
|
||||
groupIds: Guid[];
|
||||
versionStatuses: DmpBlueprintVersionStatus[];
|
||||
versionStatuses: PlanBlueprintVersionStatus[];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
export interface DmpBlueprintFilter {
|
||||
export interface PlanBlueprintFilter {
|
||||
ids: Guid[];
|
||||
excludedIds: Guid[];
|
||||
like: string;
|
||||
isActive: IsActive[];
|
||||
statuses: DmpBlueprintStatus[];
|
||||
versionStatuses: DmpBlueprintVersionStatus[];
|
||||
statuses: PlanBlueprintStatus[];
|
||||
versionStatuses: PlanBlueprintVersionStatus[];
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@ import { Lookup } from '@common/model/lookup';
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '../common/enum/is-active.enum';
|
||||
|
||||
export class DmpDescriptionTemplateLookup extends Lookup implements DmpDescriptionTemplateFilter {
|
||||
export class PlanDescriptionTemplateLookup extends Lookup implements PlanDescriptionTemplateFilter {
|
||||
ids: Guid[];
|
||||
excludedIds: Guid[];
|
||||
dmpIds: Guid[];
|
||||
planIds: Guid[];
|
||||
descriptionTemplateGroupIds: Guid[];
|
||||
sectionIds: Guid[];
|
||||
isActive: IsActive[];
|
||||
|
@ -16,10 +16,10 @@ export class DmpDescriptionTemplateLookup extends Lookup implements DmpDescripti
|
|||
}
|
||||
}
|
||||
|
||||
export interface DmpDescriptionTemplateFilter {
|
||||
export interface PlanDescriptionTemplateFilter {
|
||||
ids: Guid[];
|
||||
excludedIds: Guid[];
|
||||
dmpIds: Guid[];
|
||||
planIds: Guid[];
|
||||
descriptionTemplateGroupIds: Guid[];
|
||||
sectionIds: Guid[];
|
||||
isActive: IsActive[];
|
||||
|
|
|
@ -2,10 +2,10 @@ import { Guid } from "@common/types/guid";
|
|||
import { IsActive } from "../common/enum/is-active.enum";
|
||||
import { Lookup } from "@common/model/lookup";
|
||||
|
||||
export class DmpUserLookup extends Lookup implements DmpUserFilter {
|
||||
export class PlanUserLookup extends Lookup implements PlanUserFilter {
|
||||
ids: Guid[];
|
||||
isActive: IsActive[];
|
||||
dmpIds: Guid[];
|
||||
planIds: Guid[];
|
||||
userIds: Guid[];
|
||||
sectionIds: Guid[];
|
||||
userRoles: Guid[];
|
||||
|
@ -15,11 +15,11 @@ export class DmpUserLookup extends Lookup implements DmpUserFilter {
|
|||
}
|
||||
}
|
||||
|
||||
export interface DmpUserFilter {
|
||||
export interface PlanUserFilter {
|
||||
ids: Guid[];
|
||||
isActive: IsActive[];
|
||||
|
||||
dmpIds: Guid[];
|
||||
planIds: Guid[];
|
||||
userIds: Guid[];
|
||||
sectionIds: Guid[];
|
||||
userRoles: Guid[];
|
||||
|
|
|
@ -1,47 +1,48 @@
|
|||
import { Lookup } from '@common/model/lookup';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { DmpAccessType } from '../common/enum/plan-access-type';
|
||||
import { DmpStatus } from '../common/enum/plan-status';
|
||||
import { DmpVersionStatus } from '../common/enum/plan-version-status';
|
||||
import { PlanAccessType } from '../common/enum/plan-access-type';
|
||||
import { PlanStatus } from '../common/enum/plan-status';
|
||||
import { PlanVersionStatus } from '../common/enum/plan-version-status';
|
||||
import { IsActive } from '../common/enum/is-active.enum';
|
||||
import { DmpDescriptionTemplateLookup } from './plan-description-template.lookup';
|
||||
import { DmpUserLookup } from './plan-user.lookup';
|
||||
import { DmpBlueprintLookup } from './plan-blueprint.lookup';
|
||||
import { DmpReferenceLookup } from './reference.lookup';
|
||||
import { PlanDescriptionTemplateLookup } from './plan-description-template.lookup';
|
||||
import { PlanUserLookup } from './plan-user.lookup';
|
||||
import { PlanBlueprintLookup } from './plan-blueprint.lookup';
|
||||
import { PlanReferenceLookup } from './reference.lookup';
|
||||
|
||||
export class DmpLookup extends Lookup implements DmpFilter {
|
||||
export class PlanLookup extends Lookup implements PlanFilter {
|
||||
ids: Guid[];
|
||||
excludedIds: Guid[];
|
||||
like: string;
|
||||
isActive: IsActive[];
|
||||
versionStatuses: DmpVersionStatus[];
|
||||
statuses: DmpStatus[];
|
||||
accessTypes: DmpAccessType[];
|
||||
versionStatuses: PlanVersionStatus[];
|
||||
statuses: PlanStatus[];
|
||||
accessTypes: PlanAccessType[];
|
||||
versions: Number[];
|
||||
groupIds: Guid[];
|
||||
|
||||
dmpUserSubQuery: DmpUserLookup;
|
||||
dmpBlueprintSubQuery: DmpBlueprintLookup;
|
||||
dmpDescriptionTemplateSubQuery: DmpDescriptionTemplateLookup;
|
||||
dmpReferenceSubQuery: DmpReferenceLookup
|
||||
planUserSubQuery: PlanUserLookup;
|
||||
planBlueprintSubQuery: PlanBlueprintLookup;
|
||||
planDescriptionTemplateSubQuery: PlanDescriptionTemplateLookup;
|
||||
planReferenceSubQuery: PlanReferenceLookup;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
export interface DmpFilter {
|
||||
export interface PlanFilter {
|
||||
ids: Guid[];
|
||||
excludedIds: Guid[];
|
||||
like: string;
|
||||
isActive: IsActive[];
|
||||
versionStatuses: DmpVersionStatus[];
|
||||
statuses: DmpStatus[];
|
||||
accessTypes: DmpAccessType[];
|
||||
versionStatuses: PlanVersionStatus[];
|
||||
statuses: PlanStatus[];
|
||||
accessTypes: PlanAccessType[];
|
||||
versions: Number[];
|
||||
groupIds: Guid[];
|
||||
|
||||
dmpUserSubQuery: DmpUserLookup;
|
||||
dmpBlueprintSubQuery: DmpBlueprintLookup;
|
||||
dmpDescriptionTemplateSubQuery: DmpDescriptionTemplateLookup;
|
||||
planUserSubQuery: PlanUserLookup;
|
||||
planBlueprintSubQuery: PlanBlueprintLookup;
|
||||
planDescriptionTemplateSubQuery: PlanDescriptionTemplateLookup;
|
||||
planReferenceSubQuery: PlanReferenceLookup;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,8 @@ export class DescriptionReferenceLookup extends Lookup {
|
|||
}
|
||||
}
|
||||
|
||||
export class DmpReferenceLookup extends Lookup {
|
||||
export class PlanReferenceLookup extends Lookup {
|
||||
planIds: Guid[];
|
||||
referenceIds: Guid[];
|
||||
excludedIds: Guid[];
|
||||
like: string;
|
||||
|
|
|
@ -25,10 +25,10 @@ export class FileTransformerHttpService extends BaseService {
|
|||
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
|
||||
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> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { FileUtils } from '../utilities/file-utils.service';
|
|||
import { AuthService } from '../auth/auth.service';
|
||||
import { RepositoryFileFormat } from '@app/core/model/file/file-format.model';
|
||||
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 { AnalyticsService } from '../matomo/analytics-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 analyticsService: AnalyticsService,
|
||||
private fileUtils: FileUtils,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private descriptionService: DescriptionService,
|
||||
private authentication: AuthService,
|
||||
private httpErrorHandlingService: HttpErrorHandlingService
|
||||
|
@ -70,7 +70,7 @@ export class FileTransformerService extends BaseService {
|
|||
exportDmp(id: Guid, repositoryId: string, format: string) {
|
||||
this._loading = true;
|
||||
if (repositoryId == this.xmlExportRepo.repositoryId) {
|
||||
this.dmpService.downloadXML(id)
|
||||
this.planService.downloadXML(id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'application/xml' });
|
||||
|
|
|
@ -11,8 +11,8 @@ export class AnalyticsService {
|
|||
public static About: string = 'About';
|
||||
public static DescriptionTemplateEditor: string = 'Admin: DMP Blueprints';
|
||||
public static DescriptionTemplateListing: string = 'Admin: DMP Templates';
|
||||
public static DmpBlueprintEditor: string = 'Admin: DMP Blueprints';
|
||||
public static DmpBlueprintListing: string = 'Admin: DMP Templates';
|
||||
public static PlanBlueprintEditor: string = 'Admin: DMP Blueprints';
|
||||
public static PlanBlueprintListing: string = 'Admin: DMP Templates';
|
||||
public static LanguagesEditor: string = 'Admin: Languages';
|
||||
public static PrefillingSourcesEditor: string = 'Admin: PrefillingSources';
|
||||
public static ReferencesEditor: string = 'Admin: References';
|
||||
|
@ -29,11 +29,11 @@ export class AnalyticsService {
|
|||
public static DescriptionFilterDialog: string = 'Dataset Criteria';
|
||||
public static DescriptionListingItem: string = 'Description Listing Item';
|
||||
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 DmpFilterDialog: string = 'DMP Criteria';
|
||||
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 DmpOverview: string = 'DMP Overview';
|
||||
public static FAQ: string = 'FAQ';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
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 { DmpBlueprintLookup } from '@app/core/query/plan-blueprint.lookup';
|
||||
import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection, PlanBlueprintPersist, NewVersionPlanBlueprintPersist } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { PlanBlueprintLookup } from '@app/core/query/plan-blueprint.lookup';
|
||||
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 { BaseHttpParams } from '@common/http/base-http-params';
|
||||
|
@ -15,13 +15,13 @@ import { catchError, map } from 'rxjs/operators';
|
|||
import { nameof } from 'ts-simple-nameof';
|
||||
import { ConfigurationService } from '../configuration/configuration.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 { 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';
|
||||
|
||||
@Injectable()
|
||||
export class DmpBlueprintService {
|
||||
export class PlanBlueprintService {
|
||||
|
||||
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`;
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.get<DmpBlueprint>(url, options).pipe(
|
||||
.get<PlanBlueprint>(url, options).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
persist(item: DmpBlueprintPersist): Observable<DmpBlueprint> {
|
||||
persist(item: PlanBlueprintPersist): Observable<PlanBlueprint> {
|
||||
const url = `${this.apiBase}/persist`;
|
||||
|
||||
return this.http
|
||||
.post<DmpBlueprint>(url, item).pipe(
|
||||
.post<PlanBlueprint>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
delete(id: Guid): Observable<DmpBlueprint> {
|
||||
delete(id: Guid): Observable<PlanBlueprint> {
|
||||
const url = `${this.apiBase}/${id}`;
|
||||
|
||||
return this.http
|
||||
.delete<DmpBlueprint>(url).pipe(
|
||||
.delete<PlanBlueprint>(url).pipe(
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.get<DmpBlueprint>(url, options).pipe(
|
||||
.get<PlanBlueprint>(url, options).pipe(
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.post<DmpBlueprint>(url, item).pipe(
|
||||
.post<PlanBlueprint>(url, item).pipe(
|
||||
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 });
|
||||
}
|
||||
|
||||
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 params = new BaseHttpParams();
|
||||
params.interceptorContext = {
|
||||
|
@ -108,9 +108,9 @@ export class DmpBlueprintService {
|
|||
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)),
|
||||
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: DmpBlueprint) => item.label,
|
||||
titleFn: (item: DmpBlueprint) => item.label,
|
||||
valueAssign: (item: DmpBlueprint) => item.id,
|
||||
displayFn: (item: PlanBlueprint) => item.label,
|
||||
titleFn: (item: PlanBlueprint) => item.label,
|
||||
valueAssign: (item: PlanBlueprint) => item.id,
|
||||
};
|
||||
|
||||
// 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)),
|
||||
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)),
|
||||
displayFn: (item: DmpBlueprint) => item.label,
|
||||
titleFn: (item: DmpBlueprint) => item.label,
|
||||
valueAssign: (item: DmpBlueprint) => item.id,
|
||||
displayFn: (item: PlanBlueprint) => item.label,
|
||||
titleFn: (item: PlanBlueprint) => item.label,
|
||||
valueAssign: (item: PlanBlueprint) => item.id,
|
||||
};
|
||||
|
||||
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpBlueprintStatus[]): DmpBlueprintLookup {
|
||||
const lookup: DmpBlueprintLookup = new DmpBlueprintLookup();
|
||||
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanBlueprintStatus[]): PlanBlueprintLookup {
|
||||
const lookup: PlanBlueprintLookup = new PlanBlueprintLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
|
||||
if (ids && ids.length > 0) { lookup.ids = ids; }
|
||||
|
@ -132,30 +132,30 @@ export class DmpBlueprintService {
|
|||
lookup.statuses = statuses;
|
||||
lookup.project = {
|
||||
fields: [
|
||||
nameof<DmpBlueprint>(x => x.id),
|
||||
nameof<DmpBlueprint>(x => x.label),
|
||||
nameof<DmpBlueprint>(x => x.version)
|
||||
nameof<PlanBlueprint>(x => x.id),
|
||||
nameof<PlanBlueprint>(x => x.label),
|
||||
nameof<PlanBlueprint>(x => x.version)
|
||||
]
|
||||
};
|
||||
lookup.order = { items: [nameof<DmpBlueprint>(x => x.label)] };
|
||||
lookup.versionStatuses = [DmpBlueprintVersionStatus.Current];
|
||||
lookup.order = { items: [nameof<PlanBlueprint>(x => x.label)] };
|
||||
lookup.versionStatuses = [PlanBlueprintVersionStatus.Current];
|
||||
if (like) { lookup.like = this.filterService.transformLike(like); }
|
||||
return lookup;
|
||||
}
|
||||
|
||||
// Finalized Blueprint with definitions Single AutoComplete
|
||||
singleAutocompleteBlueprintConfiguration: SingleAutoCompleteConfiguration = {
|
||||
initialItems: (data?: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, null, [DmpBlueprintStatus.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)),
|
||||
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, [PlanBlueprintStatus.Finalized])).pipe(map(x => x.items)),
|
||||
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteWithDefinitonLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: DmpBlueprint) => item.label,
|
||||
subtitleFn: (item: DmpBlueprint) => this.language.instant('DMP-EDITOR.FIELDS.DMP-BLUEPRINT-VERSION') + ' '+ item.version,
|
||||
titleFn: (item: DmpBlueprint) => item.label,
|
||||
valueAssign: (item: DmpBlueprint) => item.id,
|
||||
displayFn: (item: PlanBlueprint) => item.label,
|
||||
subtitleFn: (item: PlanBlueprint) => this.language.instant('Plan-EDITOR.FIELDS.Plan-BLUEPRINT-VERSION') + ' '+ item.version,
|
||||
titleFn: (item: PlanBlueprint) => item.label,
|
||||
valueAssign: (item: PlanBlueprint) => item.id,
|
||||
};
|
||||
|
||||
public buildAutocompleteWithDefinitonLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpBlueprintStatus[]): DmpBlueprintLookup {
|
||||
const lookup: DmpBlueprintLookup = new DmpBlueprintLookup();
|
||||
public buildAutocompleteWithDefinitonLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanBlueprintStatus[]): PlanBlueprintLookup {
|
||||
const lookup: PlanBlueprintLookup = new PlanBlueprintLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
|
||||
if (ids && ids.length > 0) { lookup.ids = ids; }
|
||||
|
@ -163,17 +163,17 @@ export class DmpBlueprintService {
|
|||
lookup.statuses = statuses;
|
||||
lookup.project = {
|
||||
fields: [
|
||||
nameof<DmpBlueprint>(x => x.id),
|
||||
nameof<DmpBlueprint>(x => x.label),
|
||||
nameof<DmpBlueprint>(x => x.version),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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.id),
|
||||
nameof<PlanBlueprint>(x => x.label),
|
||||
nameof<PlanBlueprint>(x => x.version),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].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.versionStatuses = [DmpBlueprintVersionStatus.Previous, DmpBlueprintVersionStatus.Current];
|
||||
lookup.order = { items: [nameof<PlanBlueprint>(x => x.label)] };
|
||||
lookup.versionStatuses = [PlanBlueprintVersionStatus.Previous, PlanBlueprintVersionStatus.Current];
|
||||
if (like) { lookup.like = this.filterService.transformLike(like); }
|
||||
return lookup;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ export class DmpBlueprintService {
|
|||
//
|
||||
//
|
||||
|
||||
getSection(dmpBlueprint: DmpBlueprint, sectionId: Guid): DmpBlueprintDefinitionSection {
|
||||
return dmpBlueprint?.definition?.sections?.find(x => x.id === sectionId);
|
||||
getSection(PlanBlueprint: PlanBlueprint, sectionId: Guid): PlanBlueprintDefinitionSection {
|
||||
return PlanBlueprint?.definition?.sections?.find(x => x.id === sectionId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { HttpClient, HttpHeaders, HttpParamsOptions, HttpResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DmpStatus } from '@app/core/common/enum/plan-status';
|
||||
import { DmpUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { PlanStatus } from '@app/core/common/enum/plan-status';
|
||||
import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { DmpDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
|
||||
import { DmpLookup } from '@app/core/query/plan.lookup';
|
||||
import { PlanDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
|
||||
import { PlanLookup } from '@app/core/query/plan.lookup';
|
||||
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 { QueryResult } from '@common/model/query-result';
|
||||
|
@ -15,15 +15,15 @@ import { catchError, map } from 'rxjs/operators';
|
|||
import { nameof } from 'ts-simple-nameof';
|
||||
import { BaseHttpParams } from '../../../../common/http/base-http-params';
|
||||
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 { ConfigurationService } from '../configuration/configuration.service';
|
||||
import { BaseHttpV2Service } from '../http/base-http-v2.service';
|
||||
import { DmpValidationResult } from '@app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component';
|
||||
import { DmpCommonModelConfig, PreprocessingDmpModel } from '@app/core/model/plan/plan-import';
|
||||
import { PlanValidationResult } from '@app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component';
|
||||
import { PlanCommonModelConfig, PreprocessingPlanModel } from '@app/core/model/plan/plan-import';
|
||||
|
||||
@Injectable()
|
||||
export class DmpService {
|
||||
export class PlanService {
|
||||
|
||||
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`;
|
||||
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 params = new BaseHttpParams();
|
||||
params.interceptorContext = {
|
||||
excludedInterceptors: [InterceptorType.AuthToken,
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.get<Dmp>(url, options).pipe(
|
||||
.get<Plan>(url, options).pipe(
|
||||
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 options: HttpParamsOptions = { fromObject: { f: reqFields } };
|
||||
|
@ -74,23 +74,23 @@ export class DmpService {
|
|||
};
|
||||
|
||||
return this.http
|
||||
.get<PublicDmp>(url, { params: params }).pipe(
|
||||
.get<PublicPlan>(url, { params: params }).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
persist(item: DmpPersist): Observable<Dmp> {
|
||||
persist(item: PlanPersist): Observable<Plan> {
|
||||
const url = `${this.apiBase}/persist`;
|
||||
|
||||
return this.http
|
||||
.post<Dmp>(url, item).pipe(
|
||||
.post<Plan>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
delete(id: Guid): Observable<Dmp> {
|
||||
delete(id: Guid): Observable<Plan> {
|
||||
const url = `${this.apiBase}/${id}`;
|
||||
|
||||
return this.http
|
||||
.delete<Dmp>(url).pipe(
|
||||
.delete<Plan>(url).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
|
@ -112,59 +112,59 @@ export class DmpService {
|
|||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
validate(id: Guid): Observable<DmpValidationResult> {
|
||||
validate(id: Guid): Observable<PlanValidationResult> {
|
||||
const url = `${this.apiBase}/validate/${id}`;
|
||||
|
||||
return this.http
|
||||
.get<DmpValidationResult>(url).pipe(
|
||||
.get<PlanValidationResult>(url).pipe(
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.post<Dmp>(url, item, options).pipe(
|
||||
.post<Plan>(url, item, options).pipe(
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.post<Dmp>(url, item, options ).pipe(
|
||||
.post<Plan>(url, item, options ).pipe(
|
||||
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 options = { params: { f: reqFields } };
|
||||
|
||||
return this.http
|
||||
.post<DmpUser>(url, items).pipe(
|
||||
.post<PlanUser>(url, items).pipe(
|
||||
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`;
|
||||
|
||||
return this.http
|
||||
.post<Dmp>(url, item).pipe(
|
||||
.post<Plan>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
inviteUsers(dmpId: Guid, item: DmpUserInvitePersist): Observable<any> {
|
||||
const url = `${this.apiBase}/${dmpId}/invite-users`;
|
||||
inviteUsers(PlanId: Guid, item: PlanUserInvitePersist): Observable<any> {
|
||||
const url = `${this.apiBase}/${PlanId}/invite-users`;
|
||||
|
||||
return this.http
|
||||
.post<any>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
acceptInvitation(dmpId: Guid, token: string): Observable<any> {
|
||||
const url = `${this.apiBase}/${dmpId}/token/${token}/invite-accept`;
|
||||
acceptInvitation(PlanId: Guid, token: string): Observable<any> {
|
||||
const url = `${this.apiBase}/${PlanId}/token/${token}/invite-accept`;
|
||||
|
||||
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 });
|
||||
}
|
||||
|
||||
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 params = new BaseHttpParams();
|
||||
params.interceptorContext = {
|
||||
|
@ -198,7 +198,7 @@ export class DmpService {
|
|||
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 params = new BaseHttpParams();
|
||||
|
||||
|
@ -209,13 +209,13 @@ export class DmpService {
|
|||
formData.append('fileId', fileId.toString());
|
||||
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`;
|
||||
|
||||
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)),
|
||||
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])),
|
||||
displayFn: (item: Dmp) => item.label,
|
||||
titleFn: (item: Dmp) => item.label,
|
||||
valueAssign: (item: Dmp) => item.id,
|
||||
displayFn: (item: Plan) => item.label,
|
||||
titleFn: (item: Plan) => item.label,
|
||||
valueAssign: (item: Plan) => item.id,
|
||||
};
|
||||
|
||||
// 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)),
|
||||
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)),
|
||||
displayFn: (item: Dmp) => item.label,
|
||||
titleFn: (item: Dmp) => item.label,
|
||||
valueAssign: (item: Dmp) => item.id,
|
||||
displayFn: (item: Plan) => item.label,
|
||||
titleFn: (item: Plan) => item.label,
|
||||
valueAssign: (item: Plan) => item.id,
|
||||
};
|
||||
|
||||
public buildAutocompleteLookup(isActive: IsActive[], like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpStatus[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup {
|
||||
const lookup: DmpLookup = new DmpLookup();
|
||||
public buildAutocompleteLookup(isActive: IsActive[], like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanStatus[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
|
||||
const lookup: PlanLookup = new PlanLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
|
||||
if (ids && ids.length > 0) { lookup.ids = ids; }
|
||||
|
@ -251,12 +251,12 @@ export class DmpService {
|
|||
lookup.statuses = statuses;
|
||||
lookup.project = {
|
||||
fields: [
|
||||
nameof<Dmp>(x => x.id),
|
||||
nameof<Dmp>(x => x.label)
|
||||
nameof<Plan>(x => x.id),
|
||||
nameof<Plan>(x => x.label)
|
||||
]
|
||||
};
|
||||
if (dmpDescriptionTemplateSubQuery != null) lookup.dmpDescriptionTemplateSubQuery = dmpDescriptionTemplateSubQuery;
|
||||
lookup.order = { items: [nameof<Dmp>(x => x.label)] };
|
||||
if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
|
||||
lookup.order = { items: [nameof<Plan>(x => x.label)] };
|
||||
if (like) { lookup.like = this.filterService.transformLike(like); }
|
||||
return lookup;
|
||||
}
|
||||
|
@ -267,12 +267,12 @@ export class DmpService {
|
|||
//
|
||||
//
|
||||
|
||||
getCurrentUserRolesInDmp(dmpUsers: DmpUser[]): DmpUserRole[] {
|
||||
getCurrentUserRolesInPlan(planUsers: PlanUser[]): PlanUserRole[] {
|
||||
const principalId: Guid = this.authService.userId();
|
||||
let dmpUserRoles: DmpUserRole[] = null;
|
||||
let planUserRoles: PlanUserRole[] = null;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
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 { ReferenceSearchDefinitionLookup, ReferenceSearchLookup } from '@app/core/query/reference-search.lookup';
|
||||
import { ReferenceLookup } from '@app/core/query/reference.lookup';
|
||||
|
@ -184,15 +184,15 @@ export class ReferenceService {
|
|||
//
|
||||
//
|
||||
|
||||
hasRerefenceOfTypes(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): boolean {
|
||||
return this.getReferencesForTypes(dmpReferences, referenceTypeIds)?.length > 0;
|
||||
hasRerefenceOfTypes(planReferences: PlanReference[], referenceTypeIds?: Guid[]): boolean {
|
||||
return this.getReferencesForTypes(planReferences, referenceTypeIds)?.length > 0;
|
||||
}
|
||||
|
||||
getReferencesForTypes(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): DmpReference[] {
|
||||
return dmpReferences?.filter(x => referenceTypeIds?.includes(x?.reference?.type?.id)).filter(x=> x.isActive === IsActive.Active);;
|
||||
getReferencesForTypes(planReferences: PlanReference[], referenceTypeIds?: Guid[]): PlanReference[] {
|
||||
return planReferences?.filter(x => referenceTypeIds?.includes(x?.reference?.type?.id)).filter(x=> x.isActive === IsActive.Active);;
|
||||
}
|
||||
|
||||
getReferencesForTypesFirstSafe(dmpReferences: DmpReference[], referenceTypeIds?: Guid[]): DmpReference {
|
||||
return this.getReferencesForTypes(dmpReferences, referenceTypeIds)?.find(Boolean);
|
||||
getReferencesForTypesFirstSafe(planReferences: PlanReference[], referenceTypeIds?: Guid[]): PlanReference {
|
||||
return this.getReferencesForTypes(planReferences, referenceTypeIds)?.find(Boolean);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ export class UserService {
|
|||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,12 @@ import { DescriptionTemplateFieldDataExternalDatasetType } from '@app/core/commo
|
|||
import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type';
|
||||
import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status';
|
||||
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
|
||||
import { DmpAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { DmpBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
|
||||
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
|
||||
import { DmpUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { DmpUserType } from '@app/core/common/enum/plan-user-type';
|
||||
import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { PlanBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
|
||||
import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { PlanBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
|
||||
import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { PlanUserType } from '@app/core/common/enum/plan-user-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 { 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 { TranslateService } from '@ngx-translate/core';
|
||||
import { AppRole } from '../../common/enum/app-role';
|
||||
import { DmpBlueprintExtraFieldDataType } from '../../common/enum/plan-blueprint-field-type';
|
||||
import { DmpStatus } from '../../common/enum/plan-status';
|
||||
import { PlanBlueprintExtraFieldDataType } from '../../common/enum/plan-blueprint-field-type';
|
||||
import { PlanStatus } from '../../common/enum/plan-status';
|
||||
import { ValidationType } from '../../common/enum/validation-type';
|
||||
|
||||
@Injectable()
|
||||
|
@ -46,6 +46,7 @@ export class EnumUtils {
|
|||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
toIsActiveString(status: IsActive): string {
|
||||
switch (status) {
|
||||
|
@ -66,10 +67,10 @@ export class EnumUtils {
|
|||
}
|
||||
}
|
||||
|
||||
toDmpStatusString(status: DmpStatus): string {
|
||||
toPlanStatusString(status: PlanStatus): string {
|
||||
switch (status) {
|
||||
case DmpStatus.Draft: return this.language.instant('TYPES.DMP.DRAFT');
|
||||
case DmpStatus.Finalized: return this.language.instant('TYPES.DMP.FINALISED');
|
||||
case PlanStatus.Draft: return this.language.instant('TYPES.PLAN.DRAFT');
|
||||
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) {
|
||||
case DmpBlueprintStatus.Draft: return this.language.instant('TYPES.DMP-BLUEPRINT-STATUS.DRAFT');
|
||||
case DmpBlueprintStatus.Finalized: return this.language.instant('TYPES.DMP-BLUEPRINT-STATUS.FINALIZED');
|
||||
case PlanBlueprintStatus.Draft: return this.language.instant('TYPES.PLAN-BLUEPRINT-STATUS.DRAFT');
|
||||
case PlanBlueprintStatus.Finalized: return this.language.instant('TYPES.PLAN-BLUEPRINT-STATUS.FINALIZED');
|
||||
}
|
||||
}
|
||||
|
||||
toDmpBlueprintSystemFieldTypeString(status: DmpBlueprintSystemFieldType): string {
|
||||
toPlanBlueprintSystemFieldTypeString(status: PlanBlueprintSystemFieldType): string {
|
||||
switch (status) {
|
||||
case DmpBlueprintSystemFieldType.Title: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.TITLE');
|
||||
case DmpBlueprintSystemFieldType.Description: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.DESCRIPTION');
|
||||
case DmpBlueprintSystemFieldType.Language: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.LANGUAGE');
|
||||
case DmpBlueprintSystemFieldType.Contact: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.CONTACT');
|
||||
case DmpBlueprintSystemFieldType.AccessRights: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.ACCESS_RIGHTS');
|
||||
case DmpBlueprintSystemFieldType.User: return this.language.instant('TYPES.DMP-BLUEPRINT-SYSTEM-FIELD-TYPE.USER');
|
||||
case PlanBlueprintSystemFieldType.Title: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.TITLE');
|
||||
case PlanBlueprintSystemFieldType.Description: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.DESCRIPTION');
|
||||
case PlanBlueprintSystemFieldType.Language: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.LANGUAGE');
|
||||
case PlanBlueprintSystemFieldType.Contact: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.CONTACT');
|
||||
case PlanBlueprintSystemFieldType.AccessRights: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.ACCESS_RIGHTS');
|
||||
case PlanBlueprintSystemFieldType.User: return this.language.instant('TYPES.PLAN-BLUEPRINT-SYSTEM-FIELD-TYPE.USER');
|
||||
}
|
||||
}
|
||||
|
||||
toDmpBlueprintExtraFieldDataTypeString(status: DmpBlueprintExtraFieldDataType): string {
|
||||
toPlanBlueprintExtraFieldDataTypeString(status: PlanBlueprintExtraFieldDataType): string {
|
||||
switch (status) {
|
||||
case DmpBlueprintExtraFieldDataType.Text: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.TEXT');
|
||||
case DmpBlueprintExtraFieldDataType.RichText: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.RICH-TEXT');
|
||||
case DmpBlueprintExtraFieldDataType.Date: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.DATE');
|
||||
case DmpBlueprintExtraFieldDataType.Number: return this.language.instant('TYPES.DMP-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.NUMBER');
|
||||
case PlanBlueprintExtraFieldDataType.Text: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.TEXT');
|
||||
case PlanBlueprintExtraFieldDataType.RichText: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.RICH-TEXT');
|
||||
case PlanBlueprintExtraFieldDataType.Date: return this.language.instant('TYPES.PLAN-BLUEPRINT-EXTRA-FIELD-DATA-TYPE.DATE');
|
||||
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.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.INTERNAL_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS');
|
||||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DESCRIPTIONS');
|
||||
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-PLAN-ENTITIES-DESCRIPTIONS');
|
||||
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.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(', ') }
|
||||
toDmpUserRoleString(role: DmpUserRole): string {
|
||||
toPlanUserRolesString(roles: PlanUserRole[]): string { return roles.map(x => this.toPlanUserRoleString(x)).join(', ') }
|
||||
toPlanUserRoleString(role: PlanUserRole): string {
|
||||
switch (role) {
|
||||
case DmpUserRole.Owner: return this.language.instant('TYPES.DMP-USER-ROLE.OWNER');
|
||||
case DmpUserRole.Viewer: return this.language.instant('TYPES.DMP-USER-ROLE.VIEWER');
|
||||
case DmpUserRole.DescriptionContributor: return this.language.instant('TYPES.DMP-USER-ROLE.DESCRIPTION-CONTRIBUTOR');
|
||||
case DmpUserRole.Reviewer: return this.language.instant('TYPES.DMP-USER-ROLE.REVIEWER');
|
||||
case PlanUserRole.Owner: return this.language.instant('TYPES.PLAN-USER-ROLE.OWNER');
|
||||
case PlanUserRole.Viewer: return this.language.instant('TYPES.PLAN-USER-ROLE.VIEWER');
|
||||
case PlanUserRole.DescriptionContributor: return this.language.instant('TYPES.PLAN-USER-ROLE.DESCRIPTION-CONTRIBUTOR');
|
||||
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) {
|
||||
case DmpAccessType.Public: return this.language.instant('TYPES.DMP-ACCESS-TYPE.PUBLIC');
|
||||
case DmpAccessType.Restricted: return this.language.instant('TYPES.DMP-ACCESS-TYPE.RESTRICTED');
|
||||
case PlanAccessType.Public: return this.language.instant('TYPES.PLAN-ACCESS-TYPE.PUBLIC');
|
||||
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) {
|
||||
case DmpUserType.Internal: return this.language.instant('TYPES.DMP-USER-TYPE.INTERNAL');
|
||||
case DmpUserType.External: return this.language.instant('TYPES.DMP-USER-TYPE.EXTERNAL');
|
||||
case PlanUserType.Internal: return this.language.instant('TYPES.PLAN-USER-TYPE.INTERNAL');
|
||||
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) {
|
||||
case DmpBlueprintFieldCategory.System: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.SYSTEM');
|
||||
case DmpBlueprintFieldCategory.Extra: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.EXTRA');
|
||||
case DmpBlueprintFieldCategory.ReferenceType: return this.language.instant('TYPES.DMP-BLUEPRINT-FIELD-CATEGORY.REFERENCE-TYPE');
|
||||
case PlanBlueprintFieldCategory.System: return this.language.instant('TYPES.PLAN-BLUEPRINT-FIELD-CATEGORY.SYSTEM');
|
||||
case PlanBlueprintFieldCategory.Extra: return this.language.instant('TYPES.PLAN-BLUEPRINT-FIELD-CATEGORY.EXTRA');
|
||||
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 {
|
||||
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.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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<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="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'">
|
||||
|
@ -73,7 +73,7 @@
|
|||
</mat-form-field>
|
||||
</div>
|
||||
<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="hint">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-LANGUAGE-HINT'| translate}}</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
|
@ -229,7 +229,7 @@
|
|||
<div class="row w-100 justify-content-center">
|
||||
<div class="col-auto">
|
||||
{{'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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<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)="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>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
<div class="col-md-10 offset-md-1">
|
||||
<div class="row align-items-center mt-4 mb-4" *ngIf="formGroup">
|
||||
<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">
|
||||
<span>{{'DMP-BLUEPRINT-EDITOR.TITLE.CLONE' | translate}}</span>
|
||||
<span>{{'PLAN-BLUEPRINT-EDITOR.TITLE.CLONE' | translate}}</span>
|
||||
{{formGroup.get('label').value}}
|
||||
</h3>
|
||||
<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}}
|
||||
</h3> -->
|
||||
<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">
|
||||
<button [disabled]="isLocked" mat-button class="action-btn" type="button" (click)="delete()">
|
||||
<mat-icon>delete</mat-icon>
|
||||
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}}
|
||||
{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<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 *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>
|
||||
<form *ngIf="formGroup">
|
||||
|
@ -34,14 +34,14 @@
|
|||
<div class="row">
|
||||
<div class="col-6">
|
||||
<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>
|
||||
<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-form-field>
|
||||
</div>
|
||||
<h4 class="col-12">{{'DMP-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
|
||||
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'DMP-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
|
||||
<h4 class="col-12">{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
|
||||
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
|
||||
</h4>
|
||||
<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">
|
||||
|
@ -50,12 +50,12 @@
|
|||
<mat-card-header>
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<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 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">
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -65,7 +65,7 @@
|
|||
<div class="row">
|
||||
<div class="col-6">
|
||||
<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>
|
||||
<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>
|
||||
|
@ -73,14 +73,14 @@
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<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')">
|
||||
<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-form-field>
|
||||
</div>
|
||||
<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 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>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -107,9 +107,9 @@
|
|||
<div class="row align-items-center">
|
||||
<div class="col-12 col-xl-4">
|
||||
<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-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-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>
|
||||
|
@ -117,9 +117,9 @@
|
|||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.System">
|
||||
<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-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-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>
|
||||
|
@ -127,10 +127,10 @@
|
|||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.Extra">
|
||||
<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-option *ngFor="let extraFieldDataType of dmpBlueprintExtraFieldDataTypeEnum" [value]="extraFieldDataType">
|
||||
{{enumUtils.toDmpBlueprintExtraFieldDataTypeString(extraFieldDataType)}}
|
||||
<mat-option *ngFor="let extraFieldDataType of planBlueprintExtraFieldDataTypeEnum" [value]="extraFieldDataType">
|
||||
{{enumUtils.toPlanBlueprintExtraFieldDataTypeString(extraFieldDataType)}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="field.get('dataType').hasError('backendError')">{{field.get('dataType').getError('backendError').message}}</mat-error>
|
||||
|
@ -139,15 +139,15 @@
|
|||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
|
||||
<mat-form-field class="mt-3 w-100">
|
||||
<mat-label>{{'DMP-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>
|
||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label>
|
||||
<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('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
|
||||
<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')">
|
||||
<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>
|
||||
|
@ -155,7 +155,7 @@
|
|||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
|
||||
<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')">
|
||||
<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>
|
||||
|
@ -163,7 +163,7 @@
|
|||
</div>
|
||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value != null">
|
||||
<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')">
|
||||
<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>
|
||||
|
@ -171,21 +171,21 @@
|
|||
</div>
|
||||
<div class="col-12 order-xl-8" *ngIf="field.get('category').value != null">
|
||||
<mat-form-field class="mt-3 w-100">
|
||||
<mat-label>{{'DMP-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">
|
||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SEMANTICS' | translate}}</mat-label>
|
||||
<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>
|
||||
<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-form-field>
|
||||
</div>
|
||||
<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('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</div>
|
||||
<div class="col-auto col-xl-2">
|
||||
<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('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</div>
|
||||
|
@ -193,7 +193,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -203,7 +203,7 @@
|
|||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -213,13 +213,13 @@
|
|||
<div class="row d-flex flex-column">
|
||||
<div class="col-auto">
|
||||
<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-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>
|
||||
</div>
|
||||
<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>
|
||||
|
@ -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>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -251,7 +251,7 @@
|
|||
<div class="row">
|
||||
<div class="col-12 col-lg-6">
|
||||
<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>
|
||||
<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>
|
||||
|
@ -259,7 +259,7 @@
|
|||
</div>
|
||||
<!-- <div class="col-12 col-lg-6 col-xl-4">
|
||||
<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')">
|
||||
<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>
|
||||
|
@ -267,7 +267,7 @@
|
|||
</div> -->
|
||||
<div class="col-12 col-lg-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')">
|
||||
<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>
|
||||
|
@ -275,7 +275,7 @@
|
|||
</div>
|
||||
<div class="col-12 col-lg-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')">
|
||||
<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>
|
||||
|
@ -286,7 +286,7 @@
|
|||
<div class="col-12 col-xl-auto section-options-horizontal">
|
||||
<div class="row">
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -299,7 +299,7 @@
|
|||
<div class="row">
|
||||
<div *ngIf="section.get('hasTemplates').value == true" class="col-12">
|
||||
<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>
|
||||
<mat-error *ngIf="section.get('prefillingSourcesIds').hasError('backendError')">{{section.get('prefillingSourcesIds').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -320,8 +320,8 @@
|
|||
<div class="col-12">
|
||||
<div class="row">
|
||||
<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>
|
||||
<mat-error *ngIf="formGroup.get('definition').get('sections').dirty && formGroup.get('definition').get('sections').hasError('required')">{{'DMP-BLUEPRINT-EDITOR.SECTIONS-REQUIRED' | translate}}</mat-error>
|
||||
<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')">{{'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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -329,12 +329,12 @@
|
|||
</div>
|
||||
<div class="row mt-4">
|
||||
<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 class="col"></div>
|
||||
<div class="col-auto">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,19 +6,19 @@ import { MatCheckboxChange } from '@angular/material/checkbox';
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DmpBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
|
||||
import { DmpBlueprintExtraFieldDataType } from '@app/core/common/enum/plan-blueprint-field-type';
|
||||
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
|
||||
import { PlanBlueprintFieldCategory } from '@app/core/common/enum/plan-blueprint-field-category';
|
||||
import { PlanBlueprintExtraFieldDataType } from '@app/core/common/enum/plan-blueprint-field-type';
|
||||
import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { PlanBlueprintSystemFieldType } from '@app/core/common/enum/plan-blueprint-system-field-type';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { LockTargetType } from '@app/core/common/enum/lock-target-type';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
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 { ConfigurationService } from '@app/core/services/configuration/configuration.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 { LoggingService } from '@app/core/services/logging/logging-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 { map, takeUntil } from 'rxjs/operators';
|
||||
import { DescriptionTemplatePreviewDialogComponent } from '../../description-template/description-template-preview/description-template-preview-dialog.component';
|
||||
import { DmpBlueprintEditorModel, FieldInSectionEditorModel } from './plan-blueprint-editor.model';
|
||||
import { DmpBlueprintEditorResolver } from './plan-blueprint-editor.resolver';
|
||||
import { DmpBlueprintEditorService } from './plan-blueprint-editor.service';
|
||||
import { PlanBlueprintEditorModel, FieldInSectionEditorModel } from './plan-blueprint-editor.model';
|
||||
import { PlanBlueprintEditorResolver } from './plan-blueprint-editor.resolver';
|
||||
import { PlanBlueprintEditorService } from './plan-blueprint-editor.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',
|
||||
templateUrl: 'plan-blueprint-editor.component.html',
|
||||
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;
|
||||
isClone = false;
|
||||
|
@ -65,12 +65,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
hoveredSectionIndex: number = -1;
|
||||
hoveredDescriptionTemplateIndex: number = -1;
|
||||
|
||||
dmpBlueprintSectionFieldCategory = DmpBlueprintFieldCategory;
|
||||
dmpBlueprintSystemFieldType = DmpBlueprintSystemFieldType;
|
||||
public dmpBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintSystemFieldType>(DmpBlueprintSystemFieldType);
|
||||
dmpBlueprintExtraFieldDataType = DmpBlueprintExtraFieldDataType;
|
||||
public dmpBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintExtraFieldDataType>(DmpBlueprintExtraFieldDataType);
|
||||
public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<DmpBlueprintFieldCategory>(DmpBlueprintFieldCategory);
|
||||
dmpBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
|
||||
dmpBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
|
||||
public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
|
||||
dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
|
||||
public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintExtraFieldDataType>(PlanBlueprintExtraFieldDataType);
|
||||
public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
|
||||
descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||
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)),
|
||||
|
@ -83,17 +83,17 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
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 {
|
||||
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;
|
||||
return !this.formGroup.disabled;
|
||||
}
|
||||
|
||||
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 {
|
||||
|
@ -101,7 +101,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
protected get isFinalized(): boolean {
|
||||
return this.editorModel.status == DmpBlueprintStatus.Finalized;
|
||||
return this.editorModel.status == PlanBlueprintStatus.Finalized;
|
||||
}
|
||||
|
||||
private hasPermission(permission: AppPermission): boolean {
|
||||
|
@ -124,9 +124,9 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
protected configurationService: ConfigurationService,
|
||||
// Rest dependencies. Inject any other needed deps here:
|
||||
public enumUtils: EnumUtils,
|
||||
private dmpBlueprintService: DmpBlueprintService,
|
||||
private planBlueprintService: PlanBlueprintService,
|
||||
private logger: LoggingService,
|
||||
private dmpBlueprintEditorService: DmpBlueprintEditorService,
|
||||
private dmpBlueprintEditorService: PlanBlueprintEditorService,
|
||||
private fileUtils: FileUtils,
|
||||
public descriptionTemplateService: DescriptionTemplateService,
|
||||
public referenceTypeService: ReferenceTypeService,
|
||||
|
@ -140,13 +140,13 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} 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);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintEditor);
|
||||
this.analyticsService.trackPageView(AnalyticsService.PlanBlueprintEditor);
|
||||
this.initModelFlags(this.route.snapshot.data['action']);
|
||||
super.ngOnInit();
|
||||
this.route.data.subscribe(d => {
|
||||
|
@ -172,22 +172,22 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
}
|
||||
|
||||
getItem(itemId: Guid, successFunction: (item: DmpBlueprint) => void) {
|
||||
this.dmpBlueprintService.getSingle(itemId, DmpBlueprintEditorResolver.lookupFields())
|
||||
.pipe(map(data => data as DmpBlueprint), takeUntil(this._destroyed))
|
||||
getItem(itemId: Guid, successFunction: (item: PlanBlueprint) => void) {
|
||||
this.planBlueprintService.getSingle(itemId, PlanBlueprintEditorResolver.lookupFields())
|
||||
.pipe(map(data => data as PlanBlueprint), takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
data => successFunction(data),
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
}
|
||||
|
||||
prepareForm(data: DmpBlueprint) {
|
||||
prepareForm(data: PlanBlueprint) {
|
||||
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.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) {
|
||||
this.logger.error('Could not parse dmpBlueprint item: ' + data + error);
|
||||
|
@ -196,7 +196,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
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);
|
||||
if (this.isFinalized || this.isDeleted) {
|
||||
this.formGroup.disable();
|
||||
|
@ -207,14 +207,14 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
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 {
|
||||
this.formGroup.markAsPristine();
|
||||
if (this.isNew || this.isNewVersion) {
|
||||
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 });
|
||||
} else {
|
||||
this.refreshData(id);
|
||||
|
@ -223,17 +223,17 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
|
||||
persistEntity(onSuccess?: (response) => void): void {
|
||||
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(
|
||||
complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete),
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
} 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(
|
||||
complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete),
|
||||
error => this.onCallbackError(error)
|
||||
|
@ -265,7 +265,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.dmpBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed))
|
||||
this.planBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => this.onCallbackDeleteSuccess(),
|
||||
error => this.onCallbackError(error)
|
||||
|
@ -310,7 +310,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
});
|
||||
|
||||
//Reapply validators
|
||||
DmpBlueprintEditorModel.reApplySectionValidators(
|
||||
PlanBlueprintEditorModel.reApplySectionValidators(
|
||||
{
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
|
@ -328,7 +328,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
sectionsFormArray.controls.forEach((section, index) => {
|
||||
section.get('ordinal').setValue(index + 1);
|
||||
});
|
||||
DmpBlueprintEditorModel.reApplySectionValidators(
|
||||
PlanBlueprintEditorModel.reApplySectionValidators(
|
||||
{
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
|
@ -357,7 +357,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
});
|
||||
|
||||
//Reapply validators
|
||||
DmpBlueprintEditorModel.reApplySectionValidators(
|
||||
PlanBlueprintEditorModel.reApplySectionValidators(
|
||||
{
|
||||
formGroup: this.formGroup,
|
||||
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();
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
fieldCategoryChanged(sectionIndex: number, fieldIndex: number) {
|
||||
//Reapply validators
|
||||
DmpBlueprintEditorModel.reApplySectionValidators(
|
||||
PlanBlueprintEditorModel.reApplySectionValidators(
|
||||
{
|
||||
formGroup: this.formGroup,
|
||||
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();
|
||||
}
|
||||
|
||||
get alwaysRequiredSystemFieldTypes(): DmpBlueprintSystemFieldType[] {
|
||||
get alwaysRequiredSystemFieldTypes(): PlanBlueprintSystemFieldType[] {
|
||||
return FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes;
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
section.get('ordinal').setValue(index + 1);
|
||||
});
|
||||
|
||||
DmpBlueprintEditorModel.reApplySectionValidators({
|
||||
PlanBlueprintEditorModel.reApplySectionValidators({
|
||||
formGroup: this.formGroup,
|
||||
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;
|
||||
descriptionTempaltesArray.removeAt(descriptionTemplateIndex);
|
||||
|
||||
DmpBlueprintEditorModel.reApplySectionValidators(
|
||||
PlanBlueprintEditorModel.reApplySectionValidators(
|
||||
{
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
|
@ -462,7 +462,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
moveItemInArray(descriptionTemplatesFormArray.controls, event.previousIndex, event.currentIndex);
|
||||
descriptionTemplatesFormArray.updateValueAndValidity();
|
||||
|
||||
DmpBlueprintEditorModel.reApplySectionValidators({
|
||||
PlanBlueprintEditorModel.reApplySectionValidators({
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
}
|
||||
|
@ -517,27 +517,27 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
hasTitle(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Title));
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
|
||||
}
|
||||
|
||||
hasDescription(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Description));
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
|
||||
}
|
||||
|
||||
hasLanguage(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Language));
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
|
||||
}
|
||||
|
||||
hasAccess(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.AccessRights));
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
|
||||
}
|
||||
|
||||
hasDescriptionTemplates(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true);
|
||||
}
|
||||
|
||||
|
@ -556,12 +556,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
public cancel(): void {
|
||||
this.router.navigate([this.routerUtils.generateUrl('/dmp-blueprints')]);
|
||||
this.router.navigate([this.routerUtils.generateUrl('/plan-blueprints')]);
|
||||
}
|
||||
|
||||
finalize() {
|
||||
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;
|
||||
this.formSubmit();
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
downloadXML(): void {
|
||||
const blueprintId = this.formGroup.get('id').value;
|
||||
if (blueprintId == null) return;
|
||||
this.dmpBlueprintService.downloadXML(blueprintId)
|
||||
this.planBlueprintService.downloadXML(blueprintId)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'application/xml' });
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import { FormArray, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
|
||||
import { DmpBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
|
||||
import { DmpBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
|
||||
import { DmpBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
|
||||
import { DmpBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
|
||||
import { DmpBlueprintVersionStatus } 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 { PlanBlueprintFieldCategory } from "@app/core/common/enum/plan-blueprint-field-category";
|
||||
import { PlanBlueprintExtraFieldDataType } from "@app/core/common/enum/plan-blueprint-field-type";
|
||||
import { PlanBlueprintStatus } from "@app/core/common/enum/plan-blueprint-status";
|
||||
import { PlanBlueprintSystemFieldType } from "@app/core/common/enum/plan-blueprint-system-field-type";
|
||||
import { PlanBlueprintVersionStatus } from "@app/core/common/enum/plan-blueprint-version-status";
|
||||
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 { 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 { Validation, ValidationContext } from "@common/forms/validation/validation-context";
|
||||
import { Guid } from "@common/types/guid";
|
||||
|
||||
export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBlueprintPersist {
|
||||
export class PlanBlueprintEditorModel extends BaseEditorModel implements PlanBlueprintPersist {
|
||||
label: string;
|
||||
definition: DmpBlueprintDefinitionEditorModel = new DmpBlueprintDefinitionEditorModel();
|
||||
status: DmpBlueprintStatus = DmpBlueprintStatus.Draft;
|
||||
versionStatus: DmpBlueprintVersionStatus = DmpBlueprintVersionStatus.Current;
|
||||
definition: PlanBlueprintDefinitionEditorModel = new PlanBlueprintDefinitionEditorModel();
|
||||
status: PlanBlueprintStatus = PlanBlueprintStatus.Draft;
|
||||
versionStatus: PlanBlueprintVersionStatus = PlanBlueprintVersionStatus.Current;
|
||||
description: string;
|
||||
permissions: string[];
|
||||
|
||||
|
@ -24,13 +24,13 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
|
|||
|
||||
constructor() { super(); }
|
||||
|
||||
public fromModel(item: DmpBlueprint): DmpBlueprintEditorModel {
|
||||
public fromModel(item: PlanBlueprint): PlanBlueprintEditorModel {
|
||||
if (item) {
|
||||
super.fromModel(item);
|
||||
this.label = item.label;
|
||||
this.status = item.status;
|
||||
this.versionStatus = item.versionStatus;
|
||||
this.definition = new DmpBlueprintDefinitionEditorModel(this.validationErrorModel).fromModel(item.definition);
|
||||
this.definition = new PlanBlueprintDefinitionEditorModel(this.validationErrorModel).fromModel(item.definition);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
|
|||
}
|
||||
|
||||
createChildSection(index: number): UntypedFormGroup {
|
||||
const section: DmpBlueprintDefinitionSectionEditorModel = new DmpBlueprintDefinitionSectionEditorModel(this.validationErrorModel);
|
||||
const section: PlanBlueprintDefinitionSectionEditorModel = new PlanBlueprintDefinitionSectionEditorModel(this.validationErrorModel);
|
||||
section.id = Guid.create();
|
||||
section.ordinal = index + 1;
|
||||
section.hasTemplates = false;
|
||||
|
@ -90,7 +90,7 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
|
|||
|
||||
const { formGroup, validationErrorModel } = params;
|
||||
const control = formGroup?.get('definition');
|
||||
DmpBlueprintDefinitionEditorModel.reapplySectionsValidators({
|
||||
PlanBlueprintDefinitionEditorModel.reapplySectionsValidators({
|
||||
formArray: control.get('sections') as UntypedFormArray,
|
||||
rootPath: `definition.`,
|
||||
validationErrorModel: validationErrorModel
|
||||
|
@ -99,17 +99,17 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
|
|||
}
|
||||
}
|
||||
|
||||
export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinitionPersist {
|
||||
sections: DmpBlueprintDefinitionSectionEditorModel[] = [];
|
||||
export class PlanBlueprintDefinitionEditorModel implements PlanBlueprintDefinitionPersist {
|
||||
sections: PlanBlueprintDefinitionSectionEditorModel[] = [];
|
||||
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
|
||||
|
||||
constructor(
|
||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
|
||||
) { }
|
||||
|
||||
public fromModel(item: DmpBlueprintDefinition): DmpBlueprintDefinitionEditorModel {
|
||||
public fromModel(item: PlanBlueprintDefinition): PlanBlueprintDefinitionEditorModel {
|
||||
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;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
|
|||
}): UntypedFormGroup {
|
||||
let { context = null, disabled = false, rootPath } = params ?? {}
|
||||
if (context == null) {
|
||||
context = DmpBlueprintDefinitionEditorModel.createValidationContext({
|
||||
context = PlanBlueprintDefinitionEditorModel.createValidationContext({
|
||||
validationErrorModel: this.validationErrorModel,
|
||||
rootPath
|
||||
});
|
||||
|
@ -147,7 +147,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
|
|||
|
||||
const baseContext: ValidationContext = new ValidationContext();
|
||||
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;
|
||||
return baseContext;
|
||||
|
@ -160,7 +160,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
|
|||
}): void {
|
||||
const { validationErrorModel, rootPath, formArray } = params;
|
||||
formArray?.controls?.forEach(
|
||||
(control, index) => DmpBlueprintDefinitionSectionEditorModel.reapplySectionValidators({
|
||||
(control, index) => PlanBlueprintDefinitionSectionEditorModel.reapplySectionValidators({
|
||||
formGroup: control as UntypedFormGroup,
|
||||
rootPath: `${rootPath}sections[${index}].`,
|
||||
validationErrorModel: validationErrorModel
|
||||
|
@ -170,7 +170,7 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
|
|||
|
||||
}
|
||||
|
||||
export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDefinitionSectionPersist {
|
||||
export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintDefinitionSectionPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: string;
|
||||
|
@ -186,7 +186,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
|
|||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
|
||||
) { }
|
||||
|
||||
public fromModel(item: DmpBlueprintDefinitionSection): DmpBlueprintDefinitionSectionEditorModel {
|
||||
public fromModel(item: PlanBlueprintDefinitionSection): PlanBlueprintDefinitionSectionEditorModel {
|
||||
if (item) {
|
||||
this.id = item.id;
|
||||
this.label = item.label;
|
||||
|
@ -207,7 +207,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
|
|||
}): UntypedFormGroup {
|
||||
let { context = null, disabled = false, rootPath } = params ?? {}
|
||||
if (context == null) {
|
||||
context = DmpBlueprintDefinitionSectionEditorModel.createValidationContext({
|
||||
context = PlanBlueprintDefinitionSectionEditorModel.createValidationContext({
|
||||
validationErrorModel: this.validationErrorModel,
|
||||
rootPath
|
||||
});
|
||||
|
@ -267,7 +267,7 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
|
|||
rootPath: string
|
||||
}): void {
|
||||
const { formGroup, rootPath, validationErrorModel } = params;
|
||||
const context = DmpBlueprintDefinitionSectionEditorModel.createValidationContext({
|
||||
const context = PlanBlueprintDefinitionSectionEditorModel.createValidationContext({
|
||||
rootPath,
|
||||
validationErrorModel
|
||||
});
|
||||
|
@ -302,20 +302,20 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
|
|||
|
||||
export class FieldInSectionEditorModel implements FieldInSectionPersist {
|
||||
public id: Guid;
|
||||
public category: DmpBlueprintFieldCategory;
|
||||
public category: PlanBlueprintFieldCategory;
|
||||
public label: string;
|
||||
public placeholder: string;
|
||||
public description: string;
|
||||
public semantics: string[];
|
||||
public required: boolean = false;
|
||||
public ordinal: number;
|
||||
public dataType: DmpBlueprintExtraFieldDataType;
|
||||
public systemFieldType: DmpBlueprintSystemFieldType;
|
||||
public dataType: PlanBlueprintExtraFieldDataType;
|
||||
public systemFieldType: PlanBlueprintSystemFieldType;
|
||||
public referenceTypeId: Guid;
|
||||
public multipleSelect: boolean;
|
||||
|
||||
static get alwaysRequiredSystemFieldTypes(): DmpBlueprintSystemFieldType[] {
|
||||
return [DmpBlueprintSystemFieldType.Title, DmpBlueprintSystemFieldType.Description, DmpBlueprintSystemFieldType.Language, DmpBlueprintSystemFieldType.AccessRights];
|
||||
static get alwaysRequiredSystemFieldTypes(): PlanBlueprintSystemFieldType[] {
|
||||
return [PlanBlueprintSystemFieldType.Title, PlanBlueprintSystemFieldType.Description, PlanBlueprintSystemFieldType.Language, PlanBlueprintSystemFieldType.AccessRights];
|
||||
}
|
||||
|
||||
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
|
||||
|
@ -334,14 +334,14 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
|
|||
this.required = item.required;
|
||||
this.ordinal = item.ordinal;
|
||||
|
||||
if (this.category == DmpBlueprintFieldCategory.System) {
|
||||
if (this.category == PlanBlueprintFieldCategory.System) {
|
||||
this.systemFieldType = (item as SystemFieldInSection).systemFieldType;
|
||||
if (FieldInSectionEditorModel.alwaysRequiredSystemFieldTypes.includes(this.systemFieldType)) {
|
||||
this.required = true;
|
||||
}
|
||||
} else if (this.category == DmpBlueprintFieldCategory.Extra) {
|
||||
} else if (this.category == PlanBlueprintFieldCategory.Extra) {
|
||||
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.multipleSelect= (item as ReferenceTypeFieldInSection).multipleSelect;
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
|
|||
id: [{ value: this.id, disabled: disabled }, context.getValidation('id').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],
|
||||
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
|
||||
required: [{ value: this.required, disabled: disabled }, context.getValidation('required').validators],
|
||||
|
@ -425,16 +425,16 @@ export class FieldInSectionEditorModel implements FieldInSectionPersist {
|
|||
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));
|
||||
} 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 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 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 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(keyField).validators);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
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 { 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 { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
||||
|
@ -11,68 +11,68 @@ import { takeUntil, tap } from 'rxjs/operators';
|
|||
import { nameof } from 'ts-simple-nameof';
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
public static lookupFields(): string[] {
|
||||
return [
|
||||
...BaseEditorResolver.lookupFields(),
|
||||
nameof<DmpBlueprint>(x => x.id),
|
||||
nameof<DmpBlueprint>(x => x.label),
|
||||
nameof<DmpBlueprint>(x => x.status),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.description)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
|
||||
[nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.hasTemplates)].join('.'),
|
||||
nameof<PlanBlueprint>(x => x.id),
|
||||
nameof<PlanBlueprint>(x => x.label),
|
||||
nameof<PlanBlueprint>(x => x.status),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.description)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.ordinal)].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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<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<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<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<FieldInSection>(x => x.id)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.label)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.description)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.semantics)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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<SystemFieldInSection>(x => x.systemFieldType)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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<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.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.code)].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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<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.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.minMultiplicity)].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<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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.id)].join('.'),
|
||||
[nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.code)].join('.'),
|
||||
|
||||
nameof<DmpBlueprint>(x => x.createdAt),
|
||||
nameof<DmpBlueprint>(x => x.hash),
|
||||
nameof<DmpBlueprint>(x => x.isActive)
|
||||
nameof<PlanBlueprint>(x => x.createdAt),
|
||||
nameof<PlanBlueprint>(x => x.hash),
|
||||
nameof<PlanBlueprint>(x => x.isActive)
|
||||
]
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
||||
|
||||
const fields = [
|
||||
...DmpBlueprintEditorResolver.lookupFields()
|
||||
...PlanBlueprintEditorResolver.lookupFields()
|
||||
];
|
||||
const id = route.paramMap.get('id');
|
||||
const cloneid = route.paramMap.get('cloneid');
|
||||
const newversion = route.paramMap.get("newversionid");
|
||||
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) {
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Injectable } from "@angular/core";
|
|||
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
|
||||
|
||||
@Injectable()
|
||||
export class DmpBlueprintEditorService {
|
||||
export class PlanBlueprintEditorService {
|
||||
private validationErrorModel: ValidationErrorModel;
|
||||
|
||||
public setValidationErrorModel(validationErrorModel: ValidationErrorModel): void {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="container-fluid" (click)="$event?.stopPropagation?.()">
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto mt-2">
|
||||
<h4>{{'DMP-BLUEPRINT-LISTING.FILTER.TITLE' | translate}}</h4>
|
||||
<h4>{{'PLAN-BLUEPRINT-LISTING.FILTER.TITLE' | translate}}</h4>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button color="accent" mat-button (click)="clearFilters()">
|
||||
|
@ -23,7 +23,7 @@
|
|||
<div class="col-12">
|
||||
<section class="w-100">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,9 +31,9 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<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-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-form-field>
|
||||
</div>
|
||||
|
@ -42,12 +42,12 @@
|
|||
<div class="row justify-content-end align-items-center mt-4 mb-1 gap-1-rem">
|
||||
<div class="col-auto">
|
||||
<button class="normal-btn-light-sm" (click)="filterMenuTrigger?.closeMenu()">
|
||||
{{'DMP-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="normal-btn-sm" (click)="filterMenuTrigger.closeMenu(); applyFilters();">
|
||||
{{'DMP-BLUEPRINT-LISTING.FILTER.APPLY-FILTERS' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.FILTER.APPLY-FILTERS' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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 { 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 { BaseComponent } from '@common/base/base.component';
|
||||
import { Guid } from '@common/types/guid';
|
||||
|
@ -12,15 +12,15 @@ import { nameof } from 'ts-simple-nameof';
|
|||
templateUrl: './plan-blueprint-listing-filters.component.html',
|
||||
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;
|
||||
@Output() filterChange = new EventEmitter<DmpBlueprintFilter>();
|
||||
@Input() readonly filter: PlanBlueprintFilter;
|
||||
@Output() filterChange = new EventEmitter<PlanBlueprintFilter>();
|
||||
|
||||
dmpBlueprintStatusEnumValues = this.enumUtils.getEnumValues<DmpBlueprintStatus>(DmpBlueprintStatus);
|
||||
planBlueprintStatusEnumValues = this.enumUtils.getEnumValues<PlanBlueprintStatus>(PlanBlueprintStatus);
|
||||
|
||||
// * State
|
||||
internalFilters: DmpBlueprintListingFilters = this._getEmptyFilters();
|
||||
internalFilters: PlanBlueprintListingFilters = this._getEmptyFilters();
|
||||
|
||||
protected appliedFilterCount: number = 0;
|
||||
constructor(
|
||||
|
@ -31,7 +31,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
|
|||
}
|
||||
|
||||
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) {
|
||||
this.updateFilters()
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
|
|||
}
|
||||
|
||||
|
||||
private _parseToInternalFilters(inputFilter: DmpBlueprintFilter): DmpBlueprintListingFilters {
|
||||
private _parseToInternalFilters(inputFilter: PlanBlueprintFilter): PlanBlueprintListingFilters {
|
||||
if (!inputFilter) {
|
||||
return this._getEmptyFilters();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
|
|||
|
||||
}
|
||||
|
||||
private _getEmptyFilters(): DmpBlueprintListingFilters {
|
||||
private _getEmptyFilters(): PlanBlueprintListingFilters {
|
||||
return {
|
||||
isActive: true,
|
||||
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;
|
||||
if (filters?.isActive) {
|
||||
count++
|
||||
|
@ -95,8 +95,8 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
|
|||
}
|
||||
}
|
||||
|
||||
interface DmpBlueprintListingFilters {
|
||||
interface PlanBlueprintListingFilters {
|
||||
isActive: boolean;
|
||||
like: string;
|
||||
statuses: DmpBlueprintStatus[];
|
||||
statuses: PlanBlueprintStatus[];
|
||||
}
|
||||
|
|
|
@ -21,15 +21,15 @@
|
|||
<div class="col-12 d-flex justify-content-center attach-btn">
|
||||
<button mat-button type="button" class="col-auto attach-file" (click)="imgFileInput.click()">
|
||||
<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-DMP-DIALOG.REPLACE-FILE' | translate}}</span>
|
||||
<span *ngIf="!hasBlueprint()">{{'GENERAL.START-NEW-PLAN-DIALOG.UPLOAD-FILE' | translate}}</span>
|
||||
<span *ngIf="hasBlueprint()">{{'GENERAL.START-NEW-PLAN-DIALOG.REPLACE-FILE' | translate}}</span>
|
||||
</button>
|
||||
<input class="hidden" type="file" #imgFileInput (change)="selectXML($event)" accept="text/xml" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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>
|
||||
<div class="col-auto">
|
||||
<button mat-button type="button" class="cancel-btn" (click)="cancel()">{{ data.cancelButton }}</button>
|
||||
|
|
|
@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|||
templateUrl: './import-plan-blueprint.dialog.component.html',
|
||||
styleUrls: ['./import-plan-blueprint.dialog.component.scss']
|
||||
})
|
||||
export class ImportDmpBlueprintDialogComponent {
|
||||
export class ImportPlanBlueprintDialogComponent {
|
||||
|
||||
sizeError = false;
|
||||
selectFile = false;
|
||||
|
@ -14,7 +14,7 @@ export class ImportDmpBlueprintDialogComponent {
|
|||
selectedFileName: string;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ImportDmpBlueprintDialogComponent>,
|
||||
public dialogRef: MatDialogRef<ImportPlanBlueprintDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) { }
|
||||
|
||||
|
|
|
@ -8,20 +8,20 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="import-btn" (click)="import()">
|
||||
<span class="button-text">
|
||||
{{'DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML' | translate}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
{{'DMP-BLUEPRINT-LISTING.CREATE-DMP-BLUEPRINT' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.CREATE-PLAN-BLUEPRINT' | translate}}
|
||||
</button>
|
||||
</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)" />
|
||||
|
||||
|
@ -46,15 +46,15 @@
|
|||
|
||||
<ng-container *ngIf="isColumnSelected('status')">
|
||||
<div class="col-auto">
|
||||
<div class="status-chip" [ngClass]="{'status-chip-finalized': item.status === dmpBlueprintStatuses.Finalized, 'status-chip-draft' : item.status === dmpBlueprintStatuses.Draft}">
|
||||
{{enumUtils.toDmpBlueprintStatusString(item.status) | nullifyValue}}
|
||||
<div class="status-chip" [ngClass]="{'status-chip-finalized': item.status === planBlueprintStatuses.Finalized, 'status-chip-draft' : item.status === planBlueprintStatuses.Draft}">
|
||||
{{enumUtils.toPlanBlueprintStatusString(item.status) | nullifyValue}}
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isColumnSelected('createdAt')">
|
||||
<span class="col-12">
|
||||
{{'DMP-BLUEPRINT-LISTING.FIELDS.CREATED-AT' | translate}}:
|
||||
{{'PLAN-BLUEPRINT-LISTING.FIELDS.CREATED-AT' | translate}}:
|
||||
<small>
|
||||
{{item?.createdAt | dateTimeFormatter : 'short' | nullifyValue}}
|
||||
</small>
|
||||
|
@ -63,7 +63,7 @@
|
|||
</ng-container>
|
||||
<ng-container *ngIf="isColumnSelected('updatedAt')">
|
||||
<span class="col-12">
|
||||
{{'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT' | translate}}:
|
||||
{{'PLAN-BLUEPRINT-LISTING.FIELDS.UPDATED-AT' | translate}}:
|
||||
<small>
|
||||
{{item?.updatedAt | dateTimeFormatter : 'short' | nullifyValue}}
|
||||
</small>
|
||||
|
@ -73,10 +73,10 @@
|
|||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #dmpBlueprintStatus let-row="row" let-item>
|
||||
<ng-template #planBlueprintStatus let-row="row" let-item>
|
||||
<div class="row">
|
||||
<div class="col-auto status-chip" [ngClass]="{'status-chip-finalized': row.status === dmpBlueprintStatuses.Finalized, 'status-chip-draft' : row.status === dmpBlueprintStatuses.Draft}">
|
||||
{{enumUtils.toDmpBlueprintStatusString(row.status) | nullifyValue}}
|
||||
<div class="col-auto status-chip" [ngClass]="{'status-chip-finalized': row.status === planBlueprintStatuses.Finalized, 'status-chip-draft' : row.status === planBlueprintStatuses.Draft}">
|
||||
{{enumUtils.toPlanBlueprintStatusString(row.status) | nullifyValue}}
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
@ -88,25 +88,25 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
||||
<button *ngIf="(row.status != null && row.status === planBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</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])">
|
||||
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||
<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>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/clone/', row.id])">
|
||||
<mat-icon>content_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/clone/', row.id])">
|
||||
<mat-icon>content_copy</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
|
||||
</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>
|
||||
{{'DMP-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
|
||||
</button>
|
||||
<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 *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
{{'DMP-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
|
||||
{{'PLAN-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
|
||||
</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DmpBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status';
|
||||
import { PlanBlueprintStatus } from '@app/core/common/enum/plan-blueprint-status';
|
||||
import { PlanBlueprintVersionStatus } from '@app/core/common/enum/plan-blueprint-version-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { DmpBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { DmpBlueprintLookup } from '@app/core/query/plan-blueprint.lookup';
|
||||
import { PlanBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { PlanBlueprintLookup } from '@app/core/query/plan-blueprint.lookup';
|
||||
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 { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-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 { takeUntil } from 'rxjs/operators';
|
||||
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';
|
||||
|
||||
|
||||
|
@ -37,28 +37,28 @@ import { RouterUtilsService } from '@app/core/services/router/router-utils.servi
|
|||
templateUrl: './plan-blueprint-listing.component.html',
|
||||
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;
|
||||
userSettingsKey = { key: 'DmpBlueprintListingUserSettings' };
|
||||
userSettingsKey = { key: 'PlanBlueprintListingUserSettings' };
|
||||
propertiesAvailableForOrder: ColumnDefinition[];
|
||||
dmpBlueprintStatuses = DmpBlueprintStatus;
|
||||
planBlueprintStatuses = PlanBlueprintStatus;
|
||||
mode;
|
||||
|
||||
@ViewChild('dmpBlueprintStatus', { static: true }) dmpBlueprintStatus?: TemplateRef<any>;
|
||||
@ViewChild('planBlueprintStatus', { static: true }) planBlueprintStatus?: TemplateRef<any>;
|
||||
@ViewChild('actions', { static: true }) actions?: TemplateRef<any>;
|
||||
@ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent;
|
||||
|
||||
private readonly lookupFields: string[] = [
|
||||
nameof<DmpBlueprint>(x => x.id),
|
||||
nameof<DmpBlueprint>(x => x.label),
|
||||
nameof<DmpBlueprint>(x => x.status),
|
||||
nameof<DmpBlueprint>(x => x.version),
|
||||
nameof<DmpBlueprint>(x => x.groupId),
|
||||
nameof<DmpBlueprint>(x => x.updatedAt),
|
||||
nameof<DmpBlueprint>(x => x.createdAt),
|
||||
nameof<DmpBlueprint>(x => x.hash),
|
||||
nameof<DmpBlueprint>(x => x.isActive),
|
||||
nameof<DmpBlueprint>(x => x.belongsToCurrentTenant)
|
||||
nameof<PlanBlueprint>(x => x.id),
|
||||
nameof<PlanBlueprint>(x => x.label),
|
||||
nameof<PlanBlueprint>(x => x.status),
|
||||
nameof<PlanBlueprint>(x => x.version),
|
||||
nameof<PlanBlueprint>(x => x.groupId),
|
||||
nameof<PlanBlueprint>(x => x.updatedAt),
|
||||
nameof<PlanBlueprint>(x => x.createdAt),
|
||||
nameof<PlanBlueprint>(x => x.hash),
|
||||
nameof<PlanBlueprint>(x => x.isActive),
|
||||
nameof<PlanBlueprint>(x => x.belongsToCurrentTenant)
|
||||
];
|
||||
|
||||
rowIdentity = x => x.id;
|
||||
|
@ -70,7 +70,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
private dmpBlueprintService: DmpBlueprintService,
|
||||
private planBlueprintService: PlanBlueprintService,
|
||||
public authService: AuthService,
|
||||
private pipeService: PipeService,
|
||||
public enumUtils: EnumUtils,
|
||||
|
@ -87,21 +87,21 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintListing);
|
||||
this.analyticsService.trackPageView(AnalyticsService.PlanBlueprintListing);
|
||||
super.ngOnInit();
|
||||
}
|
||||
|
||||
protected initializeLookup(): DmpBlueprintLookup {
|
||||
const lookup = new DmpBlueprintLookup();
|
||||
protected initializeLookup(): PlanBlueprintLookup {
|
||||
const lookup = new PlanBlueprintLookup();
|
||||
lookup.metadata = { countAll: true };
|
||||
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
|
||||
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') {
|
||||
lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))];
|
||||
lookup.versionStatuses = null;
|
||||
} else {
|
||||
lookup.versionStatuses = [DmpBlueprintVersionStatus.Current, DmpBlueprintVersionStatus.NotFinalized];
|
||||
lookup.versionStatuses = [PlanBlueprintVersionStatus.Current, PlanBlueprintVersionStatus.NotFinalized];
|
||||
}
|
||||
this.updateOrderUiFields(lookup.order);
|
||||
|
||||
|
@ -114,37 +114,37 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
|
||||
protected setupColumns() {
|
||||
this.gridColumns.push(...[{
|
||||
prop: nameof<DmpBlueprint>(x => x.label),
|
||||
prop: nameof<PlanBlueprint>(x => x.label),
|
||||
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,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.STATUS',
|
||||
cellTemplate: this.dmpBlueprintStatus
|
||||
languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.STATUS',
|
||||
cellTemplate: this.planBlueprintStatus
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.version),
|
||||
prop: nameof<PlanBlueprint>(x => x.version),
|
||||
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,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.CREATED-AT',
|
||||
languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.CREATED-AT',
|
||||
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.updatedAt),
|
||||
prop: nameof<PlanBlueprint>(x => x.updatedAt),
|
||||
sortable: true,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT',
|
||||
languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.UPDATED-AT',
|
||||
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.isActive),
|
||||
prop: nameof<PlanBlueprint>(x => x.isActive),
|
||||
sortable: true,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.IS-ACTIVE',
|
||||
languageName: 'PLAN-BLUEPRINT-LISTING.FIELDS.IS-ACTIVE',
|
||||
pipe: this.pipeService.getPipe<IsActiveTypePipe>(IsActiveTypePipe)
|
||||
},
|
||||
{
|
||||
|
@ -176,8 +176,8 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
this.onPageLoad({ offset: 0 } as PageLoadEvent);
|
||||
}
|
||||
|
||||
protected loadListing(): Observable<QueryResult<DmpBlueprint>> {
|
||||
return this.dmpBlueprintService.query(this.lookup);
|
||||
protected loadListing(): Observable<QueryResult<PlanBlueprint>> {
|
||||
return this.planBlueprintService.query(this.lookup);
|
||||
}
|
||||
|
||||
public delete(id: Guid) {
|
||||
|
@ -192,7 +192,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.dmpBlueprintService.delete(id).pipe(takeUntil(this._destroyed))
|
||||
this.planBlueprintService.delete(id).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => this.onCallbackSuccess(),
|
||||
error => this.onCallbackError(error)
|
||||
|
@ -209,7 +209,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
|
||||
export(event: PointerEvent, id: Guid): void {
|
||||
event?.stopPropagation();
|
||||
this.dmpBlueprintService.downloadXML(id)
|
||||
this.planBlueprintService.downloadXML(id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'application/xml' });
|
||||
|
@ -220,12 +220,12 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
}
|
||||
|
||||
import(): void {
|
||||
const dialogRef = this.dialog.open(ImportDmpBlueprintDialogComponent, {
|
||||
const dialogRef = this.dialog.open(ImportPlanBlueprintDialogComponent, {
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
message: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'),
|
||||
confirmButton: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'),
|
||||
cancelButton: this.language.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'),
|
||||
message: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'),
|
||||
confirmButton: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'),
|
||||
cancelButton: this.language.instant('PLAN-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'),
|
||||
name: '',
|
||||
file: FileList,
|
||||
sucsess: false
|
||||
|
@ -233,10 +233,10 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
|
||||
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))
|
||||
.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();
|
||||
},
|
||||
error => {
|
||||
|
|
|
@ -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 { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { NgxDropzoneModule } from "ngx-dropzone";
|
||||
import { DmpBlueprintRoutingModule } from './plan-blueprint.routing';
|
||||
import { DmpBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
|
||||
import { DmpBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
|
||||
import { DmpBlueprintListingFiltersComponent } from "./listing/filters/plan-blueprint-listing-filters.component";
|
||||
import { ImportDmpBlueprintDialogComponent } from './listing/import-plan-blueprint/import-plan-blueprint.dialog.component';
|
||||
import { PlanBlueprintRoutingModule } from './plan-blueprint.routing';
|
||||
import { PlanBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
|
||||
import { PlanBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
|
||||
import { PlanBlueprintListingFiltersComponent } from "./listing/filters/plan-blueprint-listing-filters.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';
|
||||
|
||||
@NgModule({
|
||||
|
@ -21,7 +21,7 @@ import { DescriptionTemplatePreviewDialogModule } from '../description-template/
|
|||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
ConfirmationDialogModule,
|
||||
DmpBlueprintRoutingModule,
|
||||
PlanBlueprintRoutingModule,
|
||||
NgxDropzoneModule,
|
||||
DragDropModule,
|
||||
AutoCompleteModule,
|
||||
|
@ -32,10 +32,10 @@ import { DescriptionTemplatePreviewDialogModule } from '../description-template/
|
|||
DescriptionTemplatePreviewDialogModule
|
||||
],
|
||||
declarations: [
|
||||
DmpBlueprintEditorComponent,
|
||||
DmpBlueprintListingComponent,
|
||||
DmpBlueprintListingFiltersComponent,
|
||||
ImportDmpBlueprintDialogComponent
|
||||
PlanBlueprintEditorComponent,
|
||||
PlanBlueprintListingComponent,
|
||||
PlanBlueprintListingFiltersComponent,
|
||||
ImportPlanBlueprintDialogComponent
|
||||
]
|
||||
})
|
||||
export class DmpBlueprintModule { }
|
||||
export class PlanBlueprintModule { }
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { DmpBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
|
||||
import { DmpBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
|
||||
import { PlanBlueprintEditorComponent } from './editor/plan-blueprint-editor.component';
|
||||
import { PlanBlueprintListingComponent } from './listing/plan-blueprint-listing.component';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { AuthGuard } from '@app/core/auth-guard.service';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.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 = [
|
||||
{
|
||||
path: '',
|
||||
component: DmpBlueprintListingComponent,
|
||||
component: PlanBlueprintListingComponent,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'versions/:groupid',
|
||||
component: DmpBlueprintListingComponent,
|
||||
component: PlanBlueprintListingComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
mode: 'versions-listing'
|
||||
|
@ -25,14 +25,14 @@ const routes: Routes = [
|
|||
{
|
||||
path: 'new',
|
||||
canActivate: [AuthGuard],
|
||||
component: DmpBlueprintEditorComponent,
|
||||
component: PlanBlueprintEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
permissions: [AppPermission.EditPlanBlueprint]
|
||||
},
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.NEW-DMP-BLUEPRINT'
|
||||
title: 'BREADCRUMBS.NEW-PLAN-BLUEPRINT'
|
||||
}),
|
||||
getFromTitleService: true,
|
||||
usePrefix: false
|
||||
|
@ -41,17 +41,17 @@ const routes: Routes = [
|
|||
{
|
||||
path: 'clone/:cloneid',
|
||||
canActivate: [AuthGuard],
|
||||
component: DmpBlueprintEditorComponent,
|
||||
component: PlanBlueprintEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
resolve: {
|
||||
'entity': DmpBlueprintEditorResolver
|
||||
'entity': PlanBlueprintEditorResolver
|
||||
},
|
||||
data: {
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
skipNavigation: true
|
||||
}),
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
permissions: [AppPermission.EditPlanBlueprint]
|
||||
},
|
||||
getFromTitleService: true,
|
||||
usePrefix: false,
|
||||
|
@ -61,17 +61,17 @@ const routes: Routes = [
|
|||
{
|
||||
path: 'new-version/:newversionid',
|
||||
canActivate: [AuthGuard],
|
||||
component: DmpBlueprintEditorComponent,
|
||||
component: PlanBlueprintEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
resolve: {
|
||||
'entity': DmpBlueprintEditorResolver
|
||||
'entity': PlanBlueprintEditorResolver
|
||||
},
|
||||
data: {
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
skipNavigation: true
|
||||
}),
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
permissions: [AppPermission.EditPlanBlueprint]
|
||||
},
|
||||
getFromTitleService: true,
|
||||
usePrefix: false,
|
||||
|
@ -81,14 +81,14 @@ const routes: Routes = [
|
|||
{
|
||||
path: ':id',
|
||||
canActivate: [AuthGuard],
|
||||
component: DmpBlueprintEditorComponent,
|
||||
component: PlanBlueprintEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
resolve: {
|
||||
'entity': DmpBlueprintEditorResolver
|
||||
'entity': PlanBlueprintEditorResolver
|
||||
},
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
permissions: [AppPermission.EditPlanBlueprint]
|
||||
},
|
||||
getFromTitleService: true,
|
||||
usePrefix: false
|
||||
|
@ -101,6 +101,6 @@ const routes: Routes = [
|
|||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: [DmpBlueprintEditorResolver]
|
||||
providers: [PlanBlueprintEditorResolver]
|
||||
})
|
||||
export class DmpBlueprintRoutingModule { }
|
||||
export class PlanBlueprintRoutingModule { }
|
||||
|
|
|
@ -76,7 +76,7 @@ export class AnnotationDialogComponent extends BaseComponent {
|
|||
this.entityId = data.entityId;
|
||||
this.anchor = data.anchor;
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,21 +27,21 @@
|
|||
<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>
|
||||
|
||||
<p *ngIf="!this.hasDmps()" class="card-title mb-0 pt-4">{{'DASHBOARD.DMP-QUESTION' | translate}}</p>
|
||||
<p *ngIf="!this.hasDmps()" class="card-content mb-0">{{'DASHBOARD.INFO-DMP-TEXT' | 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-PLAN-TEXT' | translate}}</p>
|
||||
|
||||
<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}}
|
||||
</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>
|
||||
{{'DASHBOARD.DMP-ABOUT-END' | translate}}
|
||||
{{'DASHBOARD.PLAN-ABOUT-END' | translate}}
|
||||
</p>
|
||||
|
||||
<div class="row d-flex align-items-center">
|
||||
<div *ngIf="!this.hasDmps()" class="col-auto p-0 add-description-btn d-flex">
|
||||
<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 *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}}">
|
||||
<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 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>
|
||||
</mat-tab>
|
||||
<mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}">
|
||||
|
@ -85,7 +85,7 @@
|
|||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<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 class="col-auto col-xl-12">
|
||||
<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;">
|
||||
<span>{{dashboardStatistics?.dmpCount}}</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 class="col-auto col-xl-12">
|
||||
<div [ngClass]="{'counter': dashboardStatistics?.descriptionCount != 0, 'counter-zero': dashboardStatistics?.descriptionCount == 0}" style="width: fit-content;">
|
||||
|
@ -168,7 +168,7 @@
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<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 class="col-auto">
|
||||
<div class="counter-zero"><span>0</span></div>
|
||||
|
@ -190,7 +190,7 @@
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<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 class="col-auto">
|
||||
|
|
|
@ -16,7 +16,7 @@ import moment from 'moment';
|
|||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
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 { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
|
@ -112,12 +112,12 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
return this.authentication.currentAccountIsAuthenticated();
|
||||
}
|
||||
|
||||
openNewDmpDialog() {
|
||||
openNewPlanDialog() {
|
||||
if (this.dialog.openDialogs.length > 0) {
|
||||
this.dialog.closeAll();
|
||||
}
|
||||
else {
|
||||
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, {
|
||||
const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
|
||||
disableClose: false,
|
||||
data: {
|
||||
isDialog: true
|
||||
|
@ -140,23 +140,23 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
if (addDescription == false) return;
|
||||
|
||||
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, {
|
||||
disableClose: false,
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
startNewDmp: false,
|
||||
startNewPlan: false,
|
||||
formGroup: formGroup
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
if (result.startNewDmp) {
|
||||
this.openNewDmpDialog();
|
||||
if (result.startNewPlan) {
|
||||
this.openNewPlanDialog();
|
||||
} 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,
|
||||
isStepUnique: false,
|
||||
highlightPadding: 10,
|
||||
closeAction: () => this.openNewDmpDialog()
|
||||
closeAction: () => this.openNewPlanDialog()
|
||||
},
|
||||
{
|
||||
selector: '.import-file',
|
||||
|
@ -200,7 +200,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
};
|
||||
|
||||
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.dashboardTour.steps[0].title = dmpText;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/co
|
|||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DescriptionListingModule } from '../description/listing/description-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';
|
||||
|
||||
@NgModule({
|
||||
|
@ -21,7 +21,7 @@ import { RecentEditedActivityComponent } from './recent-edited-activity/recent-e
|
|||
|
||||
DmpListingModule,
|
||||
DescriptionListingModule,
|
||||
StartNewDmpDialogModule
|
||||
StartNewPlanDialogModule
|
||||
],
|
||||
declarations: [
|
||||
DashboardComponent,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<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 *ngIf="listingItems != null" id="results" class="col-12" #results>
|
||||
<div class="row pt-4">
|
||||
<!-- Sort by -->
|
||||
<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 class="col-12 col-xl-auto">
|
||||
<mat-form-field appearance="outline" class="w-100 sort-form">
|
||||
|
@ -31,7 +31,7 @@
|
|||
<!-- End of Search Filter -->
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize">
|
||||
|
|
|
@ -3,22 +3,22 @@ import { Component, Input, OnInit, Output } from '@angular/core';
|
|||
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
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 { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||
import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { Description } from '@app/core/model/description/description';
|
||||
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan';
|
||||
import { DmpReference } from '@app/core/model/plan/plan-reference';
|
||||
import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
|
||||
import { PlanReference } from '@app/core/model/plan/plan-reference';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
import { Reference } from '@app/core/model/reference/reference';
|
||||
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
||||
import { AuthService } from '@app/core/services/auth/auth.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 { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
|
@ -79,7 +79,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
private authentication: AuthService,
|
||||
private dashboardService: DashboardService,
|
||||
private location: Location,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private analyticsService: AnalyticsService,
|
||||
private httpErrorHandlingService: HttpErrorHandlingService
|
||||
) {
|
||||
|
@ -166,7 +166,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
this.lookup.like = this.formGroup.get('like').value;
|
||||
this.lookup.project = {
|
||||
fields : [
|
||||
...(this.includeDmps ? this._getDmpLookup() : []),
|
||||
...(this.includeDmps ? this._getPlanLookup() : []),
|
||||
...(this.includeDescriptions ? this._getDescriptionLookup() : [])
|
||||
]
|
||||
};
|
||||
|
@ -207,15 +207,15 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
if (this.lookup.page.offset == 0) this.listingItems = [];
|
||||
|
||||
response.forEach(item => {
|
||||
if (item.dmp){
|
||||
if (item.dmp.descriptions) {
|
||||
if (item.dmp.status == DmpStatus.Finalized) {
|
||||
item.dmp.descriptions = item.dmp.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
||||
if (item.plan){
|
||||
if (item.plan.descriptions) {
|
||||
if (item.plan.status == PlanStatus.Finalized) {
|
||||
item.plan.descriptions = item.plan.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
||||
} 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);
|
||||
}
|
||||
if (item.description){
|
||||
|
@ -240,52 +240,52 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
this.updateUrl();
|
||||
}
|
||||
|
||||
private _getDmpLookup(): string[] {
|
||||
private _getPlanLookup(): string[] {
|
||||
return [
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.description)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.version)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.versionStatus)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.hash)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(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.dmp), nameof<Dmp>(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.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(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.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.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.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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(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.dmp), nameof<Dmp>(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.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.description)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.version)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.versionStatus)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.hash)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.CreateNewVersionPlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.DeletePlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.ClonePlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.FinalizePlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.ExportPlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.AssignPlanUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.EditPlan].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(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.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.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.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.descriptionTemplates), nameof<DescriptionTemplatesInSection>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.type), nameof<ReferenceType>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.plan), nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].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.plan), nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].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.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.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.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.dmp), nameof<Dmp>(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.dmp), nameof<Dmp>(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.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(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.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.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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.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.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.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.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.id)].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.plan), nameof<Plan>(x => x.accessType)].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.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(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.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.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.hasTemplates)].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.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].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.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].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.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.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.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.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.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<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>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<div *ngIf="this.sections.length > 1" class="row">
|
||||
<div class="col-12">
|
||||
<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-option *ngFor="let section of sections" [value]="section.id">{{section.label}}</mat-option>
|
||||
</mat-select>
|
||||
|
|
|
@ -6,18 +6,18 @@ import { Observable } from "rxjs";
|
|||
import { Inject } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { Dmp, DmpDescriptionTemplate } from '@app/core/model/plan/plan';
|
||||
import { DmpService } from '@app/core/services/plan/plan.service';
|
||||
import { Plan, PlanDescriptionTemplate } from '@app/core/model/plan/plan';
|
||||
import { PlanService } from '@app/core/services/plan/plan.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 { DmpLookup } from '@app/core/query/plan.lookup';
|
||||
import { PlanLookup } from '@app/core/query/plan.lookup';
|
||||
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 { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
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({
|
||||
selector: 'description-copy-dialog-component',
|
||||
|
@ -26,54 +26,54 @@ import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, Dm
|
|||
})
|
||||
export class DescriptionCopyDialogComponent {
|
||||
|
||||
dmpModel: Dmp;
|
||||
sections: DmpBlueprintDefinitionSection[] = [];
|
||||
dmpModel: Plan;
|
||||
sections: PlanBlueprintDefinitionSection[] = [];
|
||||
descriptionDescriptionTemplateLabel: String;
|
||||
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)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.dmpService.query(this.buildDmpLookup(searchQuery, null, null, this.dmpDescriptionTemplateLookup)).pipe(map(x => x.items)),
|
||||
getSelectedItem: (selectedItem: any) => this.dmpService.query(this.buildDmpLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: Dmp) => item.label,
|
||||
titleFn: (item: Dmp) => item.label,
|
||||
valueAssign: (item: Dmp) => this.findSection(item),
|
||||
initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
|
||||
getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: Plan) => item.label,
|
||||
titleFn: (item: Plan) => item.label,
|
||||
valueAssign: (item: Plan) => this.findSection(item),
|
||||
};
|
||||
|
||||
dmpDescriptionTemplateLookup: DmpDescriptionTemplateLookup = {
|
||||
planDescriptionTemplateLookup: PlanDescriptionTemplateLookup = {
|
||||
descriptionTemplateGroupIds: [this.data.descriptionTemplate.groupId],
|
||||
isActive: [IsActive.Active]
|
||||
} as DmpDescriptionTemplateLookup;
|
||||
} as PlanDescriptionTemplateLookup;
|
||||
|
||||
private buildDmpLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup {
|
||||
const lookup: DmpLookup = new DmpLookup();
|
||||
private buildPlanLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
|
||||
const lookup: PlanLookup = new PlanLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
|
||||
if (ids && ids.length > 0) { lookup.ids = ids; }
|
||||
lookup.isActive = [IsActive.Active];
|
||||
lookup.statuses = [DmpStatus.Draft];
|
||||
lookup.statuses = [PlanStatus.Draft];
|
||||
lookup.project = {
|
||||
fields: [
|
||||
nameof<Dmp>(x => x.id),
|
||||
nameof<Dmp>(x => x.label),
|
||||
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(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<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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.id),
|
||||
nameof<Plan>(x => x.label),
|
||||
[nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
[nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
|
||||
[nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.hasTemplates)].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;
|
||||
lookup.order = { items: [nameof<Dmp>(x => x.label)] };
|
||||
if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
|
||||
lookup.order = { items: [nameof<Plan>(x => x.label)] };
|
||||
if (like) { lookup.like = this.filterService.transformLike(like); }
|
||||
return lookup;
|
||||
}
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<DescriptionCopyDialogComponent>,
|
||||
public dmpService: DmpService,
|
||||
public planService: PlanService,
|
||||
public descriptionService: DescriptionService,
|
||||
public language: TranslateService,
|
||||
private filterService: FilterService,
|
||||
|
@ -83,8 +83,8 @@ export class DescriptionCopyDialogComponent {
|
|||
ngOnInit() {
|
||||
}
|
||||
|
||||
findSection(dmp: Dmp){
|
||||
const availableSectionIds = dmp.dmpDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId);
|
||||
findSection(dmp: Plan){
|
||||
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)) || [];
|
||||
if(this.sections.length == 1){
|
||||
this.data.formGroup.get('sectionId').setValue(this.sections[0].id);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="heading">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION' | translate}}</div>
|
||||
<span class="hint">{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-HINT' | translate}}</span>
|
||||
<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">
|
||||
</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">
|
||||
|
|
|
@ -6,7 +6,7 @@ import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/descript
|
|||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
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 { BaseComponent } from '@common/base/base.component';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@ -40,8 +40,8 @@ export class DescriptionBaseFieldsEditorComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
private loadDescriptionTemplates(): void {
|
||||
const dmpDescriptionTemplates: DmpDescriptionTemplate[] = this.description.dmp.dmpDescriptionTemplates.filter(x => x.sectionId == this.description.dmpDescriptionTemplate.sectionId && x.isActive == IsActive.Active);
|
||||
const currentVersionsOfDescriptionTemplates = dmpDescriptionTemplates.map(x => x.currentDescriptionTemplate);
|
||||
const planDescriptionTemplates: PlanDescriptionTemplate[] = this.description.plan.planDescriptionTemplates.filter(x => x.sectionId == this.description.planDescriptionTemplate.sectionId && x.isActive == IsActive.Active);
|
||||
const currentVersionsOfDescriptionTemplates = planDescriptionTemplates.map(x => x.currentDescriptionTemplate);
|
||||
this.availableDescriptionTemplates.push(...currentVersionsOfDescriptionTemplates);
|
||||
|
||||
if (this.description?.descriptionTemplate != null) {
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
<div class="description-title">{{'DESCRIPTION-EDITOR.TITLE-PREVIEW-DESCRIPTION' | translate}}</div>
|
||||
</ng-template>
|
||||
<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">: {{ item?.dmp?.label }}</div>
|
||||
<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>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<button [disabled]="saving" mat-menu-item (click)="saveAndContinue()" type="button">{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
|
||||
</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="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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -86,11 +86,11 @@
|
|||
<div class="row editor-content">
|
||||
<div style="width: 22em;" class="d-flex flex-column">
|
||||
<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>
|
||||
<span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span>
|
||||
</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 class="row stepper-title">
|
||||
<div class="col-12 pl-0 mb-1"><span>{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</span></div>
|
||||
|
|
|
@ -4,15 +4,15 @@ import { MatDialog } from '@angular/material/dialog';
|
|||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
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 { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { LockTargetType } from '@app/core/common/enum/lock-target-type';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
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 { DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { DmpDescriptionTemplate } from '@app/core/model/plan/plan';
|
||||
import { PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { PlanDescriptionTemplate } from '@app/core/model/plan/plan';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.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) => {
|
||||
|
||||
const itemId = params['id'];
|
||||
const dmpId = params['dmpId'];
|
||||
const copyDmpId = params['copyDmpId'];
|
||||
const dmpSectionId = params['dmpSectionId'];
|
||||
const planId = params['planId'];
|
||||
const copyPlanId = params['copyPlanId'];
|
||||
const planSectionId = params['planSectionId'];
|
||||
|
||||
const isPublicDescription = params['public'];
|
||||
const newDmpId = params['newDmpId'];
|
||||
|
@ -146,7 +146,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.anchorFieldsetId = params['fieldsetId'] ?? null;
|
||||
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;
|
||||
|
||||
|
@ -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');
|
||||
|
||||
}
|
||||
else if (dmpId != null && dmpSectionId != null) {
|
||||
else if (planId != null && planSectionId != null) {
|
||||
this.isNew = true;
|
||||
const dialogRef = this.dialog.open(PrefillDescriptionDialogComponent, {
|
||||
width: '590px',
|
||||
minHeight: '200px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
dmp: this.item.dmp,
|
||||
dmpSectionId: dmpSectionId
|
||||
plan: this.item.plan,
|
||||
planSectionId: planSectionId
|
||||
},
|
||||
panelClass: 'custom-modalbox'
|
||||
});
|
||||
|
@ -171,11 +171,11 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
if (result) {
|
||||
this.titleService.setTitle(result.label);
|
||||
|
||||
result.dmp = this.item.dmp;
|
||||
result.dmpDescriptionTemplate = this.item.dmpDescriptionTemplate;
|
||||
result.plan = this.item.plan;
|
||||
result.planDescriptionTemplate = this.item.planDescriptionTemplate;
|
||||
|
||||
const sectionId = this.item.dmpDescriptionTemplate.sectionId;
|
||||
result.dmpDescriptionTemplate = this.item.dmp.dmpDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == result.descriptionTemplate.groupId);
|
||||
const sectionId = this.item.planDescriptionTemplate.sectionId;
|
||||
result.planDescriptionTemplate = this.item.plan.planDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == result.descriptionTemplate.groupId);
|
||||
|
||||
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
|
||||
|
@ -210,14 +210,14 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
prepareForm(data: Description) {
|
||||
try {
|
||||
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.initialTemplateId = data?.descriptionTemplate?.id?.toString();
|
||||
if (data && data.dmpDescriptionTemplate?.sectionId && data.dmp?.blueprint?.definition?.sections?.length > 0 && data.dmp?.descriptions?.length > 0) {
|
||||
const section = data.dmp?.blueprint?.definition?.sections.find(x => x.id == data.dmpDescriptionTemplate?.sectionId);
|
||||
if (data && data.planDescriptionTemplate?.sectionId && data.plan?.blueprint?.definition?.sections?.length > 0 && data.plan?.descriptions?.length > 0) {
|
||||
const section = data.plan?.blueprint?.definition?.sections.find(x => x.id == data.planDescriptionTemplate?.sectionId);
|
||||
if (section.hasTemplates) {
|
||||
const notAvailableDescriptionTemplates = this.calculateMultiplicityRejectedDmpDescriptionTemplates(section, data.dmp.descriptions.filter(x => x.isActive == IsActive.Active));
|
||||
this.item.dmp.dmpDescriptionTemplates = data.dmp.dmpDescriptionTemplates.filter(x => !notAvailableDescriptionTemplates.map(y => y.id).includes(x.id))
|
||||
const notAvailableDescriptionTemplates = this.calculateMultiplicityRejectedPlanDescriptionTemplates(section, data.plan.descriptions.filter(x => x.isActive == IsActive.Active));
|
||||
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;
|
||||
|
@ -233,8 +233,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
}
|
||||
|
||||
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.canReview = this.permissionPerSection && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()] && this.permissionPerSection[this.item.dmpDescriptionTemplate.sectionId.toString()].some(x => x === AppPermission.ReviewDescription);
|
||||
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.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);
|
||||
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);;
|
||||
|
@ -252,21 +252,21 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.registerFormListeners();
|
||||
}
|
||||
|
||||
calculateMultiplicityRejectedDmpDescriptionTemplates(section: DmpBlueprintDefinitionSection, descriptions: Description[]): DmpDescriptionTemplate[] {
|
||||
calculateMultiplicityRejectedPlanDescriptionTemplates(section: PlanBlueprintDefinitionSection, descriptions: Description[]): PlanDescriptionTemplate[] {
|
||||
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 => {
|
||||
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) {
|
||||
rejectedDmpDescriptionTemplates.push.apply(rejectedDmpDescriptionTemplates, commonDescriptions.map(x => x.dmpDescriptionTemplate));
|
||||
rejectedPlanDescriptionTemplates.push.apply(rejectedPlanDescriptionTemplates, commonDescriptions.map(x => x.planDescriptionTemplate));
|
||||
}
|
||||
}
|
||||
})
|
||||
return rejectedDmpDescriptionTemplates;
|
||||
return rejectedPlanDescriptionTemplates;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
|
||||
formSubmit(onSuccess?: (response) => void): void {
|
||||
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.persistEntity(onSuccess);
|
||||
} else {
|
||||
|
@ -331,9 +331,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
saveAndClose() {
|
||||
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);
|
||||
const dmpId = this.formGroup.get('dmpId').value;
|
||||
const planId = this.formGroup.get('planId').value;
|
||||
this.formGroup = null;
|
||||
this.backToDmp(dmpId);
|
||||
this.backToDmp(planId);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -414,8 +414,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.formService.validateAllFormFields(this.formGroup);
|
||||
}
|
||||
|
||||
backToDmp(dmpId) {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', dmpId])]);
|
||||
backToDmp(planId) {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', planId])]);
|
||||
}
|
||||
|
||||
private showSaveStateValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
|
||||
|
@ -547,8 +547,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
}
|
||||
|
||||
hasReversableStatus(): boolean {
|
||||
if (this.item?.dmp) {
|
||||
return (this.item.dmp.status == DmpStatus.Draft && this.isFinalized);
|
||||
if (this.item?.plan) {
|
||||
return (this.item.plan.status == PlanStatus.Draft && this.isFinalized);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -641,9 +641,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.formGroup.setControl('properties', this.editorModel.buildProperties(this.visibilityRulesService));
|
||||
this.item.descriptionTemplate = descriptionTemplate;
|
||||
|
||||
const sectionId = this.item.dmpDescriptionTemplate.sectionId;
|
||||
this.item.dmpDescriptionTemplate = this.item.dmp.dmpDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == descriptionTemplate.groupId);
|
||||
this.formGroup.get('dmpDescriptionTemplateId').setValue(this.item.dmpDescriptionTemplate.id);
|
||||
const sectionId = this.item.planDescriptionTemplate.sectionId;
|
||||
this.item.planDescriptionTemplate = this.item.plan.planDescriptionTemplates.find(x => x.sectionId == sectionId && x.descriptionTemplateGroupId == descriptionTemplate.groupId);
|
||||
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.pageToFieldSetMap = this.mapPageToFieldSet(this.item.descriptionTemplate);
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ import { VisibilityRulesService } from "./description-form/visibility-rules/visi
|
|||
|
||||
export class DescriptionEditorModel extends BaseEditorModel implements DescriptionPersist {
|
||||
label: string;
|
||||
dmpId: Guid;
|
||||
dmpDescriptionTemplateId: Guid;
|
||||
planId: Guid;
|
||||
planDescriptionTemplateId: Guid;
|
||||
descriptionTemplateId: Guid;
|
||||
status: DescriptionStatus;
|
||||
description: string;
|
||||
|
@ -33,8 +33,8 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
|
|||
if (item) {
|
||||
super.fromModel(item);
|
||||
this.label = item.label;
|
||||
this.dmpId = item.dmp?.id;
|
||||
this.dmpDescriptionTemplateId = item.dmpDescriptionTemplate?.id;
|
||||
this.planId = item.plan?.id;
|
||||
this.planDescriptionTemplateId = item.planDescriptionTemplate?.id;
|
||||
this.descriptionTemplateId = item.descriptionTemplate?.id;
|
||||
this.status = item.status ?? DescriptionStatus.Draft;
|
||||
this.description = item.description;
|
||||
|
@ -50,8 +50,8 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
|
|||
return this.formBuilder.group({
|
||||
id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators],
|
||||
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
|
||||
dmpId: [{ value: this.dmpId, disabled: disabled }, context.getValidation('dmpId').validators],
|
||||
dmpDescriptionTemplateId: [{ value: this.dmpDescriptionTemplateId, disabled: disabled }, context.getValidation('dmpDescriptionTemplateId').validators],
|
||||
planId: [{ value: this.planId, disabled: disabled }, context.getValidation('planId').validators],
|
||||
planDescriptionTemplateId: [{ value: this.planDescriptionTemplateId, disabled: disabled }, context.getValidation('planDescriptionTemplateId').validators],
|
||||
descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId').validators],
|
||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').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>();
|
||||
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
|
||||
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: 'dmpDescriptionTemplateId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'dmpDescriptionTemplateId')] });
|
||||
baseValidationArray.push({ key: 'planId', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'planId')] });
|
||||
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: 'status', validators: [CustomValidators.required(), BackendErrorValidator(this.validationErrorModel, 'status')] });
|
||||
baseValidationArray.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||
|
|
|
@ -83,7 +83,7 @@ const routes: Routes = [
|
|||
}
|
||||
},
|
||||
{
|
||||
path: ':dmpId/:dmpSectionId',
|
||||
path: ':planId/:planSectionId',
|
||||
canActivate: [AuthGuard],
|
||||
component: DescriptionEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
|
@ -99,7 +99,7 @@ const routes: Routes = [
|
|||
}
|
||||
},
|
||||
{
|
||||
path: 'copy/:id/:copyDmpId/:dmpSectionId',
|
||||
path: 'copy/:id/:copyPlanId/:planSectionId',
|
||||
canActivate: [AuthGuard],
|
||||
component: DescriptionEditorComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
|
|
|
@ -20,7 +20,7 @@ import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-
|
|||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DmpUser } from '@app/core/model/plan/plan';
|
||||
import { PlanUser } from '@app/core/model/plan/plan';
|
||||
|
||||
@Component({
|
||||
selector: 'app-description-form-field-set',
|
||||
|
@ -35,7 +35,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
|
|||
@Input() hideAnnotations: boolean = false;
|
||||
@Input() canReview: boolean = false;
|
||||
@Input() numbering: string;
|
||||
@Input() dmpUsers: DmpUser[] = [];
|
||||
@Input() dmpUsers: PlanUser[] = [];
|
||||
|
||||
get isMultiplicityEnabled() {
|
||||
return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null;
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<ng-container *ngIf="field.data.multipleSelect">
|
||||
<mat-form-field class="col-md-12">
|
||||
<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>
|
||||
<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>
|
||||
|
@ -91,7 +91,7 @@
|
|||
<ng-container *ngIf="!(field.data.multipleSelect)">
|
||||
<mat-form-field class="col-md-12">
|
||||
<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>
|
||||
<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>
|
||||
|
|
|
@ -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 { StorageFile } from '@app/core/model/storage-file/storage-file';
|
||||
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 { ReferenceService } from '@app/core/services/reference/reference.service';
|
||||
import { StorageFileService } from '@app/core/services/storage-file/storage-file.service';
|
||||
|
@ -80,7 +80,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
|
|||
|
||||
constructor(
|
||||
private language: TranslateService,
|
||||
public dmpService: DmpService,
|
||||
public planService: PlanService,
|
||||
public descriptionService: DescriptionService,
|
||||
public tagService: TagService,
|
||||
private cdr: ChangeDetectorRef,
|
||||
|
|
|
@ -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 { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { DmpUser } from '@app/core/model/plan/plan';
|
||||
import { PlanUser } from '@app/core/model/plan/plan';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -26,7 +26,7 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On
|
|||
@Input() visibilityRulesService: VisibilityRulesService;
|
||||
@Input() path: string;
|
||||
@Input() descriptionId: Guid;
|
||||
@Input() dmpUsers: DmpUser[] = [];
|
||||
@Input() dmpUsers: PlanUser[] = [];
|
||||
|
||||
|
||||
// @Input() descriptionTemplateId: String;
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Guid } from '@common/types/guid';
|
|||
import { LinkToScroll } from '../table-of-contents/table-of-contents.component';
|
||||
import { DescriptionFormAnnotationService } from './description-form-annotation.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({
|
||||
selector: 'app-description-form',
|
||||
|
@ -27,7 +27,7 @@ export class DescriptionFormComponent extends BaseComponent implements OnInit, O
|
|||
@Input() datasetDescription: String;
|
||||
@Input() linkToScroll: LinkToScroll;
|
||||
@Input() validationErrorModel: ValidationErrorModel;
|
||||
@Input() dmpUsers: DmpUser[] = [];
|
||||
@Input() dmpUsers: PlanUser[] = [];
|
||||
|
||||
@Output() formChanged: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { UntypedFormGroup } from "@angular/forms";
|
|||
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
|
||||
import { DescriptionPrefillingRequest, PrefillingSearchRequest } from "@app/core/model/description-prefilling-request/description-prefilling-request";
|
||||
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 { PrefillingSourceService } from "@app/core/services/prefilling-source/prefilling-source.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;
|
||||
prefillForm: UntypedFormGroup;
|
||||
|
||||
dmp: Dmp;
|
||||
dmpSectionId: Guid;
|
||||
dmp: Plan;
|
||||
planSectionId: Guid;
|
||||
availableDescriptionTemplates: DescriptionTemplate[] = [];
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<PrefillDescriptionDialogComponent>,
|
||||
|
@ -43,13 +43,13 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
|
|||
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
super();
|
||||
|
||||
this.dmp = data.dmp;
|
||||
this.dmpSectionId = data.dmpSectionId;
|
||||
this.availableDescriptionTemplates = this.dmp.dmpDescriptionTemplates.filter(x => x.sectionId == this.dmpSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
|
||||
this.dmp = data.plan;
|
||||
this.planSectionId = data.planSectionId;
|
||||
this.availableDescriptionTemplates = this.dmp.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
|
||||
}
|
||||
|
||||
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.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {
|
||||
|
|
|
@ -4,14 +4,14 @@ import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
|||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
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 { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan';
|
||||
import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
|
||||
import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
import { Reference } from '@app/core/model/reference/reference';
|
||||
import { Tag } from '@app/core/model/tag/tag';
|
||||
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 { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
||||
|
@ -26,7 +26,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
|
|||
private descriptionService: DescriptionService,
|
||||
private breadcrumbService: BreadcrumbService,
|
||||
private language: TranslateService,
|
||||
private dmpService: DmpService
|
||||
private planService: PlanService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
|
|||
public static lookupFields(): string[] {
|
||||
return [
|
||||
...DescriptionEditorEntityResolver.descriptionLookupFields(),
|
||||
...DescriptionEditorEntityResolver.dmpLookupFields(nameof<Description>(x => x.dmp)),
|
||||
...DescriptionEditorEntityResolver.dmpLookupFields(nameof<Description>(x => x.plan)),
|
||||
...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.ReviewDescription].join('.'),
|
||||
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].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.ordinal)].join('.'),
|
||||
|
@ -117,44 +117,44 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
|
|||
|
||||
public static dmpLookupFields(prefix?: string): string[] {
|
||||
return [
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.label)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.status)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.label)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.status)].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<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(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<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(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<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<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.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition)].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<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(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.ordinal)].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<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<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<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<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(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<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(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.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(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.label)].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<Dmp>(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<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(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<Dmp>(x => x.descriptions), nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.sectionId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.name)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.descriptions), nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.sectionId)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.name)].join('.'),
|
||||
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].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()
|
||||
];
|
||||
const id = route.paramMap.get('id');
|
||||
const dmpId = route.paramMap.get('dmpId');
|
||||
const dmpSectionId = route.paramMap.get('dmpSectionId');
|
||||
const copyDmpId = route.paramMap.get('copyDmpId');
|
||||
const planId = route.paramMap.get('planId');
|
||||
const planSectionId = route.paramMap.get('planSectionId');
|
||||
const copyPlanId = route.paramMap.get('copyPlanId');
|
||||
const fieldsetId = route.paramMap.get('fieldsetId');
|
||||
if (id != null && copyDmpId == null && dmpSectionId == null) {
|
||||
if (id != null && copyPlanId == null && planSectionId == null) {
|
||||
if (fieldsetId != null) {
|
||||
this.breadcrumbService.addExcludedParam(fieldsetId, true);
|
||||
this.breadcrumbService.addExcludedParam('f', 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)));
|
||||
} else if (dmpId != null && dmpSectionId != null && copyDmpId == null) {
|
||||
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorEntityResolver.dmpLookupFields())
|
||||
} else if (planId != null && planSectionId != null && copyPlanId == null) {
|
||||
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addExcludedParam(dmpId, true);
|
||||
this.breadcrumbService.addIdResolvedValue(dmpSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
this.breadcrumbService.addExcludedParam(planId, true);
|
||||
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
}), takeUntil(this._destroyed), map(dmp => {
|
||||
const description: Description = {};
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
sectionId: Guid.parse(dmpSectionId)
|
||||
description.plan = dmp;
|
||||
description.planDescriptionTemplate = {
|
||||
sectionId: Guid.parse(planSectionId)
|
||||
}
|
||||
return description;
|
||||
}));
|
||||
} else if (copyDmpId != null && id != null && dmpSectionId != 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 => {
|
||||
} else if (copyPlanId != null && id != null && planSectionId != null) {
|
||||
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
|
||||
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addExcludedParam(copyDmpId, true)
|
||||
this.breadcrumbService.addExcludedParam(dmpSectionId, true)
|
||||
this.breadcrumbService.addExcludedParam(copyPlanId, true)
|
||||
this.breadcrumbService.addExcludedParam(planSectionId, true)
|
||||
this.breadcrumbService.addIdResolvedValue(id, x.label)
|
||||
}), takeUntil(this._destroyed), map(description => {
|
||||
|
||||
description.id = null;
|
||||
description.hash = null;
|
||||
description.status = DescriptionStatus.Draft;
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
id: dmp.dmpDescriptionTemplates.filter(x => x.sectionId == Guid.parse(dmpSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
|
||||
sectionId: Guid.parse(dmpSectionId)
|
||||
description.plan = dmp;
|
||||
description.planDescriptionTemplate = {
|
||||
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
|
||||
sectionId: Guid.parse(planSectionId)
|
||||
}
|
||||
return description;
|
||||
}));
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { Description, DescriptionSectionPermissionResolver } from '@app/core/model/description/description';
|
||||
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 { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
||||
|
@ -19,7 +19,7 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
|
|||
private descriptionService: DescriptionService,
|
||||
private breadcrumbService: BreadcrumbService,
|
||||
private language: TranslateService,
|
||||
private dmpService: DmpService
|
||||
private planService: PlanService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
@ -30,66 +30,66 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
|
|||
...DescriptionEditorEntityResolver.lookupFields()
|
||||
];
|
||||
const id = route.paramMap.get('id');
|
||||
const dmpId = route.paramMap.get('dmpId');
|
||||
const dmpSectionId = route.paramMap.get('dmpSectionId');
|
||||
const copyDmpId = route.paramMap.get('copyDmpId');
|
||||
const planId = route.paramMap.get('planId');
|
||||
const planSectionId = route.paramMap.get('planSectionId');
|
||||
const copyPlanId = route.paramMap.get('copyPlanId');
|
||||
// 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)))
|
||||
.pipe(mergeMap( description => {
|
||||
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
|
||||
dmpId: description.dmp.id,
|
||||
sectionIds: [description.dmpDescriptionTemplate.sectionId],
|
||||
planId: description.plan.id,
|
||||
sectionIds: [description.planDescriptionTemplate.sectionId],
|
||||
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
|
||||
}
|
||||
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
|
||||
}));
|
||||
|
||||
} else if (dmpId != null && dmpSectionId != null && copyDmpId == null) {
|
||||
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorEntityResolver.dmpLookupFields())
|
||||
} else if (planId != null && planSectionId != null && copyPlanId == null) {
|
||||
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addExcludedParam(dmpId, true);
|
||||
this.breadcrumbService.addIdResolvedValue(dmpSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
this.breadcrumbService.addExcludedParam(planId, true);
|
||||
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
}), takeUntil(this._destroyed), map(dmp => {
|
||||
const description: Description = {};
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
sectionId: Guid.parse(dmpSectionId)
|
||||
description.plan = dmp;
|
||||
description.planDescriptionTemplate = {
|
||||
sectionId: Guid.parse(planSectionId)
|
||||
}
|
||||
return description;
|
||||
}))
|
||||
.pipe(mergeMap( description => {
|
||||
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
|
||||
dmpId: description.dmp.id,
|
||||
sectionIds: [description.dmpDescriptionTemplate.sectionId],
|
||||
planId: description.plan.id,
|
||||
sectionIds: [description.planDescriptionTemplate.sectionId],
|
||||
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
|
||||
}
|
||||
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
|
||||
}));
|
||||
} else if (copyDmpId != null && id != null && dmpSectionId != 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 => {
|
||||
} else if (copyPlanId != null && id != null && planSectionId != null) {
|
||||
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
|
||||
//TODO
|
||||
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addExcludedParam(copyDmpId, true)
|
||||
this.breadcrumbService.addExcludedParam(dmpSectionId, true)
|
||||
this.breadcrumbService.addExcludedParam(copyPlanId, true)
|
||||
this.breadcrumbService.addExcludedParam(planSectionId, true)
|
||||
this.breadcrumbService.addIdResolvedValue(id, x.label)
|
||||
}), takeUntil(this._destroyed), map(description => {
|
||||
|
||||
description.id = null;
|
||||
description.hash = null;
|
||||
description.status = DescriptionStatus.Draft;
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
id: dmp.dmpDescriptionTemplates.filter(x => x.sectionId == Guid.parse(dmpSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
|
||||
sectionId: Guid.parse(dmpSectionId)
|
||||
description.plan = dmp;
|
||||
description.planDescriptionTemplate = {
|
||||
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
|
||||
sectionId: Guid.parse(planSectionId)
|
||||
}
|
||||
return description;
|
||||
}));
|
||||
})).pipe(mergeMap( description => {
|
||||
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
|
||||
dmpId: description.dmp.id,
|
||||
sectionIds: [description.dmpDescriptionTemplate.sectionId],
|
||||
planId: description.plan.id,
|
||||
sectionIds: [description.planDescriptionTemplate.sectionId],
|
||||
permissions: [AppPermission.EditDescription, AppPermission.DeleteDescription, AppPermission.FinalizeDescription, AppPermission.ReviewDescription]
|
||||
}
|
||||
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
</button>
|
||||
</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()">
|
||||
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
|
||||
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<div class="row pt-4">
|
||||
<!-- Sort by -->
|
||||
<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 class="col-12 col-xl-auto order-3 order-xl-2">
|
||||
<mat-form-field class="sort-form w-100">
|
||||
|
|
|
@ -9,9 +9,9 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
|||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { BaseDescription, Description } from '@app/core/model/description/description';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Dmp, DmpDescriptionTemplate, DmpUser } from '@app/core/model/plan/plan';
|
||||
import { DmpReference } from '@app/core/model/plan/plan-reference';
|
||||
import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Plan, PlanDescriptionTemplate, PlanUser } from '@app/core/model/plan/plan';
|
||||
import { PlanReference } from '@app/core/model/plan/plan-reference';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
import { Reference } from '@app/core/model/reference/reference';
|
||||
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 { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
||||
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 { PageLoadEvent, SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
@ -51,7 +51,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
titlePrefix: String;
|
||||
dmpId: string;
|
||||
planId: string;
|
||||
status: Number;
|
||||
totalCount: number;
|
||||
dmpSearchEnabled = true;
|
||||
|
@ -71,7 +71,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
|
||||
scrollbar: boolean;
|
||||
order = RecentActivityOrder;
|
||||
dmpText: string;
|
||||
planText: string;
|
||||
descriptionText: string;
|
||||
|
||||
private _sortDirection: SortDirection = SortDirection.Descending;
|
||||
|
@ -95,7 +95,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
}
|
||||
get hasFilters(): boolean {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
useOrb: true,
|
||||
steps: [
|
||||
{
|
||||
selector: '.dmp-tour',
|
||||
selector: '.plan-tour',
|
||||
content: 'Step 1',
|
||||
orientation: Orientation.Right,
|
||||
isStepUnique: false
|
||||
|
@ -244,13 +244,13 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
|
||||
orderByChanged() {
|
||||
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) {
|
||||
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) {
|
||||
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.finalizedAt)] };
|
||||
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Plan>(x => x.finalizedAt)] };
|
||||
}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);
|
||||
}
|
||||
|
@ -296,11 +296,11 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
}
|
||||
|
||||
public setDashboardTourDmpText(): void {
|
||||
this.dmpText = this.language.instant('DMP-LISTING.TEXT-INFO') + '\n\n' +
|
||||
this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' +
|
||||
this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' +
|
||||
this.language.instant('DMP-LISTING.GET-IDEA');
|
||||
this.dashboardTour.steps[0].title = this.dmpText;
|
||||
this.planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
|
||||
this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
|
||||
this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
|
||||
this.language.instant('PLAN-LISTING.GET-IDEA');
|
||||
this.dashboardTour.steps[0].title = this.planText;
|
||||
}
|
||||
|
||||
public setDashboardTourDescriptionText(): void {
|
||||
|
@ -310,12 +310,12 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
this.dashboardTour.steps[1].title = this.descriptionText;
|
||||
}
|
||||
|
||||
openNewDmpDialog() {
|
||||
openNewPlanDialog() {
|
||||
if (this.dialog.openDialogs.length > 0) {
|
||||
this.dialog.closeAll();
|
||||
}
|
||||
else {
|
||||
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, {
|
||||
const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
|
||||
disableClose: false,
|
||||
data: {
|
||||
isDialog: true
|
||||
|
@ -326,23 +326,23 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
|
||||
addNewDescription() {
|
||||
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, {
|
||||
disableClose: false,
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
startNewDmp: false,
|
||||
startNewPlan: false,
|
||||
formGroup: formGroup,
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
if (result.startNewDmp) {
|
||||
this.openNewDmpDialog();
|
||||
if (result.startNewPlan) {
|
||||
this.openNewPlanDialog();
|
||||
} 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 roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0;
|
||||
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) {
|
||||
lookup.dmpSubQuery.dmpUserSubQuery = DescriptionFilterService.initializeDmpUserLookup();
|
||||
lookup.dmpSubQuery.dmpUserSubQuery.userRoles = roles;
|
||||
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
|
||||
lookup.planSubQuery.planUserSubQuery.userRoles = roles;
|
||||
}
|
||||
} else lookup.dmpSubQuery = null;
|
||||
} else lookup.planSubQuery = null;
|
||||
|
||||
// Tags
|
||||
let tags = formGroup.get("tags")?.value ?? null;
|
||||
|
@ -432,9 +432,9 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
_buildFormFromLookup(lookup: DescriptionLookup, referenceFilters: ReferencesWithType[]): UntypedFormGroup {
|
||||
return (new UntypedFormBuilder()).group({
|
||||
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] : [],
|
||||
associatedDmpIds: lookup.dmpSubQuery?.ids ? [lookup.dmpSubQuery?.ids] : [],
|
||||
associatedDmpIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [],
|
||||
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.descriptionTemplateSubQuery) count += lookup.descriptionTemplateSubQuery.ids?.length;
|
||||
if (lookup.descriptionTagSubQuery) count += lookup.descriptionTagSubQuery.tagIds?.length;
|
||||
if (lookup.dmpSubQuery) {
|
||||
if (lookup.dmpSubQuery.ids) count += lookup.dmpSubQuery.ids?.length;
|
||||
if (lookup.dmpSubQuery.dmpUserSubQuery) count += lookup.dmpSubQuery.dmpUserSubQuery.userRoles?.length;
|
||||
if (lookup.planSubQuery) {
|
||||
if (lookup.planSubQuery.ids) count += lookup.planSubQuery.ids?.length;
|
||||
if (lookup.planSubQuery.planUserSubQuery) count += lookup.planSubQuery.planUserSubQuery.userRoles?.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.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.label)].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.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.finalizedAt)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(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.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.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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.finalizedAt)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(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.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.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.hasTemplates)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.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.reference)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ const routes: Routes = [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: 'dmp/:dmpId',
|
||||
path: 'dmp/:planId',
|
||||
component: DescriptionListingComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
|
||||
<!-- Related DMP Filters -->
|
||||
<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-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>
|
||||
</mat-form-field>
|
||||
<hr>
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { AbstractControl, FormBuilder, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
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 { Reference } from '@app/core/model/reference/reference';
|
||||
import { ReferencesWithType } from '@app/core/query/description.lookup';
|
||||
import { ReferenceLookup } from '@app/core/query/reference.lookup';
|
||||
import { AuthService } from '@app/core/services/auth/auth.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 { ReferenceService } from '@app/core/services/reference/reference.service';
|
||||
import { TagService } from '@app/core/services/tag/tag.service';
|
||||
|
@ -41,7 +41,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
|
|||
public filteringTagsAsync = false;
|
||||
|
||||
statuses = DescriptionStatus;
|
||||
dmpRole = DmpUserRole;
|
||||
dmpRole = PlanUserRole;
|
||||
options: UntypedFormGroup;
|
||||
|
||||
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
|
@ -54,7 +54,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
|
|||
public enumUtils: EnumUtils,
|
||||
private authentication: AuthService,
|
||||
private descriptionTemplateService: DescriptionTemplateService,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private tagService: TagService,
|
||||
private referenceService: ReferenceService,
|
||||
private referenceTypeService: ReferenceTypeService,
|
||||
|
@ -71,7 +71,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
|
|||
if (changes['filterFormGroup']) {
|
||||
|
||||
this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildMultipleAutocompleteConfiguration();
|
||||
this.dmpAutoCompleteConfiguration = this.dmpService.multipleAutocompleteConfiguration;
|
||||
this.dmpAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration;
|
||||
this.tagAutoCompleteConfiguration = this.tagService.multipleAutocompleteConfiguration;
|
||||
this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration();
|
||||
this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Injectable } from "@angular/core";
|
||||
import { DescriptionTemplate } from "@app/core/model/description-template/description-template";
|
||||
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 { Tag } from "@app/core/model/tag/tag";
|
||||
import { DescriptionTemplateLookup } from "@app/core/query/description-template.lookup";
|
||||
import { DmpUserLookup } from "@app/core/query/plan-user.lookup";
|
||||
import { DmpLookup } from "@app/core/query/plan.lookup";
|
||||
import { PlanUserLookup } from "@app/core/query/plan-user.lookup";
|
||||
import { PlanLookup } from "@app/core/query/plan.lookup";
|
||||
import { DescriptionReferenceLookup } from "@app/core/query/reference.lookup";
|
||||
import { DescriptionTagLookup } from "@app/core/query/tag.lookup";
|
||||
import { IsActive } from "@notification-service/core/enum/is-active.enum";
|
||||
|
@ -41,26 +41,26 @@ export class DescriptionFilterService {
|
|||
return lookup;
|
||||
}
|
||||
|
||||
public static initializeDmpLookup(): DmpLookup {
|
||||
const lookup = new DmpLookup();
|
||||
public static initializePlanLookup(): PlanLookup {
|
||||
const lookup = new PlanLookup();
|
||||
lookup.metadata = { countAll: true };
|
||||
lookup.isActive = [IsActive.Active];
|
||||
lookup.project = {
|
||||
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;
|
||||
}
|
||||
|
||||
public static initializeDmpUserLookup(): DmpUserLookup {
|
||||
const lookup = new DmpUserLookup();
|
||||
public static initializePlanUserLookup(): PlanUserLookup {
|
||||
const lookup = new PlanUserLookup();
|
||||
lookup.metadata = { countAll: true };
|
||||
lookup.isActive = [IsActive.Active];
|
||||
lookup.project = {
|
||||
fields: [
|
||||
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
[nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
|
||||
]
|
||||
};
|
||||
|
||||
|
|
|
@ -3,29 +3,29 @@
|
|||
<div class="d-flex flex-direction-row">
|
||||
<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.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 *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 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 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 *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 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.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>.</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 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 dmp-label ml-3">{{'DESCRIPTION-LISTING.DMP' | translate}}</div>
|
||||
<div class="col-auto dmp-label ml-3">{{'DESCRIPTION-LISTING.PLAN' | translate}}</div>
|
||||
</div>
|
||||
<div class="col dmp-title">{{description.dmp?.label}}</div>
|
||||
<div class="col dmp-title">{{description.plan?.label}}</div>
|
||||
</div>
|
||||
</a>
|
||||
<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="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="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
|
||||
</div>
|
||||
|
|
|
@ -3,12 +3,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|||
import { UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
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 { Description } from '@app/core/model/description/description';
|
||||
import { AuthService } from '@app/core/services/auth/auth.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 { LockService } from '@app/core/services/lock/lock.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;
|
||||
descriptionStatusEnum = DescriptionStatus;
|
||||
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||
dmpAccessTypeEnum = DmpAccessType;
|
||||
planAccessTypeEnum = PlanAccessType;
|
||||
canDelete: boolean = false;
|
||||
canEdit: boolean = false;
|
||||
canInviteDmpUsers: boolean = false;
|
||||
canInvitePlanUsers: boolean = false;
|
||||
|
||||
|
||||
constructor(
|
||||
|
@ -65,7 +65,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
private lockService: LockService,
|
||||
private location: Location,
|
||||
private fileUtils: FileUtils,
|
||||
public dmpService: DmpService,
|
||||
public planService: PlanService,
|
||||
public referenceService: ReferenceService,
|
||||
public referenceTypeService: ReferenceTypeService,
|
||||
public fileTransformerService: FileTransformerService,
|
||||
|
@ -96,8 +96,8 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
this.canEdit = (this.authService.hasPermission(AppPermission.EditDescription) ||
|
||||
this.description.authorizationFlags?.some(x => x === AppPermission.EditDescription)) && this.description.belongsToCurrentTenant != false;
|
||||
|
||||
this.canInviteDmpUsers = (this.authService.hasPermission(AppPermission.InviteDmpUsers) ||
|
||||
this.description.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers)) && this.description.belongsToCurrentTenant != false;
|
||||
this.canInvitePlanUsers = (this.authService.hasPermission(AppPermission.InvitePlanUsers) ||
|
||||
this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false;
|
||||
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
|
||||
isUserDMPRelated() {
|
||||
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 {
|
||||
|
@ -123,7 +123,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
}
|
||||
|
||||
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() {
|
||||
|
@ -134,16 +134,16 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
autoFocus: false,
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
dmpId: this.description.dmp.id,
|
||||
dmpName: this.description.dmp.label,
|
||||
blueprint: this.description.dmp.blueprint
|
||||
planId: this.description.plan.id,
|
||||
dmpName: this.description.plan.label,
|
||||
blueprint: this.description.plan.blueprint
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
copyToDmp(description: Description) {
|
||||
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),
|
||||
})
|
||||
const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, {
|
||||
|
@ -162,7 +162,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed))
|
||||
.subscribe(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], '/')]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
</div>
|
||||
<div class="row d-flex align-items-center mt-3 mb-4 label-txt">
|
||||
<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 *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>
|
||||
{{'DESCRIPTION-OVERVIEW.PUBLIC' | translate}}
|
||||
</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">
|
||||
<mat-icon class="status-icon">lock_outline</mat-icon>
|
||||
{{'DESCRIPTION-OVERVIEW.LOCKED' | translate}}
|
||||
|
@ -72,9 +72,9 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<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">
|
||||
{{ this.description.dmp.label }}
|
||||
{{ this.description.plan.label }}
|
||||
</div>
|
||||
<div class="w-auto">
|
||||
<mat-icon>launch</mat-icon>
|
||||
|
@ -82,29 +82,29 @@
|
|||
</button>
|
||||
</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="col-auto">{{'DESCRIPTION-OVERVIEW.GRANT' | translate}}</div>
|
||||
</div>
|
||||
<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>
|
||||
</ng-container>
|
||||
<div class="row header">
|
||||
<div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12" *ngFor="let dmpReference of researchers let last = last">
|
||||
<span *ngIf="isOrcid(dmpReference.reference)">
|
||||
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher align-items-center">
|
||||
<div class="col-12" *ngFor="let planReference of researchers let last = last">
|
||||
<span *ngIf="isOrcid(planReference.reference)">
|
||||
<a href="{{ getOrcidPathForResearcher(planReference.reference?.reference) }}" target="blank" class="researcher align-items-center">
|
||||
<div class="id-btn" [matTooltip]="unauthorizedTootipText"> </div>
|
||||
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
|
||||
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
|
||||
<div *ngIf="!last">{{ planReference.reference?.label }}, </div>
|
||||
<div *ngIf="last">{{ planReference.reference?.label }}</div>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="!isOrcid(dmpReference.reference)">
|
||||
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
|
||||
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
|
||||
<span *ngIf="!isOrcid(planReference.reference)">
|
||||
<div *ngIf="!last">{{ planReference.reference?.label }}, </div>
|
||||
<div *ngIf="last">{{ planReference.reference?.label }}</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -190,15 +190,15 @@
|
|||
<p class="header">{{ 'DESCRIPTION-OVERVIEW.DESCRIPTION-AUTHORS' | translate }}</p>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<div class="col pl-0" style="min-width: 0;">
|
||||
<ng-container *ngIf="!isUserAuthor(dmpUser.user?.id); else you">
|
||||
<p class="authors-label">{{ dmpUser.user?.name }}</p>
|
||||
<ng-container *ngIf="!isUserAuthor(planUser.user?.id); else you">
|
||||
<p class="authors-label">{{ planUser.user?.name }}</p>
|
||||
</ng-container>
|
||||
<ng-template #you>
|
||||
<p *ngIf="userName" class="authors-label">{{ userName }}
|
||||
|
@ -207,19 +207,19 @@
|
|||
</ng-template>
|
||||
|
||||
<p class="authors-role">
|
||||
<span>{{ enumUtils.toDmpUserRoleString(dmpUser.role) }} - </span>
|
||||
<span *ngIf="!dmpUser.sectionId">{{ 'DESCRIPTION-OVERVIEW.ROLES.ALL-SECTIONS' | translate}}</span>
|
||||
<span *ngIf="dmpUser.sectionId">{{ getSectionNameById(dmpUser.sectionId) }}</span>
|
||||
<span>{{ enumUtils.toPlanUserRoleString(planUser.role) }} - </span>
|
||||
<span *ngIf="!planUser.sectionId">{{ 'DESCRIPTION-OVERVIEW.ROLES.ALL-SECTIONS' | translate}}</span>
|
||||
<span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-auto" *ngIf="canInviteDmpUsers && description.dmp?.status === dmpStatusEnum.Draft && dmpUser.role != dmpUserRoleEnum.Owner">
|
||||
<button (click)="removeUserFromDmp(dmpUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
||||
<div class="col-auto" *ngIf="canInvitePlanUsers && description.plan?.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner">
|
||||
<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>
|
||||
</button>
|
||||
</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()">
|
||||
<mat-icon>group_add</mat-icon>
|
||||
{{'DESCRIPTION-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
|
||||
|
|
|
@ -4,24 +4,24 @@ import { UntypedFormBuilder, Validators } from '@angular/forms';
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { DmpAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { DmpStatus } from '@app/core/common/enum/plan-status';
|
||||
import { DmpUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { PlanAccessType } from '@app/core/common/enum/plan-access-type';
|
||||
import { PlanStatus } from '@app/core/common/enum/plan-status';
|
||||
import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { Description, DescriptionStatusPersist } from '@app/core/model/description/description';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Dmp, DmpDescriptionTemplate, DmpUser, DmpUserRemovePersist } from '@app/core/model/plan/plan';
|
||||
import { DmpReference } from '@app/core/model/plan/plan-reference';
|
||||
import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Plan, PlanDescriptionTemplate, PlanUser, PlanUserRemovePersist } from '@app/core/model/plan/plan';
|
||||
import { PlanReference } from '@app/core/model/plan/plan-reference';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
import { Reference } from '@app/core/model/reference/reference';
|
||||
import { User } from '@app/core/model/user/user';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.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 { LockService } from '@app/core/services/lock/lock.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 {
|
||||
|
||||
description: any;
|
||||
researchers: DmpReference[] = [];
|
||||
researchers: PlanReference[] = [];
|
||||
isNew = true;
|
||||
isFinalized = false;
|
||||
isPublicView = true;
|
||||
|
@ -62,16 +62,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
expand = false;
|
||||
isLocked: Boolean;
|
||||
descriptionStatusEnum = DescriptionStatus;
|
||||
dmpAccessTypeEnum = DmpAccessType;
|
||||
dmpStatusEnum = DmpStatus;
|
||||
dmpUserRoleEnum = DmpUserRole;
|
||||
planAccessTypeEnum = PlanAccessType;
|
||||
planStatusEnum = PlanStatus;
|
||||
planUserRoleEnum = PlanUserRole;
|
||||
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||
|
||||
canEdit = false;
|
||||
canDelete = false;
|
||||
canFinalize = false;
|
||||
canReview = false;
|
||||
canInviteDmpUsers = false;
|
||||
canInvitePlanUsers = false;
|
||||
|
||||
authorFocus: string;
|
||||
userName: string;
|
||||
|
@ -86,7 +86,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
private language: TranslateService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private configurationService: ConfigurationService,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
public referenceService: ReferenceService,
|
||||
private location: Location,
|
||||
public enumUtils: EnumUtils,
|
||||
|
@ -110,7 +110,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
this.canDelete = false;
|
||||
this.canEdit = false;
|
||||
this.canFinalize = false;
|
||||
this.canInviteDmpUsers = false;
|
||||
this.canInvitePlanUsers = false;
|
||||
// Gets description data using parameter id
|
||||
this.route.params
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
|
@ -126,9 +126,9 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
|
||||
|
||||
this.description = data;
|
||||
this.description.dmp.dmpUsers = data.dmp.dmpUsers.filter(x => x.isActive === IsActive.Active);
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.description?.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
// this.users = this.description.dmp.users;
|
||||
this.description.plan.planUsers = data.plan.planUsers.filter(x => x.isActive === IsActive.Active);
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.description?.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
// this.users = this.description.plan.users;
|
||||
this.checkLockStatus(this.description.id);
|
||||
this.canDelete = (this.authService.hasPermission(AppPermission.DeleteDescription) ||
|
||||
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.description.authorizationFlags?.some(x => x === AppPermission.FinalizeDescription)) && this.description.belongsToCurrentTenant != false;
|
||||
|
||||
this.canInviteDmpUsers = (this.authService.hasPermission(AppPermission.InviteDmpUsers) ||
|
||||
this.description.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers)) && this.description.belongsToCurrentTenant != false;
|
||||
this.canInvitePlanUsers = (this.authService.hasPermission(AppPermission.InvitePlanUsers) ||
|
||||
this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false;
|
||||
// const breadCrumbs = [];
|
||||
// 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 });
|
||||
|
@ -171,8 +171,8 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
|
||||
|
||||
this.description = data;
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.description?.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
// this.users = this.description.dmp.users;
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.description?.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
// this.users = this.description.plan.users;
|
||||
// const breadCrumbs = [];
|
||||
// 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 });
|
||||
|
@ -265,9 +265,9 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
autoFocus: false,
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
dmpId: this.description.dmp.id,
|
||||
dmpName: this.description.dmp.label,
|
||||
blueprint: this.description.dmp.blueprint
|
||||
planId: this.description.plan.id,
|
||||
dmpName: this.description.plan.label,
|
||||
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) {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id.toString()])]);
|
||||
} else {
|
||||
|
@ -355,14 +355,14 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
getSectionNameById(sectionId: Guid): string {
|
||||
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;
|
||||
}
|
||||
|
||||
openCopyToDmpDialog() {
|
||||
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),
|
||||
})
|
||||
const dialogRef = this.dialog.open(DescriptionCopyDialogComponent, {
|
||||
|
@ -372,7 +372,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
formGroup: formGroup,
|
||||
descriptionId: this.description.id,
|
||||
descriptionTemplate: this.description.descriptionTemplate,
|
||||
dmpDescriptionTemplate: this.description.dmpDescriptionTemplate,
|
||||
planDescriptionTemplate: this.description.planDescriptionTemplate,
|
||||
descriptionProfileExist: false,
|
||||
confirmButton: this.language.instant('DESCRIPTION-OVERVIEW.COPY-DIALOG.COPY'),
|
||||
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))
|
||||
.subscribe(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, {
|
||||
data: {
|
||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
|
||||
|
@ -398,12 +398,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
const dmpUserRemovePersist: DmpUserRemovePersist = {
|
||||
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: dmpUser.id,
|
||||
dmpId: this.description.dmp.id,
|
||||
planId: this.description.plan.id,
|
||||
role: dmpUser.role
|
||||
};
|
||||
this.dmpService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.reloadPage();
|
||||
}, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
|
@ -450,7 +450,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -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.DeleteDescription].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.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.groupId)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(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.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.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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(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.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(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.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.label)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.accessType)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.status)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(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.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.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.hasTemplates)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.sectionId)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.id)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.user.name)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.role)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planUsers), nameof<PlanUser>(x => x.isActive)].join('.'),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(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.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.source)].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.plan), nameof<Plan>(x => x.planReferences), nameof<PlanReference>(x => x.isActive)].join('.'),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="form-container">
|
||||
<div mat-dialog-title class="row d-flex p-0 mb-4">
|
||||
<div class="col p-0">
|
||||
<span class="title">{{'DASHBOARD.SELECT-DMP' | translate}}</span>
|
||||
<span class="title">{{'DASHBOARD.SELECT-PLAN' | translate}}</span>
|
||||
</div>
|
||||
<div class="col-auto p-0">
|
||||
<mat-icon class="close-icon" (click)="close()">close</mat-icon>
|
||||
|
@ -10,13 +10,13 @@
|
|||
<div class="row mt-2 mb-4">
|
||||
<div class="col-12">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-auto pb-4">
|
||||
<span>{{'DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS-NOT-ENOUGH' | translate}}</span> <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> <span class="new-dmp" (click)="startNewPlan()">{{'DASHBOARD.ADD-NEW-DESCRIPTION.START-NEW-PLAN' | translate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { Component, Inject } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
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 { DmpBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Dmp } from '@app/core/model/plan/plan';
|
||||
import { PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { Plan } from '@app/core/model/plan/plan';
|
||||
import { DateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { DmpDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
|
||||
import { DmpLookup } from '@app/core/query/plan.lookup';
|
||||
import { DmpService } from '@app/core/services/plan/plan.service';
|
||||
import { PlanDescriptionTemplateLookup } from '@app/core/query/plan-description-template.lookup';
|
||||
import { PlanLookup } from '@app/core/query/plan.lookup';
|
||||
import { PlanService } from '@app/core/services/plan/plan.service';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
|
@ -26,34 +26,34 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
|
|||
|
||||
public isDialog: boolean = false;
|
||||
public formGroup: UntypedFormGroup;
|
||||
public sections: DmpBlueprintDefinitionSection[] = [];
|
||||
public sections: PlanBlueprintDefinitionSection[] = [];
|
||||
|
||||
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||
initialItems: (data?: any) => this.dmpService.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.dmpService.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])),
|
||||
displayFn: (item: Dmp) => item.label,
|
||||
subtitleFn: (item: Dmp) => `${this.language.instant('DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS.CREATED-AT')} ${this.dateTimeFormatPipe.transform(item.createdAt, 'dd/MM/yyyy')}`,
|
||||
titleFn: (item: Dmp) => item.label,
|
||||
valueAssign: (item: Dmp) => item.id,
|
||||
planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||
initialItems: (data?: any) => this.planService.query(this.buildAutocompleteLookup()).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.planService.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: Plan) => item.label,
|
||||
subtitleFn: (item: Plan) => `${this.language.instant('DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS.CREATED-AT')} ${this.dateTimeFormatPipe.transform(item.createdAt, 'dd/MM/yyyy')}`,
|
||||
titleFn: (item: Plan) => item.label,
|
||||
valueAssign: (item: Plan) => item.id,
|
||||
};
|
||||
|
||||
private buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DmpStatus[], dmpDescriptionTemplateSubQuery?: DmpDescriptionTemplateLookup): DmpLookup {
|
||||
const lookup: DmpLookup = new DmpLookup();
|
||||
private buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: PlanStatus[], planDescriptionTemplateSubQuery?: PlanDescriptionTemplateLookup): PlanLookup {
|
||||
const lookup: PlanLookup = new PlanLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; }
|
||||
if (ids && ids.length > 0) { lookup.ids = ids; }
|
||||
lookup.isActive = [IsActive.Active];
|
||||
lookup.statuses = [DmpStatus.Draft];
|
||||
lookup.statuses = [PlanStatus.Draft];
|
||||
lookup.project = {
|
||||
fields: [
|
||||
nameof<Dmp>(x => x.id),
|
||||
nameof<Dmp>(x => x.label),
|
||||
nameof<Dmp>(x => x.createdAt),
|
||||
nameof<Plan>(x => x.id),
|
||||
nameof<Plan>(x => x.label),
|
||||
nameof<Plan>(x => x.createdAt),
|
||||
]
|
||||
};
|
||||
if (dmpDescriptionTemplateSubQuery != null) lookup.dmpDescriptionTemplateSubQuery = dmpDescriptionTemplateSubQuery;
|
||||
lookup.order = { items: [nameof<Dmp>(x => x.label)] };
|
||||
if (planDescriptionTemplateSubQuery != null) lookup.planDescriptionTemplateSubQuery = planDescriptionTemplateSubQuery;
|
||||
lookup.order = { items: [nameof<Plan>(x => x.label)] };
|
||||
if (like) { lookup.like = this.filterService.transformLike(like); }
|
||||
return lookup;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
|
|||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
public dialog: MatDialog,
|
||||
private language: TranslateService,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private filterService: FilterService,
|
||||
private dateTimeFormatPipe: DateTimeFormatPipe
|
||||
) {
|
||||
|
@ -87,8 +87,8 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
|
|||
this.dialogRef.close(this.data);
|
||||
}
|
||||
|
||||
startNewDmp() {
|
||||
this.data.startNewDmp = true;
|
||||
startNewPlan() {
|
||||
this.data.startNewPlan = true;
|
||||
this.dialogRef.close(this.data);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<div class="collapse navbar-collapse justify-content-end" id="navigation">
|
||||
|
||||
<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 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>
|
||||
|
@ -101,7 +101,7 @@
|
|||
</ng-container>
|
||||
</li>
|
||||
<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 *ngIf="isAuthenticated()" class="d-flex justify-content-center">
|
||||
<button type="button" class="default-btn" (click)="logout()">{{ 'USER-DIALOG.LOG-OUT' | translate }}</button>
|
||||
|
|
|
@ -24,7 +24,7 @@ import { MineInAppNotificationListingDialogComponent } from '@notification-servi
|
|||
import { timer } from 'rxjs';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
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 { UserDialogComponent } from './user-dialog/user-dialog.component';
|
||||
|
||||
|
@ -294,13 +294,13 @@ export class NavbarComponent extends BaseComponent implements OnInit {
|
|||
this.sidenavService.toggle();
|
||||
}
|
||||
|
||||
openNewDmpDialog() {
|
||||
openNewPlanDialog() {
|
||||
if (this.dialog.openDialogs.length > 0) {
|
||||
this.dialog.closeAll();
|
||||
} else if (!this.isAuthenticated()) {
|
||||
this.router.navigate(['/login']);
|
||||
} else {
|
||||
const dialogRef = this.dialog.open(StartNewDmpDialogComponent, {
|
||||
const dialogRef = this.dialog.open(StartNewPlanDialogComponent, {
|
||||
disableClose: false,
|
||||
data: {
|
||||
isDialog: true
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<mat-divider class="top-divider"></mat-divider>
|
||||
<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 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>
|
||||
<mat-divider></mat-divider>
|
||||
<div>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<div class="clone-dialog container-fluid">
|
||||
<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>
|
||||
</div>
|
||||
<!-- Title Field -->
|
||||
<div class="row">
|
||||
<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 class="col-12 title-form">
|
||||
<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('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -19,25 +19,25 @@
|
|||
<!-- Description field -->
|
||||
<div class="row">
|
||||
<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 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">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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 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 class="col-12" *ngIf="hasDescriptions()">
|
||||
<mat-card class="mat-card">
|
||||
<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-selection-list #selectedItems [formControl]="formGroup.get('descriptions')">
|
||||
<mat-list-option *ngFor="let description of dmp.descriptions;" [value]="description.id">
|
||||
|
@ -47,12 +47,12 @@
|
|||
</mat-card>
|
||||
</div>
|
||||
<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 class="row pt-4">
|
||||
<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="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="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">{{'PLAN-CLONE-DIALOG.ACTIONS.CLONE' | translate}}</button></div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,14 +1,14 @@
|
|||
import { Component, Inject } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { CloneDmpPersist, Dmp } from '@app/core/model/plan/plan';
|
||||
import { DmpService } from '@app/core/services/plan/plan.service';
|
||||
import { ClonePlanPersist, Plan } from '@app/core/model/plan/plan';
|
||||
import { PlanService } from '@app/core/services/plan/plan.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { DmpCloneDialogEditorModel } from './plan-clone-dialog.editor.model';
|
||||
import { DmpEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver';
|
||||
import { PlanCloneDialogEditorModel } from './plan-clone-dialog.editor.model';
|
||||
import { PlanEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
|
||||
|
@ -17,22 +17,22 @@ import { HttpErrorResponse } from '@angular/common/http';
|
|||
templateUrl: './plan-clone-dialog.component.html',
|
||||
styleUrls: ['./plan-clone-dialog.component.scss']
|
||||
})
|
||||
export class CloneDmpDialogComponent extends BaseComponent {
|
||||
export class ClonePlanDialogComponent extends BaseComponent {
|
||||
|
||||
dmp: Dmp;
|
||||
editorModel: DmpCloneDialogEditorModel;
|
||||
dmp: Plan;
|
||||
editorModel: PlanCloneDialogEditorModel;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<CloneDmpDialogComponent>,
|
||||
private dmpService: DmpService,
|
||||
public dialogRef: MatDialogRef<ClonePlanDialogComponent>,
|
||||
private planService: PlanService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private httpErrorHandlingService: HttpErrorHandlingService,
|
||||
private language: TranslateService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {
|
||||
super();
|
||||
this.dmp = data.dmp;
|
||||
this.dmp = data.plan;
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ export class CloneDmpDialogComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorModel = new DmpCloneDialogEditorModel().fromModel(this.data.dmp);
|
||||
this.editorModel = new PlanCloneDialogEditorModel().fromModel(this.data.plan);
|
||||
this.formGroup = this.editorModel.buildForm();
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,8 @@ export class CloneDmpDialogComponent extends BaseComponent {
|
|||
|
||||
confirm() {
|
||||
if (!this.formGroup.valid) { return; }
|
||||
const value: CloneDmpPersist = this.formGroup.value;
|
||||
this.dmpService.clone(value, DmpEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
|
||||
const value: ClonePlanPersist = this.formGroup.value;
|
||||
this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
|
||||
dmp => this.dialogRef.close(dmp),
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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 { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
|
||||
import { Guid } from "@common/types/guid";
|
||||
|
||||
export class DmpCloneDialogEditorModel implements CloneDmpPersist {
|
||||
export class PlanCloneDialogEditorModel implements ClonePlanPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: String;
|
||||
|
@ -16,7 +16,7 @@ export class DmpCloneDialogEditorModel implements CloneDmpPersist {
|
|||
|
||||
constructor() { }
|
||||
|
||||
public fromModel(item: Dmp): DmpCloneDialogEditorModel {
|
||||
public fromModel(item: Plan): PlanCloneDialogEditorModel {
|
||||
if (item) {
|
||||
this.id = item.id;
|
||||
this.label = item.label + " New";
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
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 {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule],
|
||||
declarations: [CloneDmpDialogComponent],
|
||||
exports: [CloneDmpDialogComponent]
|
||||
declarations: [ClonePlanDialogComponent],
|
||||
exports: [ClonePlanDialogComponent]
|
||||
})
|
||||
export class CloneDmpDialogModule {
|
||||
export class ClonePlanDialogModule {
|
||||
constructor() { }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<mat-menu #depositMenu="matMenu">
|
||||
|
|
|
@ -4,7 +4,7 @@ import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
|
|||
import { DepositConfigurationStatus } from '@app/core/common/enum/deposit-configuration-status';
|
||||
import { DepositConfiguration } from '@app/core/model/deposit/deposit-configuration';
|
||||
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 { DepositService } from '@app/core/services/deposit/deposit.service';
|
||||
import {
|
||||
|
@ -26,7 +26,7 @@ import { nameof } from 'ts-simple-nameof';
|
|||
})
|
||||
export class DmpDepositDropdown extends BaseComponent implements OnInit {
|
||||
@Input() inputRepos: DepositConfiguration[];
|
||||
@Input() dmp: Dmp;
|
||||
@Input() dmp: Plan;
|
||||
outputRepos = [];
|
||||
logos: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>();
|
||||
@Output() outputReposEmitter: EventEmitter<EntityDoi[]> = new EventEmitter<EntityDoi[]>();
|
||||
|
@ -69,8 +69,8 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
|
|||
maxWidth: '600px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
message: this.language.instant('DMP-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'),
|
||||
titles: [this.language.instant('DMP-OVERVIEW.DEPOSIT.LOGIN', { 'repository': repo.repositoryId }), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
|
||||
message: this.language.instant('PLAN-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'),
|
||||
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 => {
|
||||
|
@ -81,7 +81,7 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
|
|||
case 1:
|
||||
const depositRequest: DepositRequest = {
|
||||
repositoryId: repo.repositoryId,
|
||||
dmpId: this.dmp.id,
|
||||
planId: this.dmp.id,
|
||||
authorizationCode: null,
|
||||
project: this.EntityDoiFields()
|
||||
};
|
||||
|
@ -99,7 +99,7 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
|
|||
} else if (repo.depositType == DepositConfigurationStatus.System) {
|
||||
const depositRequest: DepositRequest = {
|
||||
repositoryId: repo.repositoryId,
|
||||
dmpId: this.dmp.id,
|
||||
planId: this.dmp.id,
|
||||
authorizationCode: null,
|
||||
project: this.EntityDoiFields()
|
||||
};
|
||||
|
@ -114,21 +114,21 @@ export class DmpDepositDropdown extends BaseComponent implements OnInit {
|
|||
}
|
||||
|
||||
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) {
|
||||
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)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(code => {
|
||||
if (code !== undefined) {
|
||||
const depositRequest: DepositRequest = {
|
||||
repositoryId: repo.repositoryId,
|
||||
dmpId: dmp.id,
|
||||
planId: dmp.id,
|
||||
authorizationCode: code,
|
||||
project: this.EntityDoiFields()
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="dmp-invitation-dialog container-fluid" *ngIf="formGroup">
|
||||
<div class="row">
|
||||
<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 class="col-auto" (click)="closeDialog()">
|
||||
<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>
|
||||
</div>
|
||||
<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('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</div>
|
||||
|
|
|
@ -5,10 +5,10 @@ import { Component, Inject, OnInit } from '@angular/core';
|
|||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DmpUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { DmpBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { DmpUserPersist } from '@app/core/model/plan/plan';
|
||||
import { DmpService } from '@app/core/services/plan/plan.service';
|
||||
import { PlanUserRole } from '@app/core/common/enum/plan-user-role';
|
||||
import { PlanBlueprint } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
import { PlanUserPersist } from '@app/core/model/plan/plan';
|
||||
import { PlanService } from '@app/core/services/plan/plan.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
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 { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { DmpEditorModel } from '../../plan-editor-blueprint/plan-editor.model';
|
||||
import { PlanEditorModel } from '../../plan-editor-blueprint/plan-editor.model';
|
||||
|
||||
@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 {
|
||||
|
||||
dmpId: Guid;
|
||||
editorModel: DmpEditorModel;
|
||||
planId: Guid;
|
||||
editorModel: PlanEditorModel;
|
||||
formGroup: UntypedFormGroup;
|
||||
dmpUserRoleEnum = DmpUserRole;
|
||||
selectedBlueprint: DmpBlueprint;
|
||||
planUserRoleEnum = PlanUserRole;
|
||||
selectedBlueprint: PlanBlueprint;
|
||||
inProgressSendButton = false;
|
||||
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
|
||||
|
@ -42,13 +42,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private httpErrorHandlingService: HttpErrorHandlingService,
|
||||
private dmpService: DmpService,
|
||||
private planService: PlanService,
|
||||
private formService: FormService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {
|
||||
super();
|
||||
this.dmpId = data.dmpId;
|
||||
this.editorModel = data ? new DmpEditorModel().fromModel(data) : new DmpEditorModel();
|
||||
this.planId = data.planId;
|
||||
this.editorModel = data ? new PlanEditorModel().fromModel(data) : new PlanEditorModel();
|
||||
this.selectedBlueprint = data?.blueprint;
|
||||
}
|
||||
|
||||
|
@ -62,9 +62,9 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
|
||||
if (!this.formGroup.get("users").valid) { return; }
|
||||
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))
|
||||
.subscribe(
|
||||
complete => {
|
||||
|
@ -84,13 +84,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
}
|
||||
|
||||
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) {
|
||||
this.inProgressSendButton = false;
|
||||
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);
|
||||
|
||||
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);
|
||||
|
|
|
@ -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 { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
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({
|
||||
imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule, DmpUserFieldModule],
|
||||
imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule, PlanUserFieldModule],
|
||||
declarations: [DmpInvitationDialogComponent],
|
||||
exports: [DmpInvitationDialogComponent]
|
||||
})
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue