refactor description template editor, change belongsToTenant on copied items
This commit is contained in:
parent
1587a413cf
commit
7836ac1218
|
@ -107,7 +107,7 @@
|
||||||
<td>{{usersMap.get(user?.get('userId')?.value)?.name}}</td>
|
<td>{{usersMap.get(user?.get('userId')?.value)?.name}}</td>
|
||||||
<td>{{enumUtils.toUserDescriptionTemplateRoleString(user?.get('role')?.value)}}</td>
|
<td>{{enumUtils.toUserDescriptionTemplateRoleString(user?.get('role')?.value)}}</td>
|
||||||
<td>
|
<td>
|
||||||
<button [disabled]="formGroup.disabled" mat-button class="delete-btn" (click)="verifyAndRemoveUser(i)" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-REMOVE-USER'| translate"><mat-icon>person_remove</mat-icon></button>
|
<button [disabled]="hideEditActions" mat-button class="delete-btn" (click)="verifyAndRemoveUser(i)" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-REMOVE-USER'| translate"><mat-icon>person_remove</mat-icon></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="formGroup.get('users')?.controls?.length === 0">
|
<tr *ngIf="formGroup.get('users')?.controls?.length === 0">
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="row justify-content-end">
|
<div class="row justify-content-end">
|
||||||
<div class="col-12 col-lg-4 d-flex justify-content-end" style="overflow: hidden;">
|
<div class="col-12 col-lg-4 d-flex justify-content-end" style="overflow: hidden;">
|
||||||
<mat-form-field class="full-width basic-info-input" *ngIf="!formGroup.disabled">
|
<mat-form-field class="full-width basic-info-input" *ngIf="!hideEditActions">
|
||||||
<mat-label>{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-USERS' | translate}}</mat-label>
|
<mat-label>{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-USERS' | translate}}</mat-label>
|
||||||
<app-single-auto-complete [required]="false" [formControl]="userFormControl" (optionSelected)="addUser($event)" placeholder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-USERS' | translate}}" [configuration]="userService.singleAutocompleteConfiguration">
|
<app-single-auto-complete [required]="false" [formControl]="userFormControl" (optionSelected)="addUser($event)" placeholder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DESCRIPTION-TEMPLATE-USERS' | translate}}" [configuration]="userService.singleAutocompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
<description-template-table-of-contents class="toc-pane-container col" style="margin-bottom: 2em;"
|
<description-template-table-of-contents class="toc-pane-container col" style="margin-bottom: 2em;"
|
||||||
[links]="toCEntries"
|
[links]="toCEntries"
|
||||||
[itemSelected]="selectedTocEntry"
|
[itemSelected]="selectedTocEntry"
|
||||||
[viewOnly]="formGroup.disabled"
|
[viewOnly]="hideEditActions"
|
||||||
[colorizeInvalid]="colorizeInvalid"
|
[colorizeInvalid]="colorizeInvalid"
|
||||||
[showErrors]="showErrors"
|
[showErrors]="showErrors"
|
||||||
(dataNeedsRefresh)="onDataNeedsRefresh($event)"
|
(dataNeedsRefresh)="onDataNeedsRefresh($event)"
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12" *ngIf="!viewOnly && (!selectedTocEntry?.subEntries?.length)">
|
<div class="col-12" *ngIf="!hideEditActions && (!selectedTocEntry?.subEntries?.length)">
|
||||||
<button class="create-section-btn" (click)="addNewEntry({parent:selectedTocEntry, childType: tocEntryEnumValues.Section})">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-SECTION' | translate}}</button>
|
<button class="create-section-btn" (click)="addNewEntry({parent:selectedTocEntry, childType: tocEntryEnumValues.Section})">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-SECTION' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -195,7 +195,7 @@
|
||||||
<div class="col-12" *ngIf="(selectedTocEntry.type === tocEntryEnumValues.Section) || (selectedTocEntry.type === tocEntryEnumValues.FieldSet)">
|
<div class="col-12" *ngIf="(selectedTocEntry.type === tocEntryEnumValues.Section) || (selectedTocEntry.type === tocEntryEnumValues.FieldSet)">
|
||||||
<app-description-template-editor-section-fieldset-component
|
<app-description-template-editor-section-fieldset-component
|
||||||
[tocentry]="selectedTocEntry"
|
[tocentry]="selectedTocEntry"
|
||||||
[viewOnly]="formGroup.disabled"
|
[viewOnly]="hideEditActions"
|
||||||
[descriptionTemplateId]="descriptionTemplateId"
|
[descriptionTemplateId]="descriptionTemplateId"
|
||||||
[validationErrorModel]="editorModel.validationErrorModel"
|
[validationErrorModel]="editorModel.validationErrorModel"
|
||||||
[validationRootPath]="selectedTocEntry.validationRootPath"
|
[validationRootPath]="selectedTocEntry.validationRootPath"
|
||||||
|
@ -278,7 +278,7 @@
|
||||||
<ng-template #actions>
|
<ng-template #actions>
|
||||||
<div>
|
<div>
|
||||||
<button mat-raised-button class="template_action_btn mr-3" (click)="cancel()">{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.CLOSE' | translate}}</button>
|
<button mat-raised-button class="template_action_btn mr-3" (click)="cancel()">{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.CLOSE' | translate}}</button>
|
||||||
<button *ngIf="!formGroup.disabled && formGroup.get('status').value!=finalized" mat-raised-button class="template_action_btn save-btn" type="button">
|
<button *ngIf="!hideEditActions" [disabled]="!(formGroup?.valid ?? false)" mat-raised-button class="template_action_btn save-btn" type="button">
|
||||||
<span class="d-flex flex-row row">
|
<span class="d-flex flex-row row">
|
||||||
<span (click)="save(); formSubmit()" class="col">{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.SAVE' | translate}}</span>
|
<span (click)="save(); formSubmit()" class="col">{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.SAVE' | translate}}</span>
|
||||||
<mat-divider [vertical]="true"></mat-divider>
|
<mat-divider [vertical]="true"></mat-divider>
|
||||||
|
@ -292,7 +292,7 @@
|
||||||
<button mat-menu-item (click)="saveWithClose(false)" type="button">{{ 'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
|
<button mat-menu-item (click)="saveWithClose(false)" type="button">{{ 'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|
||||||
<button *ngIf="!formGroup.disabled && formGroup.get('status').value!= finalized && steps?.length-1 === stepper?.selectedIndex" [@finalize_btn] mat-button class="finalize-btn ml-3" [disabled]="!formGroup.valid" [class.invisible]="steps?.length-1 !== stepper?.selectedIndex" (click)="finalize()">
|
<button *ngIf="!hideEditActions && canFinalize && steps?.length-1 === stepper?.selectedIndex" [@finalize_btn] mat-button class="finalize-btn ml-3" [disabled]="!formGroup.valid" [class.invisible]="steps?.length-1 !== stepper?.selectedIndex" (click)="finalize()">
|
||||||
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FINALIZE' | translate}}
|
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FINALIZE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,6 @@ import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { UserService } from '@app/core/services/user/user.service';
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { BaseEditor } from '@common/base/base-editor';
|
import { BaseEditor } from '@common/base/base-editor';
|
||||||
|
@ -60,9 +59,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
@ViewChild('stepper') stepper: MatStepper;
|
@ViewChild('stepper') stepper: MatStepper;
|
||||||
|
|
||||||
isNew = true;
|
|
||||||
isDeleted = false;
|
|
||||||
isFinalized = false;
|
|
||||||
formGroup: UntypedFormGroup = null;
|
formGroup: UntypedFormGroup = null;
|
||||||
item: DescriptionTemplate;
|
item: DescriptionTemplate;
|
||||||
showInactiveDetails = false;
|
showInactiveDetails = false;
|
||||||
|
@ -70,8 +66,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
availableLanguages: LanguageInfo[] = this.languageInfoService.getLanguageInfoValues();
|
availableLanguages: LanguageInfo[] = this.languageInfoService.getLanguageInfoValues();
|
||||||
|
|
||||||
isNewVersion = false;
|
|
||||||
isClone = false;
|
|
||||||
showErrors: boolean = false;
|
showErrors: boolean = false;
|
||||||
steps: QueryList<CdkStep>;
|
steps: QueryList<CdkStep>;
|
||||||
toCEntries: ToCEntry[];
|
toCEntries: ToCEntry[];
|
||||||
|
@ -84,6 +78,31 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
singleAutocompleteDescriptionTemplateTypeConfiguration: SingleAutoCompleteConfiguration;
|
singleAutocompleteDescriptionTemplateTypeConfiguration: SingleAutoCompleteConfiguration;
|
||||||
|
|
||||||
|
isNew = true;
|
||||||
|
isClone = false;
|
||||||
|
isNewVersion = false;
|
||||||
|
isDeleted = false;
|
||||||
|
belongsToCurrentTenant = true;
|
||||||
|
|
||||||
|
protected get isTransient(): boolean {
|
||||||
|
return this.isNew || this.isClone || this.isNewVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected get hideEditActions(): boolean {
|
||||||
|
return this.isDeleted || this.isFinalized || !this.authService.hasPermission(AppPermission.EditDescriptionTemplate) || !this.belongsToCurrentTenant;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected get canDelete(): boolean {
|
||||||
|
return !this.isDeleted && !this.isTransient && this.belongsToCurrentTenant && this.authService.hasPermission(AppPermission.DeleteDescriptionTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected get canFinalize(): boolean {
|
||||||
|
return !this.isTransient && !this.isFinalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected get isFinalized(): boolean {
|
||||||
|
return this.editorModel.status == DescriptionTemplateStatus.Finalized;
|
||||||
|
}
|
||||||
|
|
||||||
//Preview
|
//Preview
|
||||||
previewFieldSet: DescriptionTemplate = null;
|
previewFieldSet: DescriptionTemplate = null;
|
||||||
|
@ -104,18 +123,10 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
return '3 ' + label;
|
return '3 ' + label;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canDelete(): boolean {
|
|
||||||
return !this.isDeleted && !this.isNew && (this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplate) || this.item?.authorizationFlags?.some(x => x === AppPermission.DeleteDescriptionTemplate));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && (this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplate) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDescriptionTemplate));
|
return !this.isDeleted && (this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplate) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDescriptionTemplate));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canFinalize(): boolean {
|
|
||||||
return !this.isDeleted && (this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplate) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDescriptionTemplate));
|
|
||||||
}
|
|
||||||
|
|
||||||
private hasPermission(permission: AppPermission): boolean {
|
private hasPermission(permission: AppPermission): boolean {
|
||||||
return this.authService.hasPermission(permission) || this.editorModel?.permissions?.includes(permission) || this.item?.authorizationFlags?.some(x => x === permission);
|
return this.authService.hasPermission(permission) || this.editorModel?.permissions?.includes(permission) || this.item?.authorizationFlags?.some(x => x === permission);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +151,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
public descriptionTemplateTypeService: DescriptionTemplateTypeService,
|
public descriptionTemplateTypeService: DescriptionTemplateTypeService,
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private descriptionTemplateEditorService: DescriptionTemplateEditorService,
|
private descriptionTemplateEditorService: DescriptionTemplateEditorService,
|
||||||
private fileUtils: FileUtils,
|
|
||||||
private languageInfoService: LanguageInfoService,
|
private languageInfoService: LanguageInfoService,
|
||||||
public userService: UserService,
|
public userService: UserService,
|
||||||
public titleService: Title,
|
public titleService: Title,
|
||||||
|
@ -190,11 +200,19 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
prepareForm(data: DescriptionTemplate) {
|
prepareForm(data: DescriptionTemplate) {
|
||||||
try {
|
try {
|
||||||
this.editorModel = data ? new DescriptionTemplateEditorModel().fromModel(data) : new DescriptionTemplateEditorModel();
|
|
||||||
|
const dataCopy = data ? JSON.parse(JSON.stringify(data)) : null;
|
||||||
|
if(dataCopy && this.isClone) {
|
||||||
|
dataCopy.belongsToCurrentTenant = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.editorModel = dataCopy ? new DescriptionTemplateEditorModel().fromModel(dataCopy) : new DescriptionTemplateEditorModel();
|
||||||
this.item = data;
|
this.item = data;
|
||||||
// Add user info to Map, to present them.
|
// Add user info to Map, to present them.
|
||||||
(this.item?.users ?? []).forEach(obj => { this.usersMap.set(obj.user.id, obj.user); });
|
(this.item?.users ?? []).forEach(obj => { this.usersMap.set(obj.user.id, obj.user); });
|
||||||
this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
|
this.isDeleted = dataCopy ? dataCopy.isActive === IsActive.Inactive : false;
|
||||||
|
this.belongsToCurrentTenant = this.isNew || dataCopy.belongsToCurrentTenant;
|
||||||
|
|
||||||
this.buildForm();
|
this.buildForm();
|
||||||
|
|
||||||
if (data && data.id) this.checkLock(data.id, LockTargetType.DescriptionTemplate, 'DESCRIPTION-TEMPLATE-EDITOR.LOCKED-DIALOG.TITLE', 'DESCRIPTION-TEMPLATE-EDITOR.LOCKED-DIALOG.MESSAGE');
|
if (data && data.id) this.checkLock(data.id, LockTargetType.DescriptionTemplate, 'DESCRIPTION-TEMPLATE-EDITOR.LOCKED-DIALOG.TITLE', 'DESCRIPTION-TEMPLATE-EDITOR.LOCKED-DIALOG.MESSAGE');
|
||||||
|
@ -212,15 +230,11 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm() {
|
buildForm() {
|
||||||
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !(this.authService.hasPermission(AppPermission.EditDescriptionTemplate) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDescriptionTemplate)), (this.isNew || this.isClone));
|
this.formGroup = this.editorModel.buildForm(null, this.hideEditActions, (this.isNew || this.isClone));
|
||||||
this.descriptionTemplateEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
|
this.descriptionTemplateEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
|
||||||
this.isFinalized = this.editorModel.status == DescriptionTemplateStatus.Finalized;
|
|
||||||
if (this.isFinalized || this.isDeleted) {
|
|
||||||
this.formGroup.disable();
|
|
||||||
}
|
|
||||||
const action = this.route.snapshot.data['action'];
|
const action = this.route.snapshot.data['action'];
|
||||||
if (action && action == 'new-version') {
|
if (action && action == 'new-version') {
|
||||||
this.formGroup.enable();
|
|
||||||
this.formGroup.get('code').disable();
|
this.formGroup.get('code').disable();
|
||||||
this.formGroup.get('status').setValue(DescriptionTemplateStatus.Draft);
|
this.formGroup.get('status').setValue(DescriptionTemplateStatus.Draft);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +261,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
}
|
}
|
||||||
|
|
||||||
persistEntity(onSuccess?: (response) => void): void {
|
persistEntity(onSuccess?: (response) => void): void {
|
||||||
if (this.isNewVersion == false) {
|
if (!this.isNewVersion) {
|
||||||
const formData = this.formService.getValue(this.formGroup.value) as DescriptionTemplatePersist;
|
const formData = this.formService.getValue(this.formGroup.value) as DescriptionTemplatePersist;
|
||||||
formData.code = this.formGroup.get('code').getRawValue();
|
formData.code = this.formGroup.get('code').getRawValue();
|
||||||
|
|
||||||
|
|
|
@ -49,15 +49,16 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D
|
||||||
if (context == null) { context = this.createValidationContext(); }
|
if (context == null) { context = this.createValidationContext(); }
|
||||||
|
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators],
|
id: [{ value: this.id, disabled }, context.getValidation('id').validators],
|
||||||
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
|
label: [{ value: this.label, disabled }, context.getValidation('label').validators],
|
||||||
code: [{ value: this.code, disabled: !isNewOrClone }, context.getValidation('code').validators],
|
code: [{ value: this.code, disabled: !isNewOrClone }, context.getValidation('code').validators],
|
||||||
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
|
description: [{ value: this.description, disabled }, context.getValidation('description').validators],
|
||||||
language: [{ value: this.language, disabled: disabled }, context.getValidation('language').validators],
|
language: [{ value: this.language, disabled }, context.getValidation('language').validators],
|
||||||
type: [{ value: this.type, disabled: disabled }, context.getValidation('type').validators],
|
type: [{ value: this.type, disabled }, context.getValidation('type').validators],
|
||||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
|
status: [{ value: this.status, disabled }, context.getValidation('status').validators],
|
||||||
definition: this.definition.buildForm({
|
definition: this.definition.buildForm({
|
||||||
rootPath: `definition.`
|
rootPath: `definition.`,
|
||||||
|
disabled
|
||||||
}),
|
}),
|
||||||
users: this.formBuilder.array(
|
users: this.formBuilder.array(
|
||||||
(this.users ?? []).map(
|
(this.users ?? []).map(
|
||||||
|
@ -219,7 +220,8 @@ export class DescriptionTemplateDefinitionEditorModel implements DescriptionTemp
|
||||||
pages: this.formBuilder.array(
|
pages: this.formBuilder.array(
|
||||||
(this.pages ?? []).map(
|
(this.pages ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}pages[${index}].`
|
rootPath: `${rootPath}pages[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('pages').validators
|
), context.getValidation('pages').validators
|
||||||
),
|
),
|
||||||
|
@ -299,7 +301,8 @@ export class DescriptionTemplatePageEditorModel implements DescriptionTemplatePa
|
||||||
sections: this.formBuilder.array(
|
sections: this.formBuilder.array(
|
||||||
(this.sections ?? []).map(
|
(this.sections ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}sections[${index}].`
|
rootPath: `${rootPath}sections[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('sections').validators
|
), context.getValidation('sections').validators
|
||||||
),
|
),
|
||||||
|
@ -408,14 +411,16 @@ export class DescriptionTemplateSectionEditorModel implements DescriptionTemplat
|
||||||
sections: this.formBuilder.array(
|
sections: this.formBuilder.array(
|
||||||
(this.sections ?? []).map(
|
(this.sections ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}sections[${index}].`
|
rootPath: `${rootPath}sections[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('sections').validators
|
), context.getValidation('sections').validators
|
||||||
),
|
),
|
||||||
fieldSets: this.formBuilder.array(
|
fieldSets: this.formBuilder.array(
|
||||||
(this.fieldSets ?? []).map(
|
(this.fieldSets ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}fieldSets[${index}].`
|
rootPath: `${rootPath}fieldSets[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('fieldSets').validators
|
), context.getValidation('fieldSets').validators
|
||||||
)
|
)
|
||||||
|
@ -540,12 +545,14 @@ export class DescriptionTemplateFieldSetEditorModel implements DescriptionTempla
|
||||||
hasCommentField: [{ value: this.hasCommentField, disabled: disabled }, context.getValidation('hasCommentField').validators],
|
hasCommentField: [{ value: this.hasCommentField, disabled: disabled }, context.getValidation('hasCommentField').validators],
|
||||||
hasMultiplicity: [{ value: this.hasMultiplicity, disabled: disabled }, context.getValidation('hasMultiplicity').validators],
|
hasMultiplicity: [{ value: this.hasMultiplicity, disabled: disabled }, context.getValidation('hasMultiplicity').validators],
|
||||||
multiplicity: this.multiplicity.buildForm({
|
multiplicity: this.multiplicity.buildForm({
|
||||||
rootPath: `${rootPath}multiplicity.`
|
rootPath: `${rootPath}multiplicity.`,
|
||||||
|
disabled
|
||||||
}),
|
}),
|
||||||
fields: this.formBuilder.array(
|
fields: this.formBuilder.array(
|
||||||
(this.fields ?? []).map(
|
(this.fields ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}fields[${index}].`
|
rootPath: `${rootPath}fields[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('fields').validators
|
), context.getValidation('fields').validators
|
||||||
)
|
)
|
||||||
|
@ -745,15 +752,18 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
|
||||||
validations: [{ value: this.validations, disabled: disabled }, context.getValidation('validations').validators],
|
validations: [{ value: this.validations, disabled: disabled }, context.getValidation('validations').validators],
|
||||||
includeInExport: [{ value: this.includeInExport, disabled: disabled }, context.getValidation('includeInExport').validators],
|
includeInExport: [{ value: this.includeInExport, disabled: disabled }, context.getValidation('includeInExport').validators],
|
||||||
data: this.data.buildForm({
|
data: this.data.buildForm({
|
||||||
rootPath: `${rootPath}data.`
|
rootPath: `${rootPath}data.`,
|
||||||
|
disabled
|
||||||
}),
|
}),
|
||||||
defaultValue: this.defaultValue.buildForm({
|
defaultValue: this.defaultValue.buildForm({
|
||||||
rootPath: `${rootPath}defaultValue.`
|
rootPath: `${rootPath}defaultValue.`,
|
||||||
|
disabled
|
||||||
}),
|
}),
|
||||||
visibilityRules: this.formBuilder.array(
|
visibilityRules: this.formBuilder.array(
|
||||||
(this.visibilityRules ?? []).map(
|
(this.visibilityRules ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}visibilityRules[${index}].`
|
rootPath: `${rootPath}visibilityRules[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('visibilityRules').validators
|
), context.getValidation('visibilityRules').validators
|
||||||
)
|
)
|
||||||
|
@ -1350,7 +1360,8 @@ export class DescriptionTemplateRadioBoxDataEditorModel extends DescriptionTempl
|
||||||
formGroup.setControl('options', this.formBuilder.array(
|
formGroup.setControl('options', this.formBuilder.array(
|
||||||
(this.options ?? []).map(
|
(this.options ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}options[${index}].`
|
rootPath: `${rootPath}options[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('options').validators
|
), context.getValidation('options').validators
|
||||||
));
|
));
|
||||||
|
@ -1495,7 +1506,8 @@ export class DescriptionTemplateSelectDataEditorModel extends DescriptionTemplat
|
||||||
formGroup.setControl('options', this.formBuilder.array(
|
formGroup.setControl('options', this.formBuilder.array(
|
||||||
(this.options ?? []).map(
|
(this.options ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}options[${index}].`
|
rootPath: `${rootPath}options[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('options').validators
|
), context.getValidation('options').validators
|
||||||
));
|
));
|
||||||
|
@ -1654,7 +1666,8 @@ export class DescriptionTemplateUploadDataEditorModel extends DescriptionTemplat
|
||||||
formGroup.setControl('types', this.formBuilder.array(
|
formGroup.setControl('types', this.formBuilder.array(
|
||||||
(this.types ?? []).map(
|
(this.types ?? []).map(
|
||||||
(item, index) => item.buildForm({
|
(item, index) => item.buildForm({
|
||||||
rootPath: `${rootPath}types[${index}].`
|
rootPath: `${rootPath}types[${index}].`,
|
||||||
|
disabled
|
||||||
})
|
})
|
||||||
), context.getValidation('types').validators
|
), context.getValidation('types').validators
|
||||||
));
|
));
|
||||||
|
|
Loading…
Reference in New Issue