Browse Source

Fixed Datasource determination for autocomplete patterns if datasource is empty

pull/15392/head
Maksym Tsymbarov 6 months ago
committed by Vladyslav Prykhodko
parent
commit
9fed9c789f
  1. 6
      ui-ngx/src/app/modules/home/models/widget-component.models.ts

6
ui-ngx/src/app/modules/home/models/widget-component.models.ts

@ -68,7 +68,7 @@ import {
formatValue,
getEntityDetailsPageURL,
hasDatasourceLabelsVariables,
isDefined
isDefined, isDefinedAndNotNull
} from '@core/utils';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
@ -555,7 +555,9 @@ export class LabelVariablePattern {
const entityInfo = this.ctx.defaultSubscription.getFirstEntityInfo();
label = createLabelFromSubscriptionEntityInfo(entityInfo, label);
} else {
const datasource = this.ctx.defaultSubscription?.firstDatasource ?? (this.ctx as any).mapInstance?.getData()[0];
const datasource = isDefinedAndNotNull(this.ctx.defaultSubscription)
? this.ctx.defaultSubscription.firstDatasource ?? undefined
: (this.ctx as any).mapInstance?.getData()[0];
label = createLabelFromDatasource(datasource, label);
}
}

Loading…
Cancel
Save