From dd8d1c58692f41dd3924baadf2d4bb23aeaccbdc Mon Sep 17 00:00:00 2001 From: Sovas Tiwari <40485930+subashtiwari1010@users.noreply.github.com> Date: Tue, 3 Mar 2026 21:09:27 +0545 Subject: [PATCH] Add loading state in select for link existing dashboard (#12033) (cherry picked from commit 9f698465b7724c4484d99aaccf11bec8c9f6f741) --- .../components/dashboard/ConfigureView.jsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/web/client/components/dashboard/ConfigureView.jsx b/web/client/components/dashboard/ConfigureView.jsx index 06647a99b0..ca0af68430 100644 --- a/web/client/components/dashboard/ConfigureView.jsx +++ b/web/client/components/dashboard/ConfigureView.jsx @@ -18,18 +18,24 @@ const GlyphiconIndicator = withTooltip(Glyphicon); const ConfigureView = ({ active, onToggle, data, onSave, user, configureViewOptions }) => { const [setting, setSetting] = useState(data); const [dashboardOptions, setDashboardOptions] = useState([]); + const [loadingDashboards, setLoadingDashboards] = useState(false); useEffect(() => { if (!active || !user) return; const args = createCatalogResourcesArgs({configureViewOptions, user}); const catalogResources = getCatalogResources(...args).toPromise(); - catalogResources.then(res => { - const options = res.resources.map(d => ({ - value: d.id || d.pk, - label: d.name - })); - setDashboardOptions(options); - }); + setLoadingDashboards(true); + catalogResources + .then(res => { + const options = res.resources.map(d => ({ + value: d.id || d.pk, + label: d.name + })); + setDashboardOptions(options); + }) + .finally(() => { + setLoadingDashboards(false); + }); }, [active, user]); const canAddLayout = !data.dashboard @@ -99,6 +105,7 @@ const ConfigureView = ({ active, onToggle, data, onSave, user, configureViewOpti value={setting.dashboard || ''} options={dashboardOptions} name="dashboard" + isLoading={loadingDashboards} onChange={selected => setSetting(prev => ({...prev, dashboard: selected?.value }))} />