added prefilling-sources condition on plan blueprint

This commit is contained in:
CITE\spapacharalampous 2024-07-18 12:57:01 +03:00
parent ae80f1e0cb
commit 3f4091bd16
26 changed files with 177 additions and 68 deletions

View File

@ -32,7 +32,10 @@ public class SectionEntity {
@XmlAttribute(name="hasTemplates")
private Boolean hasTemplates;
@XmlAttribute(name = "prefillingSourcesEnabled")
private Boolean prefillingSourcesEnabled;
@XmlElementWrapper(name = "descriptionTemplates")
@XmlElement(name = "descriptionTemplate")
private List<DescriptionTemplateEntity> descriptionTemplates;
@ -90,6 +93,14 @@ public class SectionEntity {
this.descriptionTemplates = descriptionTemplates;
}
public Boolean getPrefillingSourcesEnabled() {
return this.prefillingSourcesEnabled;
}
public void setPrefillingSourcesEnabled(Boolean prefillingSourcesEnabled) {
this.prefillingSourcesEnabled = prefillingSourcesEnabled;
}
public List<UUID> getPrefillingSourcesIds() {
return this.prefillingSourcesIds;
}

View File

@ -31,6 +31,9 @@ public class BlueprintSectionImportExport {
@XmlElement(name = "descriptionTemplate")
private List<BlueprintDescriptionTemplateImportExport> descriptionTemplates;
@XmlAttribute(name = "prefillingSourcesEnabled")
private Boolean prefillingSourcesEnabled;
@XmlElementWrapper(name = "prefillingSources")
@XmlElement(name = "prefillingSource")
private List<BlueprintPrefillingSourceImportExport> prefillingSources;
@ -107,6 +110,14 @@ public class BlueprintSectionImportExport {
this.descriptionTemplates = descriptionTemplates;
}
public Boolean getPrefillingSourcesEnabled() {
return this.prefillingSourcesEnabled;
}
public void setPrefillingSourcesEnabled(Boolean prefillingSourcesEnabled) {
this.prefillingSourcesEnabled = prefillingSourcesEnabled;
}
public List<BlueprintPrefillingSourceImportExport> getPrefillingSources() {
return this.prefillingSources;
}

View File

@ -67,6 +67,7 @@ public class SectionBuilder extends BaseBuilder<Section, SectionEntity> {
if (fields.hasField(this.asIndexer(Section._description))) m.setDescription(d.getDescription());
if (fields.hasField(this.asIndexer(Section._ordinal))) m.setOrdinal(d.getOrdinal());
if (fields.hasField(this.asIndexer(Section._hasTemplates))) m.setHasTemplates(d.getHasTemplates());
if (fields.hasField(this.asIndexer(Section._prefillingSourcesEnabled))) m.setPrefillingSourcesEnabled(d.getPrefillingSourcesEnabled());
if (!descriptionTemplatesFields.isEmpty() && d.getDescriptionTemplates() != null) m.setDescriptionTemplates(this.builderFactory.builder(DescriptionTemplateBuilder.class).authorize(this.authorize).build(descriptionTemplatesFields, d.getDescriptionTemplates()));
if (!fieldsFields.isEmpty() && d.getFields() != null) {
m.setFields(new ArrayList<>());

View File

@ -45,6 +45,9 @@ public class SectionPersist {
public static final String _descriptionTemplates = "descriptionTemplates";
private Boolean prefillingSourcesEnabled;
public static final String _prefillingSourcesEnabled = "prefillingSourcesEnabled";
private List<UUID> prefillingSourcesIds;
public static final String _prefillingSourcesIds = "prefillingSourcesIds";
@ -101,17 +104,17 @@ public class SectionPersist {
return this.descriptionTemplates;
}
public void setDescriptionTemplates(List<DescriptionTemplatePersist> descriptionTemplates) {
this.descriptionTemplates = descriptionTemplates;
}
public void setDescriptionTemplates(List<DescriptionTemplatePersist> descriptionTemplates) { this.descriptionTemplates = descriptionTemplates; }
public List<UUID> getPrefillingSourcesIds() {
return this.prefillingSourcesIds;
}
public void setPrefillingSourcesIds(List<UUID> prefillingSourcesIds) {
this.prefillingSourcesIds = prefillingSourcesIds;
}
public void setPrefillingSourcesIds(List<UUID> prefillingSourcesIds) { this.prefillingSourcesIds = prefillingSourcesIds; }
public Boolean getPrefillingSourcesEnabled() { return this.prefillingSourcesEnabled; }
public void setPrefillingSourcesEnabled(Boolean prefillingSourcesEnabled) { this.prefillingSourcesEnabled = prefillingSourcesEnabled; }
@Component(SectionPersistValidator.ValidatorName)
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@ -175,7 +178,10 @@ public class SectionPersist {
this.spec()
.iff(() -> !this.isListNullOrEmpty(item.getDescriptionTemplates()))
.must(() -> item.getDescriptionTemplates().stream().map(DescriptionTemplatePersist::getDescriptionTemplateGroupId).distinct().collect(Collectors.toList()).size() == item.getDescriptionTemplates().size())
.failOn(SectionPersist._descriptionTemplates).failWith(this.messageSource.getMessage("Validation_Unique", new Object[]{SectionPersist._descriptionTemplates}, LocaleContextHolder.getLocale()))
.failOn(SectionPersist._descriptionTemplates).failWith(this.messageSource.getMessage("Validation_Unique", new Object[]{SectionPersist._descriptionTemplates}, LocaleContextHolder.getLocale())),
this.spec()
.must(() -> !this.isNull(item.getPrefillingSourcesEnabled()))
.failOn(SectionPersist._prefillingSourcesEnabled).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._prefillingSourcesEnabled}, LocaleContextHolder.getLocale()))
);
}

View File

@ -29,6 +29,9 @@ public class Section {
public final static String _descriptionTemplates = "descriptionTemplates";
private List<DescriptionTemplate> descriptionTemplates;
public final static String _prefillingSourcesEnabled = "prefillingSourcesEnabled";
private Boolean prefillingSourcesEnabled;
public final static String _prefillingSources = "prefillingSources";
private List<PrefillingSource> prefillingSources;
@ -92,6 +95,14 @@ public class Section {
this.descriptionTemplates = descriptionTemplates;
}
public Boolean getPrefillingSourcesEnabled() {
return prefillingSourcesEnabled;
}
public void setPrefillingSourcesEnabled(Boolean prefillingSourcesEnabled) {
this.prefillingSourcesEnabled = prefillingSourcesEnabled;
}
public List<PrefillingSource> getPrefillingSources() {
return prefillingSources;
}

View File

@ -240,6 +240,7 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService {
data.setLabel(persist.getLabel());
data.setOrdinal(persist.getOrdinal());
data.setHasTemplates(persist.getHasTemplates());
data.setPrefillingSourcesEnabled(persist.getPrefillingSourcesEnabled());
data.setPrefillingSourcesIds(persist.getPrefillingSourcesIds());
if (!this.conventionService.isListNullOrEmpty(persist.getFields())) {
data.setFields(new ArrayList<>());
@ -527,6 +528,8 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService {
xml.setDescription(entity.getDescription());
xml.setOrdinal(entity.getOrdinal());
xml.setHasTemplates(entity.getHasTemplates());
xml.setPrefillingSourcesEnabled(entity.getPrefillingSourcesEnabled());
List<BlueprintSystemFieldImportExport> planBlueprintSystemFieldModels = new LinkedList<>();
if (!this.conventionService.isListNullOrEmpty(entity.getFields())) {
for (SystemFieldEntity systemField : entity.getFields().stream().filter(x -> x.getCategory() == PlanBlueprintFieldCategory.System).map(x -> (SystemFieldEntity) x).toList()) {
@ -712,6 +715,8 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService {
persist.setDescription(importXml.getDescription());
persist.setOrdinal(importXml.getOrdinal());
persist.setHasTemplates(importXml.isHasTemplates());
persist.setPrefillingSourcesEnabled(importXml.getPrefillingSourcesEnabled());
List<FieldPersist> planBlueprintFieldModels = new LinkedList<>();
if (!this.conventionService.isListNullOrEmpty(importXml.getSystemFields())) {
for (BlueprintSystemFieldImportExport systemField : importXml.getSystemFields()) {

View File

@ -31,6 +31,7 @@ export interface PlanBlueprintDefinitionSection {
fields: FieldInSection[];
hasTemplates: boolean;
descriptionTemplates?: DescriptionTemplatesInSection[];
prefillingSourcesEnabled: boolean;
prefillingSources: PrefillingSource[];
}
@ -92,6 +93,7 @@ export interface PlanBlueprintDefinitionSectionPersist {
fields: FieldInSectionPersist[];
hasTemplates: boolean;
descriptionTemplates?: DescriptionTemplatesInSectionPersist[];
prefillingSourcesEnabled: boolean;
prefillingSourcesIds: Guid[];
}

View File

@ -287,23 +287,24 @@
</div>
</div>
<div class="row">
<div *ngIf="section.get('hasTemplates').value == true" class="col-12">
<mat-form-field class="w-100 mt-3">
<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>
</div>
<ng-container *ngIf="section.get('hasTemplates').value == true" class="col-12">
<div class="col-12">
<mat-checkbox [formControl]="section.get('prefillingSourcesEnabled')" (change)="removeAllPrefillingSources($event, sectionIndex)">
{{'PLAN-BLUEPRINT-EDITOR.FIELDS.ENABLE-PREFILLING-SOURCES' | translate}}
</mat-checkbox>
</div>
<div class="col-12" *ngIf="section.get('prefillingSourcesEnabled')?.value == true">
<mat-form-field class="w-100 mt-3">
<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>
</div>
</ng-container>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>

View File

@ -45,6 +45,7 @@ import { PlanBlueprintEditorModel, FieldInSectionEditorModel } from './plan-blue
import { PlanBlueprintEditorResolver } from './plan-blueprint-editor.resolver';
import { PlanBlueprintEditorService } from './plan-blueprint-editor.service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { PrefillingSource } from '@app/core/model/prefilling-source/prefilling-source';
@Component({
@ -422,6 +423,18 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
if (matCheckBox.checked == false) {
const descriptionTemplateSize = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray).length;
for (let i = 0; i < descriptionTemplateSize; i++) this.removeDescriptionTemplate(sectionIndex, 0);
const prefillingSourcesEnabledControl = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('prefillingSourcesEnabled');
prefillingSourcesEnabledControl.reset();
this.removeAllPrefillingSources(matCheckBox, sectionIndex);
}
}
removeAllPrefillingSources(matCheckBox: MatCheckboxChange, sectionIndex: number) {
if (matCheckBox.checked == false) {
const prefillingSourcesSize = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('prefillingSourcesIds')?.value as []).length;
for (let i = 0; i < prefillingSourcesSize; i++) this.removePrefillingSources(sectionIndex, 0);
}
}
@ -502,6 +515,21 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
);
descriptionTempaltesArray.markAsDirty();
}
removePrefillingSources(sectionIndex: number, prefillingSourceIndex: number): void {
const sectionId = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('id').value;
const prefillingSourcesControl = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('prefillingSourcesIds');
prefillingSourcesControl.reset();
PlanBlueprintEditorModel.reApplySectionValidators(
{
formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel
}
);
prefillingSourcesControl.markAsDirty();
}
dropDescriptionTemplates(event: CdkDragDrop<string[]>, sectionIndex: number) {
const descriptionTemplatesFormArray = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray);

View File

@ -178,6 +178,7 @@ export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintD
fields: FieldInSectionEditorModel[] = [];
hasTemplates: boolean;
descriptionTemplates?: DescriptionTemplatesInSectionEditorModel[] = [];
prefillingSourcesEnabled: boolean;
prefillingSourcesIds: Guid[]= [];
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
@ -193,6 +194,7 @@ export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintD
this.description = item.description;
this.ordinal = item.ordinal;
this.hasTemplates = item.hasTemplates;
this.prefillingSourcesEnabled = item?.prefillingSourcesEnabled ?? false;
if (item.fields) { item.fields.sort((a,b) => a.ordinal - b.ordinal).map(x => this.fields.push(new FieldInSectionEditorModel(this.validationErrorModel).fromModel(x))); }
if (item.descriptionTemplates) { item.descriptionTemplates.map(x => this.descriptionTemplates.push(new DescriptionTemplatesInSectionEditorModel(this.validationErrorModel).fromModel(x))); }
if (item.prefillingSources) this.prefillingSourcesIds = item.prefillingSources.map(x => x.id);
@ -219,6 +221,7 @@ export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintD
ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal').validators],
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
hasTemplates: [{ value: this.hasTemplates, disabled: disabled }, context.getValidation('hasTemplates').validators],
prefillingSourcesEnabled: [{ value: this.prefillingSourcesEnabled, disabled: disabled}, context.getValidation('prefillingSourcesEnabled').validators],
fields: this.formBuilder.array(
(this.fields ?? []).map(
(item, index) => item.buildForm({
@ -255,6 +258,7 @@ export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintD
baseValidationArray.push({ key: 'fields', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}fields`)] });
baseValidationArray.push({ key: 'descriptionTemplates', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}descriptionTemplates`)] });
baseValidationArray.push({ key: 'prefillingSourcesIds', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}prefillingSourcesIds`)] });
baseValidationArray.push({ key: 'prefillingSourcesEnabled', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}prefillingSourcesEnabled`)] });
baseValidationArray.push({ key: 'hash', validators: [] });
baseContext.validation = baseValidationArray;

View File

@ -52,6 +52,7 @@ export class PlanBlueprintEditorResolver extends BaseEditorResolver {
[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<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.prefillingSourcesEnabled)].join('.'),
nameof<PlanBlueprint>(x => x.createdAt),
nameof<PlanBlueprint>(x => x.hash),

View File

@ -25,41 +25,51 @@
<mat-error *ngIf="prefillForm.get('descriptionTemplateId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="row d-flex align-items-center justify-content-center">
<div class="pb-4 pl-4 pr-4">
{{'NEW-DESCRIPTION-DIALOG.PREFILL-HINT' | translate}}
</div>
</div>
<div class="row d-flex align-items-center justify-content-center" [class.pb-4]="prefillSelected">
<button mat-raised-button type="button" class="empty-btn" (click)="manuallySelected()">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.MANUALLY' | translate}}</button>
<div class="ml-2 mr-2">{{'NEW-DESCRIPTION-DIALOG.OR' | translate}}</div>
<button mat-raised-button type="button" class="prefill-btn" (click)="prefillSelected = true">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.PREFILL' | translate}}</button>
</div>
<div *ngIf="prefillSelected" class="row">
<div class="col-12 pl-0 pr-0 pb-2 d-flex flex-row">
<h4 class="col-auto heading">{{'NEW-DESCRIPTION-DIALOG.PREFILLING-SOURCE' | translate}}</h4>
<ng-container *ngIf="prefillingSourcesEnabled">
<div class="row d-flex align-items-center justify-content-center">
<div class="pb-4 pl-4 pr-4">
{{'NEW-DESCRIPTION-DIALOG.PREFILL-HINT' | translate}}
</div>
</div>
<mat-form-field class="col-md-12">
<app-single-auto-complete [required]="true" [formControl]="prefillForm.get('prefillingSourceId')" placeholder="{{'NEW-DESCRIPTION-DIALOG.PREFILLING-SOURCE' | translate}}" [configuration]="singlePrefillingSourceAutoCompleteConfiguration" (optionSelected)="changePreffillingSource($event)">
</app-single-auto-complete>
<mat-error *ngIf="prefillForm.get('prefillingSourceId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div *ngIf="prefillForm.get('prefillingSourceId').value != null" class="row">
<div class="col-12 pl-0 pr-0 pb-2 d-flex flex-row">
<h4 class="col-auto heading">{{'NEW-DESCRIPTION-DIALOG.SEARCH-HEADER' | translate}}</h4>
</div>
<mat-form-field class="col-md-12">
<app-single-auto-complete [required]="true" [formControl]="prefillForm.get('data')" placeholder="{{'NEW-DESCRIPTION-DIALOG.SEARCH' | translate}}" [configuration]="prefillObjectAutoCompleteConfiguration">
</app-single-auto-complete>
</mat-form-field>
</div>
<div class="row d-flex align-items-center justify-content-center" [class.pb-4]="prefillSelected">
<button mat-raised-button type="button" class="empty-btn" (click)="manuallySelected()">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.MANUALLY' | translate}}</button>
<div class="ml-2 mr-2">{{'NEW-DESCRIPTION-DIALOG.OR' | translate}}</div>
<button mat-raised-button type="button" class="prefill-btn" (click)="prefillSelected = true">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.PREFILL' | translate}}</button>
</div>
<div *ngIf="prefillSelected" class="row">
<div class="col-12 pl-0 pr-0 pb-2 d-flex flex-row">
<h4 class="col-auto heading">{{'NEW-DESCRIPTION-DIALOG.PREFILLING-SOURCE' | translate}}</h4>
</div>
<mat-form-field class="col-md-12">
<app-single-auto-complete [required]="true" [formControl]="prefillForm.get('prefillingSourceId')" placeholder="{{'NEW-DESCRIPTION-DIALOG.PREFILLING-SOURCE' | translate}}" [configuration]="singlePrefillingSourceAutoCompleteConfiguration" (optionSelected)="changePreffillingSource($event)">
</app-single-auto-complete>
<mat-error *ngIf="prefillForm.get('prefillingSourceId').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div *ngIf="prefillForm.get('prefillingSourceId').value != null" class="row">
<div class="col-12 pl-0 pr-0 pb-2 d-flex flex-row">
<h4 class="col-auto heading">{{'NEW-DESCRIPTION-DIALOG.SEARCH-HEADER' | translate}}</h4>
</div>
<mat-form-field class="col-md-12">
<app-single-auto-complete [required]="true" [formControl]="prefillForm.get('data')" placeholder="{{'NEW-DESCRIPTION-DIALOG.SEARCH' | translate}}" [configuration]="prefillObjectAutoCompleteConfiguration">
</app-single-auto-complete>
</mat-form-field>
</div>
</ng-container>
</div>
<div *ngIf="prefillSelected">
<!-- <div *ngIf="prefillSelected || !prefillingSourcesEnabled"> -->
<div *ngIf="!prefillingSourcesEnabled else goToNextWithPrefillingSources">
<div class="col-auto d-flex pb-4 pt-2">
<button mat-raised-button type="button" class="prefill-btn ml-auto" [disabled]="prefillForm.invalid" (click)="next()">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.NEXT' | translate}}</button>
<button mat-raised-button type="button" class="prefill-btn ml-auto" [disabled]="prefillForm.get('descriptionTemplateId').invalid" (click)="manuallySelected()">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.NEXT' | translate}}</button>
</div>
</div>
<ng-template #goToNextWithPrefillingSources>
<div *ngIf="prefillSelected">
<div class="col-auto d-flex pb-4 pt-2">
<button mat-raised-button type="button" class="prefill-btn ml-auto" [disabled]="prefillForm.invalid" (click)="next()">{{'NEW-DESCRIPTION-DIALOG.ACTIONS.NEXT' | translate}}</button>
</div>
</div>
</ng-template>
</div>

View File

@ -34,6 +34,7 @@ export class NewDescriptionDialogComponent extends BaseComponent implements OnIn
plan: Plan;
planSectionId: Guid;
prefillingSourcesEnabled: boolean;
availableDescriptionTemplates: DescriptionTemplate[] = [];
constructor(public dialogRef: MatDialogRef<NewDescriptionDialogComponent>,
@ -46,6 +47,10 @@ export class NewDescriptionDialogComponent extends BaseComponent implements OnIn
this.plan = data.plan;
this.planSectionId = data.planSectionId;
const filteredSections = data.plan?.blueprint.definition.sections.filter(x => x.id == this.planSectionId);
this.prefillingSourcesEnabled = filteredSections && filteredSections?.length > 0 ? filteredSections[0].prefillingSourcesEnabled : false;
this.availableDescriptionTemplates = this.plan.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
}

View File

@ -133,6 +133,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
(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.prefillingSourcesEnabled)].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<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.id)].join('.'),

View File

@ -147,14 +147,15 @@
</div>
</li>
</ol>
<ul *ngIf="item.id && section.hasTemplates && canEditSection(section.id) && !formGroup.disabled && hasDescriptionTemplates(section)" class="add-description-option">
<ul *ngIf="item.id && section.hasTemplates && canEditSection(section.id) && !formGroup.disabled && hasDescriptionTemplates(section)"
class="add-description-option"
[matTooltipDisabled]="hasValidMultiplicity(section)"
[matTooltip]="'PLAN-EDITOR.DESCRIPTION-TEMPLATES.MAX-MULTIPLICITY' | translate"
>
<li>
<a class="add-description-action" [ngClass]="{'drag-handle-disabled': !hasValidMultiplicity(section)}" [routerLink]="hasDescriptionTemplates(section) && hasValidMultiplicity(section) ? this.routerUtils.generateUrl(['/descriptions/edit/', item.id, '/', section.id]) : null">
<ng-container *ngIf="!hasDescriptionTemplates(section)">
<mat-icon [matTooltipDisabled]="hasDescriptionTemplates(section)" [matTooltip]="'PLAN-EDITOR.DESCRIPTION-TEMPLATES.EMPTY' | translate">add</mat-icon>{{'PLAN-EDITOR.ACTIONS.ADD-DESCRIPTION-IN-SECTION' | translate}}
</ng-container>
<ng-container *ngIf="hasDescriptionTemplates(section)">
<mat-icon [matTooltipDisabled]="hasValidMultiplicity(section)" [matTooltip]="'PLAN-EDITOR.DESCRIPTION-TEMPLATES.MAX-MULTIPLICITY' | translate">add</mat-icon>{{'PLAN-EDITOR.ACTIONS.ADD-DESCRIPTION-IN-SECTION' | translate}}
<ng-container>
<mat-icon>add</mat-icon>{{'PLAN-EDITOR.ACTIONS.ADD-DESCRIPTION-IN-SECTION' | translate}}
</ng-container>
</a>
</li>

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",

View File

@ -1650,7 +1650,8 @@
"DESCRIPTION-TEMPLATE-LABEL": "Label",
"DESCRIPTION-TEMPLATE-MIN-MULTIPLICITY": "Min Multiplicity",
"DESCRIPTION-TEMPLATE-MAX-MULTIPLICITY": "Max Multiplicity",
"PREFILLING-SOURCES": "Prefilling Sources"
"PREFILLING-SOURCES": "Prefilling Sources",
"ENABLE-PREFILLING-SOURCES": "Prefilling Sources"
},
"ACTIONS": {
"ADD-FIELD": "Add Field",