From 043d4d2e966b8712b2f1d75299d5467bdc5598ea Mon Sep 17 00:00:00 2001 From: amentis Date: Tue, 5 Mar 2024 17:37:01 +0200 Subject: [PATCH 1/3] 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)) From 5851c2ff266143a1f4d93260e31992b4f3c4f06f Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 6 Mar 2024 11:53:40 +0200 Subject: [PATCH 2/3] ui fixes and add dmpBlueprintVersionStatus lookup field --- .../eu/eudat/query/DescriptionTemplateQuery.java | 2 +- .../eu/eudat/query/lookup/DmpBlueprintLookup.java | 13 +++++++++++++ .../enum/description-template-version-status.ts | 3 ++- .../common/enum/dmp-blueprint-version-status.ts | 5 +++++ .../src/app/core/query/dmp-blueprint.lookup.ts | 3 +++ .../description-template-listing.component.ts | 7 ++++++- .../listing/dmp-blueprint-listing.component.ts | 7 ++++++- .../listing/description-listing.component.ts | 3 ++- .../overview/description-overview.component.html | 4 ++-- .../app/ui/dmp/overview/dmp-overview.component.html | 6 +++--- .../app/ui/dmp/overview/dmp-overview.component.ts | 12 ++++++++---- 11 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 dmp-frontend/src/app/core/common/enum/dmp-blueprint-version-status.ts diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateQuery.java b/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateQuery.java index c799aa592..acdf587f9 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateQuery.java @@ -274,7 +274,7 @@ public class DescriptionTemplateQuery extends QueryBase groupIds; + private List versionStatuses; + public String getLike() { return like; } @@ -63,6 +66,14 @@ public class DmpBlueprintLookup extends Lookup { this.excludedIds = excludedIds; } + public List getVersionStatuses() { + return versionStatuses; + } + + public void setVersionStatuses(List versionStatuses) { + this.versionStatuses = versionStatuses; + } + public List getGroupIds() { return groupIds; } @@ -85,6 +96,8 @@ public class DmpBlueprintLookup extends Lookup { query.excludedIds(this.excludedIds); if (this.groupIds != null) query.groupIds(this.groupIds); + if (this.versionStatuses != null) + query.versionStatuses(this.versionStatuses); this.enrichCommon(query); diff --git a/dmp-frontend/src/app/core/common/enum/description-template-version-status.ts b/dmp-frontend/src/app/core/common/enum/description-template-version-status.ts index 130e01b1e..ece53bc09 100644 --- a/dmp-frontend/src/app/core/common/enum/description-template-version-status.ts +++ b/dmp-frontend/src/app/core/common/enum/description-template-version-status.ts @@ -1,4 +1,5 @@ export enum DescriptionTemplateVersionStatus { Current = 0, - Previous = 1 + Previous = 1, + NotFinalized = 2 } \ No newline at end of file diff --git a/dmp-frontend/src/app/core/common/enum/dmp-blueprint-version-status.ts b/dmp-frontend/src/app/core/common/enum/dmp-blueprint-version-status.ts new file mode 100644 index 000000000..16f1c0cbd --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/dmp-blueprint-version-status.ts @@ -0,0 +1,5 @@ +export enum DmpBlueprintVersionStatus { + Current = 0, + Previous = 1, + NotFinalized = 2 +} \ No newline at end of file diff --git a/dmp-frontend/src/app/core/query/dmp-blueprint.lookup.ts b/dmp-frontend/src/app/core/query/dmp-blueprint.lookup.ts index d32697e59..bd92e2f3a 100644 --- a/dmp-frontend/src/app/core/query/dmp-blueprint.lookup.ts +++ b/dmp-frontend/src/app/core/query/dmp-blueprint.lookup.ts @@ -2,6 +2,7 @@ import { Lookup } from '@common/model/lookup'; import { Guid } from '@common/types/guid'; import { IsActive } from '../common/enum/is-active.enum'; import { DmpBlueprintStatus } from '../common/enum/dmp-blueprint-status'; +import { DmpBlueprintVersionStatus } from '../common/enum/dmp-blueprint-version-status'; export class DmpBlueprintLookup extends Lookup implements DmpBlueprintFilter { ids: Guid[]; @@ -10,6 +11,7 @@ export class DmpBlueprintLookup extends Lookup implements DmpBlueprintFilter { isActive: IsActive[]; statuses: DmpBlueprintStatus[]; groupIds: Guid[]; + versionStatuses: DmpBlueprintVersionStatus[]; constructor() { super(); @@ -22,4 +24,5 @@ export interface DmpBlueprintFilter { like: string; isActive: IsActive[]; statuses: DmpBlueprintStatus[]; + versionStatuses: DmpBlueprintVersionStatus[]; } diff --git a/dmp-frontend/src/app/ui/admin/description-template/listing/description-template-listing.component.ts b/dmp-frontend/src/app/ui/admin/description-template/listing/description-template-listing.component.ts index db8be0be7..544a6f0dd 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/listing/description-template-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/listing/description-template-listing.component.ts @@ -28,6 +28,7 @@ import { DescriptionTemplateService } from '@app/core/services/description-templ import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status'; import { DescriptionTemplateLookup } from '@app/core/query/description-template.lookup'; import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe'; +import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/description-template-version-status'; @Component({ @@ -93,8 +94,12 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent(x => x.createdAt))] }; - if (this.mode && this.mode == 'versions-listing') lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))] + if (this.mode && this.mode == 'versions-listing') { + lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))]; + lookup.versionStatuses = null; + } this.updateOrderUiFields(lookup.order); lookup.project = { diff --git a/dmp-frontend/src/app/ui/admin/dmp-blueprint/listing/dmp-blueprint-listing.component.ts b/dmp-frontend/src/app/ui/admin/dmp-blueprint/listing/dmp-blueprint-listing.component.ts index 05f33d4f7..5ac76d65c 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-blueprint/listing/dmp-blueprint-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-blueprint/listing/dmp-blueprint-listing.component.ts @@ -28,6 +28,7 @@ import { takeUntil } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component'; import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe'; +import { DmpBlueprintVersionStatus } from '@app/core/common/enum/dmp-blueprint-version-status'; @Component({ @@ -92,8 +93,12 @@ export class DmpBlueprintListingComponent extends BaseListingComponent(x => x.createdAt))] }; - if (this.mode && this.mode == 'versions-listing') lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))] + if (this.mode && this.mode == 'versions-listing') { + lookup.groupIds = [Guid.parse(this.route.snapshot.paramMap.get('groupid'))]; + lookup.versionStatuses = null; + } this.updateOrderUiFields(lookup.order); lookup.project = { diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts index 772b95841..72a774ca0 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts @@ -14,6 +14,7 @@ import { Description } from '@app/core/model/description/description'; import { Dmp, DmpUser } from '@app/core/model/dmp/dmp'; import { DmpReference } from '@app/core/model/dmp/dmp-reference'; import { FileFormat } from '@app/core/model/file/file-format.model'; +import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { Reference } from '@app/core/model/reference/reference'; import { DescriptionLookup } from '@app/core/query/description.lookup'; import { DmpLookup } from '@app/core/query/dmp.lookup'; @@ -197,7 +198,7 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit [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.type), nameof(x => x.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpReferences), nameof(x => x.reference), nameof(x => x.reference)].join('.'), ] }; diff --git a/dmp-frontend/src/app/ui/description/overview/description-overview.component.html b/dmp-frontend/src/app/ui/description/overview/description-overview.component.html index a72ea117e..28ee57bbe 100644 --- a/dmp-frontend/src/app/ui/description/overview/description-overview.component.html +++ b/dmp-frontend/src/app/ui/description/overview/description-overview.component.html @@ -29,10 +29,10 @@ .
{{'DESCRIPTION-OVERVIEW.EDITED' | translate}} : - {{description.modified | dateTimeCultureFormatter: "d MMMM y"}} + {{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}
-
+
check {{'DESCRIPTION-OVERVIEW.FINALISED' | translate}}
diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 93d8371d9..f2b1682fa 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -44,7 +44,7 @@
-
-
+