Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
5c4292d735
|
@ -154,7 +154,6 @@ export class EnumUtils {
|
||||||
case DescriptionTemplateFieldType.RICH_TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RICH-TEXT-AREA');
|
case DescriptionTemplateFieldType.RICH_TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RICH-TEXT-AREA');
|
||||||
case DescriptionTemplateFieldType.UPLOAD: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.UPLOAD');
|
case DescriptionTemplateFieldType.UPLOAD: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.UPLOAD');
|
||||||
case DescriptionTemplateFieldType.DATE_PICKER: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.DATE-PICKER');
|
case DescriptionTemplateFieldType.DATE_PICKER: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.DATE-PICKER');
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.EXTERNAL-DATASETS');
|
|
||||||
case DescriptionTemplateFieldType.TAGS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TAGS');
|
case DescriptionTemplateFieldType.TAGS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TAGS');
|
||||||
case DescriptionTemplateFieldType.REFERENCE_TYPES: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.REFERENCE-TYPES');
|
case DescriptionTemplateFieldType.REFERENCE_TYPES: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.REFERENCE-TYPES');
|
||||||
case DescriptionTemplateFieldType.DATASET_IDENTIFIER: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.DATASET-IDENTIFIER');
|
case DescriptionTemplateFieldType.DATASET_IDENTIFIER: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.DATASET-IDENTIFIER');
|
||||||
|
|
|
@ -197,10 +197,6 @@
|
||||||
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Reference types icon">
|
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Reference types icon">
|
||||||
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
|
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS)">
|
|
||||||
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="External Datasets icon">
|
|
||||||
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS)}}
|
|
||||||
</button>
|
|
||||||
</mat-action-list>
|
</mat-action-list>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
|
@ -562,15 +562,6 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon
|
||||||
field.data = data;
|
field.data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS: {
|
|
||||||
// const data: DescriptionTemplateExternalDatasetData = {
|
|
||||||
// label: '',
|
|
||||||
// multipleSelect: false,
|
|
||||||
// fieldType: type
|
|
||||||
// }
|
|
||||||
// field.data = data;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
case DescriptionTemplateFieldType.UPLOAD: {
|
case DescriptionTemplateFieldType.UPLOAD: {
|
||||||
const data: DescriptionTemplateUploadData = {
|
const data: DescriptionTemplateUploadData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
|
|
@ -87,10 +87,6 @@
|
||||||
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Registries icon">
|
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Registries icon">
|
||||||
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
|
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<mat-option [value]="descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS">
|
|
||||||
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="ExternalDatasets icon">
|
|
||||||
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS)}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
<!-- TODO -->
|
<!-- TODO -->
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
@ -176,8 +172,6 @@
|
||||||
<app-description-template-editor-label-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATASET_IDENTIFIER" class="col-12" [form]="form"></app-description-template-editor-label-field-component>
|
<app-description-template-editor-label-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATASET_IDENTIFIER" class="col-12" [form]="form"></app-description-template-editor-label-field-component>
|
||||||
<app-description-template-editor-label-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.VALIDATION" class="col-12" [form]="form"></app-description-template-editor-label-field-component>
|
<app-description-template-editor-label-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.VALIDATION" class="col-12" [form]="form"></app-description-template-editor-label-field-component>
|
||||||
|
|
||||||
<app-description-template-editor-external-datasets-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS" class="col-12" [form]="form"></app-description-template-editor-external-datasets-field-component>
|
|
||||||
|
|
||||||
<app-description-template-editor-label-and-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DMPS" class="col-12" [form]="form"></app-description-template-editor-label-and-multiplicity-field-component>
|
<app-description-template-editor-label-and-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DMPS" class="col-12" [form]="form"></app-description-template-editor-label-and-multiplicity-field-component>
|
||||||
<app-description-template-editor-label-and-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS" class="col-12" [form]="form"></app-description-template-editor-label-and-multiplicity-field-component>
|
<app-description-template-editor-label-and-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS" class="col-12" [form]="form"></app-description-template-editor-label-and-multiplicity-field-component>
|
||||||
|
|
||||||
|
|
|
@ -170,15 +170,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple
|
||||||
field.data = data;
|
field.data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS: {
|
|
||||||
// const data: DescriptionTemplateExternalDatasetData = {
|
|
||||||
// label: '',
|
|
||||||
// multipleSelect: false,
|
|
||||||
// fieldType: type
|
|
||||||
// }
|
|
||||||
// field.data = data;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
case DescriptionTemplateFieldType.UPLOAD: {
|
case DescriptionTemplateFieldType.UPLOAD: {
|
||||||
const data: DescriptionTemplateUploadData = {
|
const data: DescriptionTemplateUploadData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
|
|
@ -704,7 +704,7 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
|
||||||
defaultValue: string;
|
defaultValue: string;
|
||||||
visibilityRules: DescriptionTemplateRuleEditorModel[] = [];
|
visibilityRules: DescriptionTemplateRuleEditorModel[] = [];
|
||||||
validations: DescriptionTemplateFieldValidationType[] = [];
|
validations: DescriptionTemplateFieldValidationType[] = [];
|
||||||
includeInExport: boolean = false;
|
includeInExport: boolean = true;
|
||||||
data: DescriptionTemplateLabelDataEditorModel = new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel);
|
data: DescriptionTemplateLabelDataEditorModel = new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel);
|
||||||
|
|
||||||
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
|
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
|
||||||
|
@ -802,8 +802,6 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
|
||||||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS:
|
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS:
|
||||||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
|
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
|
||||||
return new DescriptionTemplateLabelAndMultiplicityDataEditorModel(this.validationErrorModel);
|
return new DescriptionTemplateLabelAndMultiplicityDataEditorModel(this.validationErrorModel);
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS:
|
|
||||||
// return new DescriptionTemplateExternalDatasetDataEditorModel(this.validationErrorModel);
|
|
||||||
case DescriptionTemplateFieldType.UPLOAD:
|
case DescriptionTemplateFieldType.UPLOAD:
|
||||||
return new DescriptionTemplateUploadDataEditorModel(this.validationErrorModel);
|
return new DescriptionTemplateUploadDataEditorModel(this.validationErrorModel);
|
||||||
}
|
}
|
||||||
|
@ -862,12 +860,6 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
|
||||||
rootPath: `${rootPath}data.`,
|
rootPath: `${rootPath}data.`,
|
||||||
validationErrorModel: validationErrorModel
|
validationErrorModel: validationErrorModel
|
||||||
});
|
});
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS:
|
|
||||||
// DescriptionTemplateExternalDatasetDataEditorModel.reapplyValidators({
|
|
||||||
// formGroup: formGroup?.get('data') as UntypedFormGroup,
|
|
||||||
// rootPath: `${rootPath}data.`,
|
|
||||||
// validationErrorModel: validationErrorModel
|
|
||||||
// });
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -723,9 +723,6 @@ export class DescriptionFieldIndicator {
|
||||||
case DescriptionTemplateFieldType.DATE_PICKER:
|
case DescriptionTemplateFieldType.DATE_PICKER:
|
||||||
this.type = "dateValue";
|
this.type = "dateValue";
|
||||||
break;
|
break;
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS:
|
|
||||||
// this.type = "";
|
|
||||||
// break;
|
|
||||||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
|
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
|
||||||
if (multipleSelect) this.type = "textListValue";
|
if (multipleSelect) this.type = "textListValue";
|
||||||
else this.type = "textValue"
|
else this.type = "textValue"
|
||||||
|
|
|
@ -130,17 +130,6 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
|
||||||
this.isRequired = this.field.validations?.includes(DescriptionTemplateFieldValidationType.Required);
|
this.isRequired = this.field.validations?.includes(DescriptionTemplateFieldValidationType.Required);
|
||||||
|
|
||||||
switch (this.field?.data?.fieldType) {
|
switch (this.field?.data?.fieldType) {
|
||||||
// case DescriptionTemplateFieldType.EXTERNAL_DATASETS:
|
|
||||||
// //TODO: refactor
|
|
||||||
// // this.multipleReferenceAutoCompleteConfiguration = {
|
|
||||||
// // filterFn: this.filterOrganisations.bind(this),
|
|
||||||
// // initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
|
||||||
// // displayFn: (item) => { try { return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name } catch { return '' } },
|
|
||||||
// // titleFn: (item) => { try { return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name } catch { return '' } },
|
|
||||||
// // subtitleFn: (item) => { try { return item['tag'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['tag'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')) } catch { return '' } },
|
|
||||||
// // valueAssign: (item) => { try { return typeof (item) == 'string' ? item : JSON.stringify(item) } catch { return '' } }
|
|
||||||
// // };
|
|
||||||
// break;
|
|
||||||
case DescriptionTemplateFieldType.TAGS:
|
case DescriptionTemplateFieldType.TAGS:
|
||||||
this.tagsAutoCompleteConfiguration = {
|
this.tagsAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterTags.bind(this),
|
filterFn: this.filterTags.bind(this),
|
||||||
|
|
Loading…
Reference in New Issue