rusackas commented on code in PR #44154:
URL: https://github.com/apache/superset/pull/44154#discussion_r3986253757
##########
superset-frontend/src/utils/downloadAsPdf.ts:
##########
@@ -43,22 +42,27 @@ const generateFileStem = (description: string, date = new
Date()) =>
* @param description name or a short description of what is being printed.
* Value will be normalized, and a date as well as a file extension will be
added.
* @param isExactSelector if false, searches for the closest ancestor that
matches selector.
+ * @param addWarningToast bound via `useToasts()`/`bindActionCreators`, not
the raw
+ * action creator from `actions.ts`: this module has no dispatch of its own,
so an
+ * unbound creator would only build a Redux action object and never render a
toast.
* @returns event handler
*/
export default function downloadAsPdf(
selector: string,
description: string,
isExactSelector = false,
+ addWarningToast?: (message: string) => void,
Review Comment:
Fixed — the catch in `downloadAsPdf` now calls `addWarningToast` too,
matching the image export path.
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -333,6 +334,8 @@ const SliceHeaderControls = (
props.slice.slice_name,
true,
theme,
+ undefined,
+ props.addWarningToast,
Review Comment:
Fixed — updated the `toHaveBeenCalledWith` assertions in
`SliceHeaderControls.test.tsx` for the new args.
--
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]