From 043d4d2e966b8712b2f1d75299d5467bdc5598ea Mon Sep 17 00:00:00 2001 From: amentis Date: Tue, 5 Mar 2024 17:37:01 +0200 Subject: [PATCH] fix description template ui field types --- .../enum/description-template-field-type.ts | 4 ++-- .../src/app/core/pipes/field-value.pipe.ts | 2 +- .../services/utilities/enum-utils.service.ts | 2 +- ...-template-editor-composite-field.component.ts | 4 ++-- ...escription-template-editor-field.component.ts | 4 ++-- .../editor/description-template-editor.model.ts | 2 +- .../form-field/form-field.component.ts | 2 +- .../app/ui/dmp/listing/dmp-listing.component.ts | 16 +++++++++++----- 8 files changed, 21 insertions(+), 15 deletions(-) diff --git a/dmp-frontend/src/app/core/common/enum/description-template-field-type.ts b/dmp-frontend/src/app/core/common/enum/description-template-field-type.ts index dca669bb4..28633d1c6 100644 --- a/dmp-frontend/src/app/core/common/enum/description-template-field-type.ts +++ b/dmp-frontend/src/app/core/common/enum/description-template-field-type.ts @@ -2,8 +2,8 @@ export enum DescriptionTemplateFieldType { SELECT = "select", BOOLEAN_DECISION = "booleanDecision", RADIO_BOX = "radiobox", - INTERNAL_DMP_ENTRIES_DMPS = "internalDmpDmps", - INTERNAL_ENTRIES_DESCRIPTIONS = "internalDmpDescriptions", + INTERNAL_ENTRIES_DMPS = "internalEntitiesDmps", + INTERNAL_ENTRIES_DESCRIPTIONS = "internalEntitiesDescriptions", CHECK_BOX = "checkBox", FREE_TEXT = "freetext", TEXT_AREA = "textarea", diff --git a/dmp-frontend/src/app/core/pipes/field-value.pipe.ts b/dmp-frontend/src/app/core/pipes/field-value.pipe.ts index 68e25404e..e20f120eb 100644 --- a/dmp-frontend/src/app/core/pipes/field-value.pipe.ts +++ b/dmp-frontend/src/app/core/pipes/field-value.pipe.ts @@ -53,7 +53,7 @@ export class FieldValuePipe implements PipeTransform { case DescriptionTemplateFieldType.EXTERNAL_DATASETS: case DescriptionTemplateFieldType.TAGS: return this.parseJson(value); - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.parseJson(value, 'label'); case DescriptionTemplateFieldType.DATASET_IDENTIFIER: 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 2d90dfa50..1855efea0 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 @@ -158,7 +158,7 @@ export class EnumUtils { case DescriptionTemplateFieldType.SELECT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.SELECT'); case DescriptionTemplateFieldType.BOOLEAN_DECISION: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.BOOLEAN-DECISION'); case DescriptionTemplateFieldType.RADIO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RADIO-BOX'); - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS'); + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS'); case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DATASETS'); case DescriptionTemplateFieldType.CHECK_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.CHECKBOX'); case DescriptionTemplateFieldType.FREE_TEXT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.FREE-TEXT'); 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 c0727b36f..82911a008 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 @@ -530,11 +530,11 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon break; } - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: { + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: { //TODO: refactor break; } - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: { const data: DescriptionTemplateLabelAndMultiplicityData = { label: '', 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 ff28f505e..8f6c30ba0 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 @@ -162,11 +162,11 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple break; } - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: { + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: { //TODO: refactor break; } - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:{ const data: DescriptionTemplateLabelAndMultiplicityData = { 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 7f88bf78a..ffe483fe0 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 @@ -808,7 +808,7 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF case DescriptionTemplateFieldType.CURRENCY: case DescriptionTemplateFieldType.VALIDATION: return new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel); - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return new DescriptionTemplateLabelAndMultiplicityDataEditorModel(this.validationErrorModel); case DescriptionTemplateFieldType.EXTERNAL_DATASETS: 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 032f2df9e..ae50c8f44 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 @@ -196,7 +196,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: this.makeAutocompleteConfiguration(this.searchDatasets.bind(this), "label"); break; - case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: + case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: this.makeAutocompleteConfiguration(this.searchDmps.bind(this), "label"); break; } diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index 6b9fe0e84..e33b4a31b 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -27,6 +27,10 @@ import { TranslateService } from '@ngx-translate/core'; import { NgDialogAnimationService } from "ng-dialog-animation"; import { debounceTime, takeUntil } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; +import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status'; +import { DmpReference } from '@app/core/model/dmp/dmp-reference'; +import { Reference } from '@app/core/model/reference/reference'; +import { ReferenceType } from '@app/core/model/reference-type/reference-type'; @Component({ selector: 'app-dmp-listing-component', @@ -92,9 +96,11 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr this.lookup.order = { items: ['-' + nameof(x => x.updatedAt)] }; this.lookup.metadata = { countAll: true }; this.lookup.isActive = [IsActive.Active]; + this.lookup.versionStatuses = [DmpVersionStatus.Current]; if (this.groupId != null && Guid.isGuid(this.groupId)) { this.lookup.groupIds = [Guid.parse(this.groupId)]; + this.lookup.versionStatuses = null; } this.refresh(this.lookup); @@ -184,11 +190,11 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr [nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), - // [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.id)].join('.'), - // [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.id)].join('.'), - // [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.label)].join('.'), - // [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.type)].join('.'), - // [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.reference)].join('.'), + [nameof(x => x.dmpReferences), nameof(x => x.id)].join('.'), + [nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.id)].join('.'), + [nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.label)].join('.'), + [nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.type), nameof(x => x.id)].join('.'), + // [nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.reference)].join('.'), ] }; this.dmpService.query(lookup).pipe(takeUntil(this._destroyed))