This is an automated email from the ASF dual-hosted git repository.

hainenber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new f820f9a976 chore(build): remove Lodash filter and noop usage in 
`superset-frontend` (#32341)
f820f9a976 is described below

commit f820f9a976674590921fccb9a2ada5f94e862bbb
Author: Đỗ Trọng Hải <[email protected]>
AuthorDate: Fri Feb 21 19:29:07 2025 +0700

    chore(build): remove Lodash filter and noop usage in `superset-frontend` 
(#32341)
    
    Signed-off-by: hainenber <[email protected]>
---
 .../legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx | 3 +--
 .../plugins/plugin-chart-echarts/src/utils/eventHandlers.ts         | 3 +--
 superset-frontend/src/features/home/ChartTable.tsx                  | 3 +--
 superset-frontend/src/features/home/DashboardTable.tsx              | 6 +-----
 4 files changed, 4 insertions(+), 11 deletions(-)

diff --git 
a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx
 
b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx
index d0153688b5..14d3f20688 100644
--- 
a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx
+++ 
b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx
@@ -23,7 +23,6 @@
 import { memo, useCallback, useEffect, useRef, useState } from 'react';
 import { ScreenGridLayer } from '@deck.gl/aggregation-layers';
 import { JsonObject, JsonValue, QueryFormData, t } from '@superset-ui/core';
-import { noop } from 'lodash';
 import sandboxedEval from '../../utils/sandbox';
 import { commonLayerProps } from '../common';
 import TooltipRow from '../../TooltipRow';
@@ -135,7 +134,7 @@ const DeckGLScreenGrid = (props: DeckGLScreenGridProps) => {
   }, []);
 
   const getLayers = useCallback(() => {
-    const layer = getLayer(props.formData, props.payload, noop, setTooltip);
+    const layer = getLayer(props.formData, props.payload, () => {}, 
setTooltip);
 
     return [layer];
   }, [props.formData, props.payload, setTooltip]);
diff --git 
a/superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts 
b/superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts
index 9afa2fcdef..cd76f27c4d 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts
@@ -26,7 +26,6 @@ import {
   getNumberFormatter,
   getTimeFormatter,
 } from '@superset-ui/core';
-import { noop } from 'lodash';
 
 import {
   BaseTransformedProps,
@@ -166,7 +165,7 @@ export const allEventHandlers = (
             setDataMask,
             emitCrossFilters,
           )
-        : noop,
+        : () => {},
     contextmenu: contextMenuEventHandler(
       groupby,
       onContextMenu,
diff --git a/superset-frontend/src/features/home/ChartTable.tsx 
b/superset-frontend/src/features/home/ChartTable.tsx
index 30d1d41afa..e8026f0035 100644
--- a/superset-frontend/src/features/home/ChartTable.tsx
+++ b/superset-frontend/src/features/home/ChartTable.tsx
@@ -18,7 +18,6 @@
  */
 import { useEffect, useMemo, useState } from 'react';
 import { t } from '@superset-ui/core';
-import { filter } from 'lodash';
 import {
   useChartEditModal,
   useFavoriteStatus,
@@ -76,7 +75,7 @@ function ChartTable({
     TableTab.Other,
   );
 
-  const filteredOtherTabData = filter(otherTabData, obj => 'viz_type' in obj);
+  const filteredOtherTabData = otherTabData?.filter(obj => 'viz_type' in obj);
 
   const {
     state: { loading, resourceCollection: charts, bulkSelectEnabled },
diff --git a/superset-frontend/src/features/home/DashboardTable.tsx 
b/superset-frontend/src/features/home/DashboardTable.tsx
index 01b385138d..28cf137026 100644
--- a/superset-frontend/src/features/home/DashboardTable.tsx
+++ b/superset-frontend/src/features/home/DashboardTable.tsx
@@ -18,7 +18,6 @@
  */
 import { useEffect, useMemo, useState } from 'react';
 import { SupersetClient, t } from '@superset-ui/core';
-import { filter } from 'lodash';
 import { useFavoriteStatus, useListViewResource } from 'src/views/CRUD/hooks';
 import { Dashboard, DashboardTableProps, TableTab } from 
'src/views/CRUD/types';
 import handleResourceExport from 'src/utils/export';
@@ -61,10 +60,7 @@ function DashboardTable({
     TableTab.Other,
   );
 
-  const filteredOtherTabData = filter(
-    otherTabData,
-    obj => !('viz_type' in obj),
-  );
+  const filteredOtherTabData = otherTabData.filter(obj => !('viz_type' in 
obj));
 
   const {
     state: { loading, resourceCollection: dashboards },

Reply via email to