From e159d25fdd7a27ed40f463d9c0b45961b7eb3579 Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Tue, 19 Aug 2025 17:43:15 +0200 Subject: [PATCH] Dashboard List: Fix how link query part is created when variables are included (#109861) Fix how link query part is created --- .../app/plugins/panel/dashlist/DashList.tsx | 37 ++----------------- .../app/plugins/panel/dashlist/utils.test.ts | 32 ++++++++++++++++ public/app/plugins/panel/dashlist/utils.ts | 24 ++++++++++++ 3 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 public/app/plugins/panel/dashlist/utils.test.ts create mode 100644 public/app/plugins/panel/dashlist/utils.ts diff --git a/public/app/plugins/panel/dashlist/DashList.tsx b/public/app/plugins/panel/dashlist/DashList.tsx index d5c13d5627a..e82d29a6560 100644 --- a/public/app/plugins/panel/dashlist/DashList.tsx +++ b/public/app/plugins/panel/dashlist/DashList.tsx @@ -2,31 +2,21 @@ import { take } from 'lodash'; import { SyntheticEvent, useEffect, useMemo, useState } from 'react'; import { useThrottle } from 'react-use'; -import { - DataLinkBuiltInVars, - DateTime, - InterpolateFunction, - PanelProps, - textUtil, - UrlQueryValue, - urlUtil, -} from '@grafana/data'; +import { InterpolateFunction, PanelProps, textUtil } from '@grafana/data'; import { useStyles2, IconButton, ScrollContainer } from '@grafana/ui'; import { updateNavIndex } from 'app/core/actions'; import { getConfig } from 'app/core/config'; -import { appEvents } from 'app/core/core'; -import { useBusEvent } from 'app/core/hooks/useBusEvent'; import { ID_PREFIX, setStarred } from 'app/core/reducers/navBarTree'; import { removeNavIndex } from 'app/core/reducers/navModel'; import { getBackendSrv } from 'app/core/services/backend_srv'; import impressionSrv from 'app/core/services/impression_srv'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { DashboardSearchItem } from 'app/features/search/types'; -import { VariablesChanged } from 'app/features/variables/types'; import { useDispatch, useSelector } from 'app/types/store'; import { Options } from './panelcfg.gen'; import { getStyles } from './styles'; +import { useDashListUrlParams } from './utils'; type Dashboard = DashboardSearchItem & { id?: number; isSearchResult?: boolean; isRecent?: boolean }; @@ -179,9 +169,7 @@ export function DashList(props: PanelProps) { const renderList = (dashboards: Dashboard[]) => (