You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Vitor-Avila (via GitHub)" <gi...@apache.org> on 2025/08/01 15:10:29 UTC
Re: [PR] feat: Enable drilling in embedded [superset]
Vitor-Avila commented on code in PR #34319:
URL: https://github.com/apache/superset/pull/34319#discussion_r2248225243
##########
superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx:
##########
@@ -151,56 +123,6 @@ export const DrillByMenuItems = ({
[formData.viz_type],
);
- useEffect(() => {
- async function loadOptions() {
- const datasetId = Number(formData.datasource.split('__')[0]);
- try {
- setIsLoadingColumns(true);
- let response: JsonResponse;
- if (loadDrillByOptions) {
- response = await loadDrillByOptions(datasetId, formData);
- } else {
- response = await cachedSupersetGet({
- endpoint: `/api/v1/dataset/${datasetId}?q=${queryString}`,
- });
- }
- const { json } = response;
- const { result } = json;
- setDataset(result);
- setColumns(
- ensureIsArray(result.columns)
- .filter(column => column.groupby)
- .filter(
- column =>
- !ensureIsArray(
- formData[drillByConfig?.groupbyFieldName ?? ''],
- ).includes(column.column_name) &&
- column.column_name !== formData.x_axis &&
- ensureIsArray(excludedColumns)?.every(
- excludedCol => excludedCol.column_name !== column.column_name,
- ),
- ),
- );
- } catch (error) {
- logging.error(error);
- supersetGetCache.delete(`/api/v1/dataset/${datasetId}`);
- addDangerToast(t('Failed to load dimensions for drill by'));
- } finally {
- setIsLoadingColumns(false);
- }
- }
- if (handlesDimensionContextMenu && hasDrillBy) {
- loadOptions();
- }
- }, [
- addDangerToast,
- drillByConfig?.groupbyFieldName,
- excludedColumns,
- formData,
- handlesDimensionContextMenu,
- hasDrillBy,
- ]);
-
Review Comment:
Logic moved to `ChartContextMenu`
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org