You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2024/01/03 16:32:45 UTC
(superset) 01/02: fix: Duplicated plugin registration (#26379)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit d681a2784db2dc3f0c6df9a08d8c7be37c78390b
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Dec 29 15:58:26 2023 -0300
fix: Duplicated plugin registration (#26379)
(cherry picked from commit 29633e7d8cad7b52669a9e6f5e064cd34da803a3)
---
.../src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx | 5 +++++
superset-frontend/src/dashboard/containers/DashboardPage.tsx | 2 --
superset-frontend/src/pages/ChartList/index.tsx | 2 --
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx
index 8a0f8dbfc5..b57f061a3e 100644
--- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx
@@ -19,6 +19,7 @@
import React from 'react';
import userEvent from '@testing-library/user-event';
import { render, screen, within } from 'spec/helpers/testing-library';
+import setupPlugins from 'src/setup/setupPlugins';
import { getMockStoreWithNativeFilters } from 'spec/fixtures/mockStore';
import chartQueries, { sliceId } from 'spec/fixtures/mockChartQueries';
import { BinaryQueryObjectFilterClause } from '@superset-ui/core';
@@ -241,6 +242,10 @@ const expectDrillToDetailByAll = async (
await expectDrillToDetailModal(menuItemName, filters);
};
+beforeAll(() => {
+ setupPlugins();
+});
+
test('dropdown menu for unsupported chart', async () => {
renderMenu({ formData: unsupportedChartFormData });
await expectDrillToDetailEnabled();
diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx
index 7dd618850e..cf2098e547 100644
--- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx
+++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx
@@ -39,7 +39,6 @@ import {
import { hydrateDashboard } from 'src/dashboard/actions/hydrate';
import { setDatasources } from 'src/dashboard/actions/datasources';
import injectCustomCss from 'src/dashboard/util/injectCustomCss';
-import setupPlugins from 'src/setup/setupPlugins';
import { LocalStorageKeys, setItem } from 'src/utils/localStorageHelpers';
import { URL_PARAMS } from 'src/constants';
@@ -65,7 +64,6 @@ import SyncDashboardState, {
export const DashboardPageIdContext = React.createContext('');
-setupPlugins();
const DashboardBuilder = React.lazy(
() =>
import(
diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx
index e47f479811..9116b8b82e 100644
--- a/superset-frontend/src/pages/ChartList/index.tsx
+++ b/superset-frontend/src/pages/ChartList/index.tsx
@@ -64,7 +64,6 @@ import Tag from 'src/types/TagType';
import { Tooltip } from 'src/components/Tooltip';
import Icons from 'src/components/Icons';
import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils';
-import setupPlugins from 'src/setup/setupPlugins';
import InfoTooltip from 'src/components/InfoTooltip';
import CertifiedBadge from 'src/components/CertifiedBadge';
import { GenericLink } from 'src/components/GenericLink/GenericLink';
@@ -102,7 +101,6 @@ const CONFIRM_OVERWRITE_MESSAGE = t(
'sure you want to overwrite?',
);
-setupPlugins();
const registry = getChartMetadataRegistry();
const createFetchDatasets = async (