description editor fix
This commit is contained in:
parent
cc6359e0fc
commit
443ce153ee
|
@ -155,7 +155,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
|
|||
validationErrorModel: ValidationErrorModel,
|
||||
rootPath: string
|
||||
}): void {
|
||||
|
||||
|
||||
const { formGroup, rootPath, validationErrorModel } = params;
|
||||
|
||||
const keys = Object.keys(formGroup.value as Object);
|
||||
|
@ -166,7 +166,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
|
|||
rootPath: `${rootPath}fieldSets[${key}].`,
|
||||
validationErrorModel: validationErrorModel
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private calculateProperties(item: DescriptionPropertyDefinition, descriptionTemplate: DescriptionTemplate, descriptionReferences: DescriptionReference[]): Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> {
|
||||
|
@ -322,7 +322,13 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
|
|||
if (item) {
|
||||
this.comment = item.comment;
|
||||
this.ordinal = item.ordinal;
|
||||
if (item.fields) { Object.keys(item.fields)?.forEach(key => this.fields.set(key, new DescriptionFieldEditorModel(this.validationErrorModel).fromModel(item.fields[key], definitionFieldSet?.fields?.find(x => x.id == key), descriptionReferences))); }
|
||||
if (item.fields) {
|
||||
//TODO: don't like it. Find a common way to parse it either its Map or json.
|
||||
if (item.fields instanceof Map)
|
||||
new Map(item.fields)?.forEach((value, key) => this.fields.set(key, new DescriptionFieldEditorModel(this.validationErrorModel).fromModel(value, definitionFieldSet?.fields?.find(x => x.id == key), descriptionReferences)));
|
||||
else
|
||||
Object.keys(item.fields)?.forEach((key) => this.fields.set(key, new DescriptionFieldEditorModel(this.validationErrorModel).fromModel(item.fields[key], definitionFieldSet?.fields?.find(x => x.id == key), descriptionReferences)));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@ -392,7 +398,7 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
|
|||
rootPath: `${rootPath}fields[${key}].`,
|
||||
validationErrorModel: validationErrorModel
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
['comment', 'ordinal'].forEach(keyField => {
|
||||
const control = formGroup?.get(keyField);
|
||||
|
|
|
@ -155,15 +155,6 @@
|
|||
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('dateValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS" class="col-12">
|
||||
<ng-container *ngIf="field.data.multipleSelect">
|
||||
<app-reference-field-component [form]="propertiesFormGroup?.get(field.id).get('references')" [label]="field.label" [placeholder]="(field.data.label | translate) + (isRequired ? ' *': '')" [referenceType]="referenceTypeEnum.Datasets" [multiple]="true" [required]="isRequired" hint="{{ 'TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT' | translate }}"></app-reference-field-component>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="!(field.data.multipleSelect)">
|
||||
<app-reference-field-component [form]="propertiesFormGroup?.get(field.id).get('reference')" [label]="field.label" [placeholder]="(field.data.label | translate) + (isRequired ? ' *': '')" [referenceType]="referenceTypeEnum.Datasets" [multiple]="false" [required]="isRequired" hint="{{ 'TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT' | translate }}"></app-reference-field-component>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.TAGS" class="col-12">
|
||||
<div class="row">
|
||||
<mat-form-field class="col-md-12">
|
||||
|
|
|
@ -29,7 +29,7 @@ export class TableOfContentsInternal implements OnInit {
|
|||
constructor() {
|
||||
}
|
||||
ngOnInit(): void {
|
||||
console.log('component created' + JSON.stringify(this.tocentries));
|
||||
// console.log('component created' + JSON.stringify(this.tocentries));
|
||||
if (this.tocentries) {
|
||||
this.expandChildren = this.tocentries.map(() => false);
|
||||
if (this.selected) {
|
||||
|
|
|
@ -220,10 +220,10 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
|
|||
.subscribe(_ => {
|
||||
if (this.hasFocus) {
|
||||
this._resetObserver();
|
||||
this.hiddenEntries = this._findHiddenEntries(this.tocentries);
|
||||
// this.hiddenEntries = this._findHiddenEntries(this.tocentries);
|
||||
}
|
||||
});
|
||||
this.hiddenEntries = this._findHiddenEntries(this.tocentries);
|
||||
// this.hiddenEntries = this._findHiddenEntries(this.tocentries);
|
||||
}
|
||||
// if (!this.isActive && this.links && this.links.length > 0) {
|
||||
// this.links.forEach(link => {
|
||||
|
|
Loading…
Reference in New Issue