Skip to content

Commit

Permalink
Fetch bug fixed (#16376)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams authored and eschutho committed Oct 22, 2021
1 parent 85e14e2 commit 0f8cf4b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function HeaderReportActionsDropDown({
>(state => state.user || state.explore?.user);
const reportsIds = Object.keys(reports || []);
const report: AlertObject = reports?.[reportsIds[0]];
console.log(report);
const [
currentReportDeleting,
setCurrentReportDeleting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const createProps = () => ({
dashboardTitle: 'Dashboard Title',
charts: {},
layout: {},
reports: {},
expandedSlices: {},
css: '',
customCss: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const propTypes = {
onChange: PropTypes.func.isRequired,
fetchFaveStar: PropTypes.func.isRequired,
fetchCharts: PropTypes.func.isRequired,
fetchUISpecificReport: PropTypes.func.isRequired,
saveFaveStar: PropTypes.func.isRequired,
savePublished: PropTypes.func.isRequired,
updateDashboardTitle: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ import { bindActionCreators } from 'redux';
import PropTypes from 'prop-types';
import { styled, t } from '@superset-ui/core';
import { Tooltip } from 'src/components/Tooltip';
import {
fetchUISpecificReport,
toggleActive,
deleteActiveReport,
} from 'src/reports/actions/reports';
import { toggleActive, deleteActiveReport } from 'src/reports/actions/reports';
import HeaderReportActionsDropdown from 'src/components/ReportModal/HeaderReportActionsDropdown';
import { chartPropShape } from '../../dashboard/util/propShapes';
import ExploreActionButtons from './ExploreActionButtons';
Expand Down Expand Up @@ -243,7 +239,7 @@ ExploreChartHeader.propTypes = propTypes;

function mapDispatchToProps(dispatch) {
return bindActionCreators(
{ sliceUpdated, fetchUISpecificReport, toggleActive, deleteActiveReport },
{ sliceUpdated, toggleActive, deleteActiveReport },
dispatch,
);
}
Expand Down
24 changes: 12 additions & 12 deletions superset-frontend/src/reports/actions/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ const structureFetchAction = (dispatch, getState) => {
const { user, dashboardInfo, charts, explore } = state;
if (dashboardInfo) {
dispatch(
fetchUISpecificReport(
user.userId,
'dashboard_id',
'dashboards',
dashboardInfo.id,
),
fetchUISpecificReport({
userId: user.userId,
filterField: 'dashboard_id',
creationMethod: 'dashboards',
resourceId: dashboardInfo.id,
}),
);
} else {
const [chartArr] = Object.keys(charts);
dispatch(
fetchUISpecificReport(
explore.user.userId,
'chart_id',
'charts',
charts[chartArr].id,
),
fetchUISpecificReport({
userId: explore.user.userId,
filterField: 'chart_id',
creationMethod: 'charts',
resourceId: charts[chartArr].id,
}),
);
}
};
Expand Down

0 comments on commit 0f8cf4b

Please sign in to comment.