From a50a1e8bc1afeb4c4506461c08ead3367c6e1474 Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 1 May 2024 11:32:55 +0300 Subject: [PATCH] remove EXTERNAL_DATASETS enum field type value from UI --- .../app/core/services/utilities/enum-utils.service.ts | 1 - ...ion-template-editor-composite-field.component.html | 4 ---- ...ption-template-editor-composite-field.component.ts | 9 --------- .../description-template-editor-field.component.html | 6 ------ .../description-template-editor-field.component.ts | 9 --------- .../editor/description-template-editor.model.ts | 10 +--------- .../ui/description/editor/description-editor.model.ts | 3 --- .../components/form-field/form-field.component.ts | 11 ----------- 8 files changed, 1 insertion(+), 52 deletions(-) diff --git a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts index 780c307fe..d75f8afcd 100644 --- a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts +++ b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts @@ -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.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.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.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'); diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html index 3370f2a0c..2508728ab 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html @@ -197,10 +197,6 @@ Reference types icon {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}} - diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts index 22dc8decd..b674c8169 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts @@ -562,15 +562,6 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon field.data = data; break; } - // case DescriptionTemplateFieldType.EXTERNAL_DATASETS: { - // const data: DescriptionTemplateExternalDatasetData = { - // label: '', - // multipleSelect: false, - // fieldType: type - // } - // field.data = data; - // break; - // } case DescriptionTemplateFieldType.UPLOAD: { const data: DescriptionTemplateUploadData = { label: '', diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html index 6dde9dfd4..f7f5f1aba 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html @@ -87,10 +87,6 @@ Registries icon {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}} - - ExternalDatasets icon - {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.EXTERNAL_DATASETS)}} - @@ -176,8 +172,6 @@ - - diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts index f5d808cde..474d251b4 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts @@ -170,15 +170,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple field.data = data; break; } - // case DescriptionTemplateFieldType.EXTERNAL_DATASETS: { - // const data: DescriptionTemplateExternalDatasetData = { - // label: '', - // multipleSelect: false, - // fieldType: type - // } - // field.data = data; - // break; - // } case DescriptionTemplateFieldType.UPLOAD: { const data: DescriptionTemplateUploadData = { label: '', diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts index c09a718a9..347511ba0 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts @@ -704,7 +704,7 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF defaultValue: string; visibilityRules: DescriptionTemplateRuleEditorModel[] = []; validations: DescriptionTemplateFieldValidationType[] = []; - includeInExport: boolean = false; + includeInExport: boolean = true; data: DescriptionTemplateLabelDataEditorModel = new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel); protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); @@ -802,8 +802,6 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return new DescriptionTemplateLabelAndMultiplicityDataEditorModel(this.validationErrorModel); - // case DescriptionTemplateFieldType.EXTERNAL_DATASETS: - // return new DescriptionTemplateExternalDatasetDataEditorModel(this.validationErrorModel); case DescriptionTemplateFieldType.UPLOAD: return new DescriptionTemplateUploadDataEditorModel(this.validationErrorModel); } @@ -862,12 +860,6 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF rootPath: `${rootPath}data.`, validationErrorModel: validationErrorModel }); - // case DescriptionTemplateFieldType.EXTERNAL_DATASETS: - // DescriptionTemplateExternalDatasetDataEditorModel.reapplyValidators({ - // formGroup: formGroup?.get('data') as UntypedFormGroup, - // rootPath: `${rootPath}data.`, - // validationErrorModel: validationErrorModel - // }); break; } diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts index 8d70044fb..02eb5d4ba 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts @@ -723,9 +723,6 @@ export class DescriptionFieldIndicator { case DescriptionTemplateFieldType.DATE_PICKER: this.type = "dateValue"; break; - // case DescriptionTemplateFieldType.EXTERNAL_DATASETS: - // this.type = ""; - // break; case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: if (multipleSelect) this.type = "textListValue"; else this.type = "textValue" diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts index 3d9fd5567..d2f1a74a5 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts @@ -130,17 +130,6 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn this.isRequired = this.field.validations?.includes(DescriptionTemplateFieldValidationType.Required); 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: this.tagsAutoCompleteConfiguration = { filterFn: this.filterTags.bind(this),