mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashboardScene: Use query options for relative time range calculation of the panel embed url (#79220)
This commit is contained in:
parent
31fb38723d
commit
9fb6cbf683
@ -7,6 +7,7 @@ import { ShareEmbed } from 'app/features/dashboard/components/ShareModal/ShareEm
|
||||
import { buildParams, shareDashboardType } from 'app/features/dashboard/components/ShareModal/utils';
|
||||
|
||||
import { DashboardScene } from '../scene/DashboardScene';
|
||||
import { PanelTimeRange } from '../scene/PanelTimeRange';
|
||||
import { getDashboardUrl } from '../utils/urlBuilders';
|
||||
import { getPanelIdForVizPanel } from '../utils/utils';
|
||||
|
||||
@ -39,12 +40,13 @@ function SharePanelEmbedTabRenderer({ model }: SceneComponentProps<SharePanelEmb
|
||||
const id = getPanelIdForVizPanel(p);
|
||||
const timeRangeState = sceneGraph.getTimeRange(p);
|
||||
|
||||
const timeFrom = timeRangeState instanceof PanelTimeRange ? timeRangeState.state.timeFrom : undefined;
|
||||
|
||||
return (
|
||||
<ShareEmbed
|
||||
panel={{
|
||||
id,
|
||||
timeFrom:
|
||||
typeof timeRangeState.state.value.raw.from === 'string' ? timeRangeState.state.value.raw.from : undefined,
|
||||
timeFrom,
|
||||
}}
|
||||
range={timeRangeState.state.value}
|
||||
dashboard={{ uid: dashUid ?? '', time: timeRangeState.state.value }}
|
||||
|
Loading…
Reference in New Issue
Block a user