fix description template ui field types

This commit is contained in:
amentis 2024-03-05 17:37:01 +02:00
parent 6c82fcf8b0
commit 043d4d2e96
8 changed files with 21 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<Dmp>(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<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'),
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type)].join('.'),
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'),
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
// [nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
]
};
this.dmpService.query(lookup).pipe(takeUntil(this._destroyed))