diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/src/models/ChartPlugin.js b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/src/models/ChartPlugin.js index 1788b69da130d..44084ebede5dc 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/src/models/ChartPlugin.js +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/src/models/ChartPlugin.js @@ -11,7 +11,7 @@ export default class ChartPlugin extends Plugin { metadata = isRequired('metadata'), // use buildQuery for immediate value - buildQuery = IDENTITY, + buildQuery, // use loadBuildQuery for dynamic import (lazy-loading) loadBuildQuery, @@ -27,7 +27,7 @@ export default class ChartPlugin extends Plugin { } = {}) { super(); this.metadata = metadata; - this.loadBuildQuery = loadBuildQuery || (() => buildQuery); + this.loadBuildQuery = loadBuildQuery || (buildQuery ? () => buildQuery : null); this.loadTransformProps = loadTransformProps || (() => transformProps); if (loadChart) { diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/test/models/ChartPlugin.test.js b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/test/models/ChartPlugin.test.js index a1bc166563fbd..33b27bc0fb83c 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/test/models/ChartPlugin.test.js +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart/test/models/ChartPlugin.test.js @@ -26,7 +26,7 @@ describe('ChartPlugin', () => { metadata, Chart: 'test', }); - expect(plugin.loadBuildQuery()(FORM_DATA)).toBe(FORM_DATA); + expect(plugin.loadBuildQuery).toBeNull(); }); it('uses loadBuildQuery field if specified', () => { const plugin = new ChartPlugin({