LevisNgigi commented on code in PR #33831:
URL: https://github.com/apache/superset/pull/33831#discussion_r2339892271
##########
superset-frontend/src/dashboard/actions/dashboardInfo.ts:
##########
@@ -142,43 +244,351 @@ export function saveFilterBarOrientation(orientation:
FilterBarOrientation) {
dispatch(onSave(lastModifiedTime));
}
} catch (errorObject) {
- const errorText = await getErrorText(errorObject, 'dashboard');
- dispatch(addDangerToast(errorText));
+ const { error } = await getClientErrorObject(errorObject);
+ dispatch(
+ addDangerToast(
+ t(
+ 'Sorry, there was an error saving this dashboard: %s',
+ error || 'Bad Request',
+ ),
+ ),
+ );
throw errorObject;
}
};
}
export function saveCrossFiltersSetting(crossFiltersEnabled: boolean) {
- return async (dispatch: Dispatch, getState: () => RootState) => {
+ return async function saveCrossFiltersSettingThunk(
+ dispatch: Dispatch,
+ getState: () => RootState,
+ ) {
const { id, metadata } = getState().dashboardInfo;
- const updateDashboard = makeApi<
- Partial<DashboardInfo>,
- { result: Partial<DashboardInfo>; last_modified_time: number }
- >({
- method: 'PUT',
- endpoint: `/api/v1/dashboard/${id}`,
- });
+ dispatch(setCrossFiltersEnabled(crossFiltersEnabled));
Review Comment:
added the rollback
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]