Skip to content

Commit

Permalink
Merge pull request #248 from netgrif/NAE-2013
Browse files Browse the repository at this point in the history
[NAE-2013] Autocomplete options are set to the first dropdown
  • Loading branch information
machacjozef authored Oct 29, 2024
2 parents bc426be + aa32f71 commit 8140774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand All @@ -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])
Expand Down Expand Up @@ -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<any>}): DataField<any> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div fxFlex fxLayout="row" fxLayoutAlign="center center">
<div fxFlex="20" class="divider-line"
<div *ngIf='!!dataField.value?.defaultValue && dataField.value?.defaultValue.length > 0' fxFlex="20" class="divider-line"
[ngClass]="{'divider-line-lgbt': isDividerLGBTQ(), 'primary-background-color': !checkPropertyInComponent('dividerColor')}"
[ngStyle]="checkPropertyInComponent('dividerColor') && {'background': getDividerColor()}"></div>
<span *ngIf='!!dataField.value' [ngClass]="{'margin-default': dataField.value?.defaultValue !== ''}"
Expand Down

0 comments on commit 8140774

Please sign in to comment.