fix(screenshots): dashboard screenshots do not capture filter state (#29989)

This commit is contained in:
Jack 2024-08-23 11:23:44 -05:00 committed by GitHub
parent cb23d6f1a8
commit 7db34b994e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -44,9 +44,19 @@ export default function DownloadScreenshot({
logEvent?: Function; logEvent?: Function;
format: string; format: string;
}) { }) {
const anchor = useSelector( const activeTabs = useSelector(
(state: RootState) => last(state.dashboardState.activeTabs) || undefined, (state: RootState) => state.dashboardState.activeTabs || undefined,
); );
const anchor = useSelector(
(state: RootState) =>
last(state.dashboardState.directPathToChild) || undefined,
);
const dataMask = useSelector(
(state: RootState) => state.dataMask || undefined,
);
const { addDangerToast, addSuccessToast, addInfoToast } = useToasts(); const { addDangerToast, addSuccessToast, addInfoToast } = useToasts();
const onDownloadScreenshot = () => { const onDownloadScreenshot = () => {
@ -106,6 +116,8 @@ export default function DownloadScreenshot({
endpoint: `/api/v1/dashboard/${dashboardId}/cache_dashboard_screenshot`, endpoint: `/api/v1/dashboard/${dashboardId}/cache_dashboard_screenshot`,
jsonPayload: { jsonPayload: {
anchor, anchor,
activeTabs,
dataMask,
}, },
}) })
.then(({ json }) => { .then(({ json }) => {