Skip to content

Commit

Permalink
changed the default value for buildQuery to null (apache-superset#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
conglei authored Nov 20, 2018
1 parent f73f38a commit c87e6ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/superset-ui-chart/src/models/ChartPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/superset-ui-chart/test/models/ChartPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit c87e6ac

Please sign in to comment.