Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion static/app/views/dashboards/widgetCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useState} from 'react';
import {useContext, useState} from 'react';
import styled from '@emotion/styled';
import type {LegendComponentOption} from 'echarts';
import type {Location} from 'history';
Expand Down Expand Up @@ -40,6 +40,7 @@ import type WidgetLegendSelectionState from '../widgetLegendSelectionState';
import {BigNumberWidget} from '../widgets/bigNumberWidget/bigNumberWidget';
import type {Meta} from '../widgets/common/types';
import {WidgetFrame} from '../widgets/common/widgetFrame';
import {WidgetViewerContext} from '../widgetViewer/widgetViewerContext';

import {useDashboardsMEPContext} from './dashboardsMEPContext';
import WidgetCardChartContainer from './widgetCardChartContainer';
Expand Down Expand Up @@ -100,6 +101,7 @@ type Data = {

function WidgetCard(props: Props) {
const [data, setData] = useState<Data>();
const {setData: setWidgetViewerData} = useContext(WidgetViewerContext);

const onDataFetched = (newData: Data) => {
if (props.onDataFetched && newData.tableResults) {
Expand Down Expand Up @@ -174,6 +176,14 @@ function WidgetCard(props: Props) {

const onFullScreenViewClick = () => {
if (!isWidgetViewerPath(location.pathname)) {
setWidgetViewerData({
pageLinks: data?.pageLinks,
seriesData: data?.timeseriesResults,
tableData: data?.tableResults,
seriesResultsType: data?.timeseriesResultsTypes,
totalIssuesCount: data?.totalIssuesCount,
});

props.router.push({
pathname: `${location.pathname}${
location.pathname.endsWith('/') ? '' : '/'
Expand Down
Loading