SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: first query variable without 'ALL' selection (#10417)
Ashwin Bhatkalff028e366b37
diff --git a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/DashboardVariableSelection.tsx b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/DashboardVariableSelection.tsxindex 1d471cb9da..a21c52227b 100644--- a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/DashboardVariableSelection.tsx+++ b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/DashboardVariableSelection.tsx@@ -9,6 +9,7 @@ import {import useVariablesFromUrl from 'hooks/dashboard/useVariablesFromUrl';import { useDashboard } from 'providers/Dashboard/Dashboard';import { initializeDefaultVariables } from 'providers/Dashboard/initializeDefaultVariables';+import { updateDashboardVariablesStore } from 'providers/Dashboard/store/dashboardVariables/dashboardVariablesStore';import {enqueueDescendantsOfVariable,enqueueFetchOfAllVariables,@@ -31,6 +32,9 @@ function DashboardVariableSelection(): JSX.Element | null {const { updateUrlVariable, getUrlVariables } = useVariablesFromUrl();const { dashboardVariables } = useDashboardVariables();+ const dashboardId = useDashboardVariablesSelector(+ (state) => state.dashboardId,+ );const sortedVariablesArray = useDashboardVariablesSelector((state) => state.sortedVariablesArray,);@@ -96,6 +100,28 @@ function DashboardVariableSelection(): JSX.Element | null {updateUrlVariable(name || id, value);}+ // Synchronously update the external store with the new variable value so that+ // child variables see the updated parent value when they refetch, rather than+ // waiting for setSelectedDashboard → useEffect → updateDashboardVariablesStore.+ const updatedVariables = { ...dashboardVariables };+ if (updatedVariables[id]) {+ updatedVariables[id] = {+ ...updatedVariables[id],+ selectedValue: value,+ allSelected,+ haveCustomValuesSelected,+ };+ }+ if (updatedVariables[name]) {+ updatedVariables[name] = {+ ...updatedVariables[name],+ selectedValue: value,+ allSelected,+ haveCustomValuesSelected,+ };+ }+ updateDashboardVariablesStore({ dashboardId, variables: updatedVariables });+setSelectedDashboard((prev) => {if (prev) {const oldVariables = { ...prev?.data.variables };@@ -130,10 +156,12 @@ function DashboardVariableSelection(): JSX.Element | null {return prev;});- // Cascade: enqueue query-type descendants for refetching+ // Cascade: enqueue query-type descendants for refetching.+ // Safe to call synchronously now that the store already has the updated value.enqueueDescendantsOfVariable(name);},[+ dashboardId,dashboardVariables,updateLocalStorageDashboardVariables,updateUrlVariable,diff --git a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/QueryVariableInput.tsx b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/QueryVariableInput.tsxindex c2e896d424..fd6a46897b 100644--- a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/QueryVariableInput.tsx+++ b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/QueryVariableInput.tsx@@ -5,7 +5,7 @@ import dashboardVariablesQuery from 'api/dashboard/variables/dashboardVariablesQimport { REACT_QUERY_KEY } from 'constants/reactQueryKeys';import { useVariableFetchState } from 'hooks/dashboard/useVariableFetchState';import sortValues from 'lib/dashboardVariables/sortVariableValues';-import { isArray, isEmpty, isString } from 'lodash-es';+import { isArray, isEmpty } from 'lodash-es';import { AppState } from 'store/reducers';import { VariableResponseProps } from 'types/api/dashboard/variables/query';import { GlobalReducer } from 'types/reducer/globalTime';@@ -54,7 +54,7 @@ function QueryVariableInput({onChange,onDropdownVisibleChange,handleClear,- applyDefaultIfNeeded,+ getDefaultValue,} = useDashboardVariableSelectHelper({variableData,optionsData,@@ -68,81 +68,93 @@ function QueryVariableInput({try {setErrorMessage(null);+ // This is just a check given the previously undefined typed name prop. Not significant+ // This will be changed when we change the schema+ // TODO: @AshwinBhatkal Perses+ if (!variableData.name) {+ return;+ }++ // if the response is not an array, premature returnif (- variablesRes?.variableValues &&- Array.isArray(variablesRes?.variableValues)+ !variablesRes?.variableValues ||+ !Array.isArray(variablesRes?.variableValues)) {- const newOptionsData = sortValues(- variablesRes?.variableValues,- variableData.sort,+ return;+ }++ const sortedNewOptions = sortValues(+ variablesRes.variableValues,+ variableData.sort,+ );+ const sortedOldOptions = sortValues(optionsData, variableData.sort);++ // if options are the same as before, no need to update state or check for selected value validity+ // ! selectedValue needs to be set in the first pass though, as options are initially empty array and we need to apply default if needed+ // Expecatation is that when oldOptions are not empty, then there is always some selectedValue+ if (areArraysEqual(sortedNewOptions, sortedOldOptions)) {+ return;+ }++ setOptionsData(sortedNewOptions);++ let isSelectedValueMissingInNewOptions = false;++ // Check if currently selected value(s) are present in the new options list+ if (isArray(variableData.selectedValue)) {+ isSelectedValueMissingInNewOptions = variableData.selectedValue.some(+ (val) => !sortedNewOptions.includes(val),);+ } else if (+ variableData.selectedValue &&+ !sortedNewOptions.includes(variableData.selectedValue)+ ) {+ isSelectedValueMissingInNewOptions = true;+ }- const oldOptionsData = sortValues(optionsData, variableData.sort) as never;-- if (!areArraysEqual(newOptionsData, oldOptionsData)) {- let valueNotInList = false;-- if (isArray(variableData.selectedValue)) {- variableData.selectedValue.forEach((val) => {- if (!newOptionsData.includes(val)) {- valueNotInList = true;- }- });- } else if (- isString(variableData.selectedValue) &&- !newOptionsData.includes(variableData.selectedValue)- ) {- valueNotInList = true;- }-- if (variableData.name && (valueNotInList || variableData.allSelected)) {- if (- variableData.allSelected &&- variableData.multiSelect &&- variableData.showALLOption- ) {- if (- variableData.name &&- variableData.id &&- !isEmpty(variableData.selectedValue)- ) {- onValueUpdate(- variableData.name,- variableData.id,- newOptionsData,- true,- );- }-- // Update tempSelection to maintain ALL state when dropdown is open- if (tempSelection !== undefined) {- setTempSelection(newOptionsData.map((option) => option.toString()));- }- } else {- const value = variableData.selectedValue;- let allSelected = false;-- if (variableData.multiSelect) {- const { selectedValue } = variableData;- allSelected =- newOptionsData.length > 0 &&- Array.isArray(selectedValue) &&- newOptionsData.every((option) => selectedValue.includes(option));- }-- if (- variableData.name &&- variableData.id &&- !isEmpty(variableData.selectedValue)- ) {- onValueUpdate(variableData.name, variableData.id, value, allSelected);- }- }- }-- setOptionsData(newOptionsData);- // Apply default if no value is selected (e.g., new variable, first load)- applyDefaultIfNeeded(newOptionsData);+ // If multi-select with ALL option enabled, and ALL is currently selected, we want to maintain that state and select all new options+ // This block does not depend on selected value because of ALL and also because we would only come here if options are different from the previous+ if (+ variableData.multiSelect &&+ variableData.showALLOption &&+ variableData.allSelected &&+ isSelectedValueMissingInNewOptions+ ) {+ onValueUpdate(variableData.name, variableData.id, sortedNewOptions, true);++ // Update tempSelection to maintain ALL state when dropdown is open+ if (tempSelection !== undefined) {+ setTempSelection(sortedNewOptions.map((option) => option.toString()));+ }+ return;+ }++ const value = variableData.selectedValue;+ let allSelected = false;++ if (variableData.multiSelect) {+ const { selectedValue } = variableData;+ allSelected =+ sortedNewOptions.length > 0 &&+ Array.isArray(selectedValue) &&+ sortedNewOptions.every((option) => selectedValue.includes(option));+ }++ if (+ variableData.name &&+ variableData.id &&+ !isEmpty(variableData.selectedValue)+ ) {+ onValueUpdate(variableData.name, variableData.id, value, allSelected);+ } else {+ const defaultValue = getDefaultValue(sortedNewOptions);+ if (defaultValue !== undefined) {+ onValueUpdate(+ variableData.name,+ variableData.id,+ defaultValue,+ allSelected,+ );}}} catch (e) {@@ -155,7 +167,7 @@ function QueryVariableInput({onValueUpdate,tempSelection,setTempSelection,- applyDefaultIfNeeded,+ getDefaultValue,],);diff --git a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/DashboardVariableSelection.test.tsx b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/DashboardVariableSelection.test.tsxindex fb6b3b1273..b95c2cc3fb 100644--- a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/DashboardVariableSelection.test.tsx+++ b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/DashboardVariableSelection.test.tsx@@ -1,5 +1,6 @@/* eslint-disable sonarjs/no-duplicate-string */import { act, render } from '@testing-library/react';+import * as dashboardVariablesStoreModule from 'providers/Dashboard/store/dashboardVariables/dashboardVariablesStore';import {dashboardVariablesStore,setDashboardVariablesStore,@@ -10,6 +11,7 @@ import {IDashboardVariablesStoreState,} from 'providers/Dashboard/store/dashboardVariables/dashboardVariablesStoreTypes';import {+ enqueueDescendantsOfVariable,enqueueFetchOfAllVariables,initializeVariableFetchStore,} from 'providers/Dashboard/store/variableFetchStore';@@ -17,6 +19,17 @@ import { IDashboardVariable } from 'types/api/dashboard/getAll';import DashboardVariableSelection from '../DashboardVariableSelection';+// Mutable container to capture the onValueUpdate callback from VariableItem+const mockVariableItemCallbacks: {+ onValueUpdate?: (+ name: string,+ id: string,+ value: IDashboardVariable['selectedValue'],+ allSelected: boolean,+ haveCustomValuesSelected?: boolean,+ ) => void;+} = {};+// Mock providers/Dashboard/Dashboardconst mockSetSelectedDashboard = jest.fn();const mockUpdateLocalStorageDashboardVariables = jest.fn();@@ -56,10 +69,14 @@ jest.mock('react-redux', () => ({useSelector: jest.fn().mockReturnValue({ minTime: 1000, maxTime: 2000 }),}));-// Mock VariableItem to avoid rendering complexity+// VariableItem mock captures the onValueUpdate prop for use in onValueUpdate testsjest.mock('../VariableItem', () => ({__esModule: true,- default: (): JSX.Element => <div data-testid="variable-item" />,+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ default: (props: any): JSX.Element => {+ mockVariableItemCallbacks.onValueUpdate = props.onValueUpdate;+ return <div data-testid="variable-item" />;+ },}));function createVariable(@@ -200,4 +217,162 @@ describe('DashboardVariableSelection', () => {expect(initializeVariableFetchStore).not.toHaveBeenCalled();expect(enqueueFetchOfAllVariables).not.toHaveBeenCalled();});++ describe('onValueUpdate', () => {+ let updateStoreSpy: jest.SpyInstance;++ beforeEach(() => {+ resetStore();+ jest.clearAllMocks();+ // Real implementation pass-through — we just want to observe calls+ updateStoreSpy = jest.spyOn(+ dashboardVariablesStoreModule,+ 'updateDashboardVariablesStore',+ );+ });++ afterEach(() => {+ updateStoreSpy.mockRestore();+ });++ it('updates dashboardVariablesStore synchronously before enqueueDescendantsOfVariable', () => {+ setDashboardVariablesStore({+ dashboardId: 'dash-1',+ variables: {+ env: createVariable({ name: 'env', id: 'env-id', order: 0 }),+ },+ });++ render(<DashboardVariableSelection />);++ const callOrder: string[] = [];+ updateStoreSpy.mockImplementation(() => {+ callOrder.push('updateDashboardVariablesStore');+ });+ (enqueueDescendantsOfVariable as jest.Mock).mockImplementation(() => {+ callOrder.push('enqueueDescendantsOfVariable');+ });++ act(() => {+ mockVariableItemCallbacks.onValueUpdate?.(+ 'env',+ 'env-id',+ 'production',+ false,+ );+ });++ expect(callOrder).toEqual([+ 'updateDashboardVariablesStore',+ 'enqueueDescendantsOfVariable',+ ]);+ });++ it('passes updated variable value to dashboardVariablesStore', () => {+ setDashboardVariablesStore({+ dashboardId: 'dash-1',+ variables: {+ env: createVariable({+ name: 'env',+ id: 'env-id',+ order: 0,+ selectedValue: 'staging',+ }),+ },+ });++ render(<DashboardVariableSelection />);++ // Clear spy calls that happened during setup/render+ updateStoreSpy.mockClear();++ act(() => {+ mockVariableItemCallbacks.onValueUpdate?.(+ 'env',+ 'env-id',+ 'production',+ false,+ );+ });++ expect(updateStoreSpy).toHaveBeenCalledWith(+ expect.objectContaining({+ dashboardId: 'dash-1',+ variables: expect.objectContaining({+ env: expect.objectContaining({+ selectedValue: 'production',+ allSelected: false,+ }),+ }),+ }),+ );+ });++ it('calls enqueueDescendantsOfVariable synchronously without a timer', () => {+ jest.useFakeTimers();++ setDashboardVariablesStore({+ dashboardId: 'dash-1',+ variables: {+ env: createVariable({ name: 'env', id: 'env-id', order: 0 }),+ },+ });++ render(<DashboardVariableSelection />);++ act(() => {+ mockVariableItemCallbacks.onValueUpdate?.(+ 'env',+ 'env-id',+ 'production',+ false,+ );+ });++ // Must be called immediately — no timer advancement needed+ expect(enqueueDescendantsOfVariable).toHaveBeenCalledWith('env');++ jest.useRealTimers();+ });++ it('propagates allSelected and haveCustomValuesSelected to the store', () => {+ setDashboardVariablesStore({+ dashboardId: 'dash-1',+ variables: {+ env: createVariable({+ name: 'env',+ id: 'env-id',+ order: 0,+ multiSelect: true,+ showALLOption: true,+ }),+ },+ });++ render(<DashboardVariableSelection />);+ updateStoreSpy.mockClear();++ act(() => {+ mockVariableItemCallbacks.onValueUpdate?.(+ 'env',+ 'env-id',+ ['production', 'staging'],+ true,+ false,+ );+ });++ expect(updateStoreSpy).toHaveBeenCalledWith(+ expect.objectContaining({+ variables: expect.objectContaining({+ env: expect.objectContaining({+ selectedValue: ['production', 'staging'],+ allSelected: true,+ haveCustomValuesSelected: false,+ }),+ }),+ }),+ );+ });+ });});diff --git a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/QueryVariableInput.test.tsx b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/QueryVariableInput.test.tsxnew file mode 100644index 0000000000..cae2ff62a1--- /dev/null+++ b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/__test__/QueryVariableInput.test.tsx@@ -0,0 +1,275 @@+/* eslint-disable sonarjs/no-duplicate-string */+import { QueryClient, QueryClientProvider } from 'react-query';+import { act, render, waitFor } from '@testing-library/react';+import dashboardVariablesQuery from 'api/dashboard/variables/dashboardVariablesQuery';+import { variableFetchStore } from 'providers/Dashboard/store/variableFetchStore';+import { IDashboardVariable } from 'types/api/dashboard/getAll';++import QueryVariableInput from '../QueryVariableInput';++jest.mock('api/dashboard/variables/dashboardVariablesQuery');++jest.mock('react-redux', () => ({+ ...jest.requireActual('react-redux'),+ useSelector: jest.fn().mockReturnValue({ minTime: 1000, maxTime: 2000 }),+}));++function createTestQueryClient(): QueryClient {+ return new QueryClient({+ defaultOptions: {+ queries: { retry: false, refetchOnWindowFocus: false },+ },+ });+}++function Wrapper({+ children,+ queryClient,+}: {+ children: React.ReactNode;+ queryClient: QueryClient;+}): JSX.Element {+ return (+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>+ );+}++function createVariable(+ overrides: Partial<IDashboardVariable> = {},+): IDashboardVariable {+ return {+ id: 'env-id',+ name: 'env',+ description: '',+ type: 'QUERY',+ sort: 'DISABLED',+ showALLOption: false,+ multiSelect: false,+ order: 0,+ queryValue: 'SELECT env FROM table',+ ...overrides,+ };+}++/** Put the named variable into 'loading' state so useQuery fires on mount */+function setVariableLoading(name: string): void {+ variableFetchStore.update((draft) => {+ draft.states[name] = 'loading';+ draft.cycleIds[name] = (draft.cycleIds[name] || 0) + 1;+ });+}++function resetFetchStore(): void {+ variableFetchStore.set(() => ({+ states: {},+ lastUpdated: {},+ cycleIds: {},+ }));+}++describe('QueryVariableInput - getOptions logic', () => {+ const mockOnValueUpdate = jest.fn();++ beforeEach(() => {+ jest.clearAllMocks();+ resetFetchStore();+ });++ afterEach(() => {+ resetFetchStore();+ });++ it('applies default value (first option) when selectedValue is empty on first load', async () => {+ (dashboardVariablesQuery as jest.Mock).mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: ['production', 'staging', 'dev'] },+ });++ const variable = createVariable({ selectedValue: undefined });+ setVariableLoading('env');++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ await waitFor(() => {+ expect(mockOnValueUpdate).toHaveBeenCalledWith(+ 'env',+ 'env-id',+ 'production', // first option by default+ false,+ );+ });+ });++ it('keeps existing selectedValue when it is present in new options', async () => {+ (dashboardVariablesQuery as jest.Mock).mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: ['production', 'staging'] },+ });++ const variable = createVariable({ selectedValue: 'staging' });+ setVariableLoading('env');++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ await waitFor(() => {+ expect(mockOnValueUpdate).toHaveBeenCalledWith(+ 'env',+ 'env-id',+ 'staging',+ false,+ );+ });+ });++ it('selects all new options when allSelected=true and value is missing from new options', async () => {+ (dashboardVariablesQuery as jest.Mock).mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: ['production', 'staging'] },+ });++ const variable = createVariable({+ selectedValue: ['old-env'],+ allSelected: true,+ multiSelect: true,+ showALLOption: true,+ });+ setVariableLoading('env');++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ await waitFor(() => {+ expect(mockOnValueUpdate).toHaveBeenCalledWith(+ 'env',+ 'env-id',+ ['production', 'staging'],+ true,+ );+ });+ });++ it('does not call onValueUpdate a second time when options have not changed', async () => {+ const mockQueryFn = jest.fn().mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: ['production', 'staging'] },+ });+ (dashboardVariablesQuery as jest.Mock).mockImplementation(mockQueryFn);++ const variable = createVariable({ selectedValue: 'production' });+ setVariableLoading('env');++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ // Wait for first fetch and onValueUpdate call+ await waitFor(() => {+ expect(mockOnValueUpdate).toHaveBeenCalledTimes(1);+ });++ mockOnValueUpdate.mockClear();++ // Trigger a second fetch cycle with the same API response+ act(() => {+ variableFetchStore.update((draft) => {+ draft.states['env'] = 'revalidating';+ draft.cycleIds['env'] = (draft.cycleIds['env'] || 0) + 1;+ });+ });++ // Wait for second query to fire+ await waitFor(() => {+ expect(mockQueryFn).toHaveBeenCalledTimes(2);+ });++ // Options are unchanged, so onValueUpdate must not fire again+ expect(mockOnValueUpdate).not.toHaveBeenCalled();+ });++ it('does not call onValueUpdate when API returns a non-array response', async () => {+ (dashboardVariablesQuery as jest.Mock).mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: null },+ });++ const variable = createVariable({ selectedValue: 'production' });+ setVariableLoading('env');++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ await waitFor(() => {+ expect(dashboardVariablesQuery).toHaveBeenCalled();+ });++ expect(mockOnValueUpdate).not.toHaveBeenCalled();+ });++ it('does not fire the query when variableData.name is empty', () => {+ (dashboardVariablesQuery as jest.Mock).mockResolvedValue({+ statusCode: 200,+ payload: { variableValues: ['production'] },+ });++ // Variable with no name — useVariableFetchState will be called with ''+ // and the query key will have an empty name, leaving it disabled+ const variable = createVariable({ name: '' });+ // Note: we do NOT put it in 'loading' state since name is empty+ // (no variableFetchStore entry for '' means isVariableFetching=false)++ const queryClient = createTestQueryClient();+ render(+ <Wrapper queryClient={queryClient}>+ <QueryVariableInput+ variableData={variable}+ existingVariables={{ 'env-id': variable }}+ onValueUpdate={mockOnValueUpdate}+ />+ </Wrapper>,+ );++ expect(dashboardVariablesQuery).not.toHaveBeenCalled();+ expect(mockOnValueUpdate).not.toHaveBeenCalled();+ });+});diff --git a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/useDashboardVariableSelectHelper.ts b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/useDashboardVariableSelectHelper.tsindex 832d42ac1a..aea9964238 100644--- a/frontend/src/container/DashboardContainer/DashboardVariablesSelection/useDashboardVariableSelectHelper.ts+++ b/frontend/src/container/DashboardContainer/DashboardVariablesSelection/useDashboardVariableSelectHelper.ts@@ -46,6 +46,9 @@ interface UseDashboardVariableSelectHelperReturn {applyDefaultIfNeeded: (overrideOptions?: (string | number | boolean)[],) => void;+ getDefaultValue: (+ overrideOptions?: (string | number | boolean)[],+ ) => string | string[] | undefined;}// eslint-disable-next-line sonarjs/cognitive-complexity@@ -248,5 +251,6 @@ export function useDashboardVariableSelectHelper({defaultValue,onChange,applyDefaultIfNeeded,+ getDefaultValue,};}