Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
Sofia Papacharalampous 2024-05-01 11:52:37 +03:00
commit 5c4292d735
8 changed files with 1 additions and 52 deletions

View File

@ -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');

View File

@ -197,10 +197,6 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Reference types icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
</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-divider></mat-divider>

View File

@ -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: '',

View File

@ -87,10 +87,6 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Registries icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.REFERENCE_TYPES)}}
</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>
<!-- TODO -->
<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.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_DESCRIPTIONS" class="col-12" [form]="form"></app-description-template-editor-label-and-multiplicity-field-component>

View File

@ -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: '',

View File

@ -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;
}

View File

@ -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"

View File

@ -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),