From aa32f712776a7d98fdb87f8d8f1111171294cc10 Mon Sep 17 00:00:00 2001 From: Stefan Renczes Date: Tue, 29 Oct 2024 15:10:00 +0100 Subject: [PATCH] [NAE-2013] Autocomplete options are set to the first dropdown - corrected resolution of fields - corrected rendering of i18n divider --- .../services/task-content.service.ts | 20 +++++-------------- .../i18n-divider-field.component.html | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts b/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts index c76e8fb73..3270d8606 100644 --- a/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts +++ b/projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts @@ -226,8 +226,8 @@ export abstract class TaskContentService implements OnDestroy { Object.keys(chFields).forEach(changedField => { if (chFields.taskId === this._task.stringId && this.isFieldInTask(chFields.taskId, changedField)) { this.updateField(chFields, this.taskFieldsIndex[chFields.taskId].fields[changedField], frontendActions); - } else if (!!this.getReferencedTaskId(changedField)) { - this.updateField(chFields, this.taskFieldsIndex[this.getReferencedTaskId(changedField)].fields[changedField], frontendActions, true); + } else if (!!this.getReferencedTaskId(changedField, chFields)) { + this.updateField(chFields, this.taskFieldsIndex[this.getReferencedTaskId(changedField, chFields)].fields[changedField], frontendActions, true); } }); @@ -253,7 +253,7 @@ export abstract class TaskContentService implements OnDestroy { if (!referenced && updatedField.behavior[this._task.transitionId]) { field.behavior = updatedField.behavior[this._task.transitionId]; } else if (referenced) { - const taskId = this.getReferencedTaskId(field.stringId); + const taskId = this.getReferencedTaskId(field.stringId, chFields); const taskRef = this.findTaskRefId(taskId, this.taskFieldsIndex[this._task.stringId].fields); const transitionId = this.taskFieldsIndex[taskId].transitionId; if (!!transitionId && transitionId !== '' && updatedField.behavior[transitionId]) @@ -303,19 +303,9 @@ export abstract class TaskContentService implements OnDestroy { && !!this.taskFieldsIndex[taskId].fields[changedField] } - protected getReferencedTaskId(changedField: string): string { + protected getReferencedTaskId(changedField: string, chFields: ChangedFields): string { return !!this.taskFieldsIndex ? - Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField)) : undefined; - } - - protected getReferencedTransitionId(changedField: string): string { - if (!!this.taskFieldsIndex) { - const taskFieldsIndexId = this.getReferencedTaskId(changedField); - if (!!this.taskFieldsIndex[taskFieldsIndexId]) { - return this.taskFieldsIndex[taskFieldsIndexId].transitionId; - } - } - return undefined; + Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && taskId === chFields.taskId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField)) : undefined; } protected findTaskRefId(taskId: string, fields: { [fieldId: string]: DataField}): DataField { diff --git a/projects/netgrif-components/src/lib/data-fields/i18n-field/i18n-divider-field/i18n-divider-field.component.html b/projects/netgrif-components/src/lib/data-fields/i18n-field/i18n-divider-field/i18n-divider-field.component.html index bedc8eefa..99b9cb7a2 100644 --- a/projects/netgrif-components/src/lib/data-fields/i18n-field/i18n-divider-field/i18n-divider-field.component.html +++ b/projects/netgrif-components/src/lib/data-fields/i18n-field/i18n-divider-field/i18n-divider-field.component.html @@ -1,5 +1,5 @@
-