Skip to content

Commit

Permalink
fix(screenshots): dashboard screenshots do not capture filter state (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fisjac authored Aug 23, 2024
1 parent cb23d6f commit 7db34b9
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,19 @@ export default function DownloadScreenshot({
logEvent?: Function;
format: string;
}) {
const activeTabs = useSelector(
(state: RootState) => state.dashboardState.activeTabs || undefined,
);

const anchor = useSelector(
(state: RootState) => last(state.dashboardState.activeTabs) || undefined,
(state: RootState) =>
last(state.dashboardState.directPathToChild) || undefined,
);

const dataMask = useSelector(
(state: RootState) => state.dataMask || undefined,
);

const { addDangerToast, addSuccessToast, addInfoToast } = useToasts();

const onDownloadScreenshot = () => {
Expand Down Expand Up @@ -106,6 +116,8 @@ export default function DownloadScreenshot({
endpoint: `/api/v1/dashboard/${dashboardId}/cache_dashboard_screenshot`,
jsonPayload: {
anchor,
activeTabs,
dataMask,
},
})
.then(({ json }) => {
Expand Down

0 comments on commit 7db34b9

Please sign in to comment.