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 AAfghahi committed Mar 22, 2022
1 parent df0a863 commit 677b8f3
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 @@ -56,6 +56,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 @@ -74,7 +74,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 @@ -28,11 +28,7 @@ import {
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 'src/dashboard/util/propShapes';
import EditableTitle from 'src/components/EditableTitle';
Expand Down Expand Up @@ -318,7 +314,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 @@ -78,22 +78,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 677b8f3

Please sign in to comment.