Copilot commented on code in PR #42296:
URL: https://github.com/apache/superset/pull/42296#discussion_r3627406668
##########
superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx:
##########
@@ -155,17 +156,29 @@ const ChartContextMenu = (
const [drillModalIsOpen, setDrillModalIsOpen] = useState(false);
const [drillByColumn, setDrillByColumn] = useState<Column>();
+ // Drill by config as selected in the submenu (e.g. with the chosen
+ // x-axis/series filter scope applied), used over the raw context filters
+ const [selectedDrillByConfig, setSelectedDrillByConfig] =
+ useState<ContextMenuFilters['drillBy']>();
const [showDrillByModal, setShowDrillByModal] = useState(false);
const closeContextMenu = useCallback(() => {
setVisible(false);
onClose();
}, [onClose]);
- const handleDrillBy = useCallback((column: Column) => {
- setDrillByColumn(column);
- setShowDrillByModal(true);
- }, []);
+ const handleDrillBy = useCallback(
+ (
+ column: Column,
+ dataset: Dataset,
+ drillByConfig?: ContextMenuFilters['drillBy'],
+ ) => {
+ setDrillByColumn(column);
+ setSelectedDrillByConfig(drillByConfig);
+ setShowDrillByModal(true);
+ },
+ [],
+ );
Review Comment:
`handleDrillBy` declares a `dataset` parameter but never uses it, which will
fail the repo's `@typescript-eslint/no-unused-vars` rule (only args prefixed
with `_` are ignored per `superset-frontend/oxlint.json`). Rename the parameter
to `_dataset` (or remove it) to satisfy linting.
--
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]