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

This commit is contained in:
Efstratios Giannopoulos 2024-06-05 17:43:19 +03:00
commit b3258e35eb
3 changed files with 8 additions and 7 deletions

View File

@ -9,7 +9,7 @@ BEGIN
INSERT INTO public."Language" VALUES ('1213a820-e6bb-492e-b63b-06a8c650ef92', 'es', null, '2023-11-28 16:35:18.114652', '2023-11-29 15:50:57.253892', 1, 3, null);
INSERT INTO public."Language" VALUES ('d8bb2f19-048d-4806-b99a-efdafe36de52', 'de', null, '2023-11-28 16:35:18.114652', '2023-11-29 15:50:57.253892', 1, 0, null);
INSERT INTO public."Language" VALUES ('acb16ec4-dbad-4aec-b6a0-214ebacc2983', 'hr', null, '2023-11-28 16:35:18.114652', '2023-11-29 15:50:57.253892', 1, 4, null);
INSERT INTO public."Language" VALUES ('c9d8850c-c459-47b1-98d1-9c21b614ae7b', 'hr', null, '2024-02-29 16:35:18.114652', '2024-02-29 16:35:18.114652', 1, 5, null);
INSERT INTO public."Language" VALUES ('1f26b803-df4b-4270-82b1-895bfff9ccf2', 'baq', null, '2024-02-29 16:35:18.114652', '2024-02-29 16:35:18.114652', 1, 5, null);
INSERT INTO public."Language" VALUES ('96b9c91a-a9e4-4a66-9361-a1eba22cc971', 'tr', null, '2024-02-29 16:35:18.114652', '2024-02-29 16:35:18.114652', 1, 6, null);
INSERT INTO public."Language" VALUES ('cdbb160f-a655-46eb-8328-589144e5a484', 'sk', null, '2024-02-29 16:35:18.114652', '2024-02-29 16:35:18.114652', 1, 7, null);
INSERT INTO public."Language" VALUES ('57c6129a-a918-4fb0-9c5b-9ec1c2ee1341', 'sr', null, '2024-02-29 16:35:18.114652', '2024-02-29 16:35:18.114652', 1, 8, null);

View File

@ -75,7 +75,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
pageToFieldSetMap: Map<string, DescriptionFieldIndicator[]> = new Map<string, DescriptionFieldIndicator[]>();
private initialTemplateId: Guid;
private initialTemplateId: string = Guid.EMPTY;
constructor(
// BaseFormEditor injected dependencies
@ -190,7 +190,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
try {
this.editorModel = data ? new DescriptionEditorModel().fromModel(data, data.descriptionTemplate) : new DescriptionEditorModel();
this.item = data;
this.initialTemplateId = data.descriptionTemplate.id;
this.initialTemplateId = data?.descriptionTemplate?.id?.toString();
if (data && data.dmpDescriptionTemplate?.sectionId && data.dmp?.blueprint?.definition?.sections?.length > 0 && data.dmp?.descriptions?.length > 0) {
const section = data.dmp?.blueprint?.definition?.sections.find(x => x.id == data.dmpDescriptionTemplate?.sectionId);
if (section.hasTemplates) {
@ -663,7 +663,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
.pipe(takeUntil(this._destroyed))
.subscribe(descriptionTemplateId => {
if (descriptionTemplateId) {
if (descriptionTemplateId === this.initialTemplateId) return;
if (this.initialTemplateId && this.initialTemplateId != '' && descriptionTemplateId === this.initialTemplateId) return;
this.descriptionTemplateValueChanged(descriptionTemplateId);
}
});
@ -679,7 +679,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.descriptionTemplateService.getSingle(descriptionTemplateId, DescriptionEditorResolver.descriptionTemplateLookupFields()).pipe(takeUntil(this._destroyed))
.subscribe(descriptionTemplate => {
this.initialTemplateId = descriptionTemplateId;
this.initialTemplateId = descriptionTemplateId.toString();
this.editorModel.properties = new DescriptionPropertyDefinitionEditorModel(this.editorModel.validationErrorModel).fromModel(null, descriptionTemplate, null);
this.formGroup.setControl('properties', this.editorModel.buildProperties());
this.item.descriptionTemplate = descriptionTemplate;
@ -693,7 +693,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.registerFormListeners();
},
error => {
this.formGroup.get('descriptionTemplateId').setValue(this.initialTemplateId);
this.formGroup.get('descriptionTemplateId').setValue(this.initialTemplateId && this.initialTemplateId != '' ? this.initialTemplateId : null);
this.httpErrorHandlingService.handleBackedRequestError(error);
});
}

View File

@ -169,7 +169,8 @@
"sr": "Serbian",
"pt": "Portuguese",
"hr": "Croatian",
"pl": "Polish"
"pl": "Polish",
"baq": "Basque"
},
"CRITERIA": {
"LIKE": "Search..."