From 48c881f5c3a51441a2800f43404185ff0ae8d83e Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Fri, 8 Feb 2019 17:24:36 -0800 Subject: [PATCH] update generator and bump build config version --- .../temporary_superset_ui/superset-ui/package.json | 2 +- .../generators/legacy-plugin-chart-demo/index.js | 1 + .../legacy-plugin-chart-demo/templates/Stories.jsx | 9 ++++----- .../legacy-plugin-chart-demo/templates/data.js | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/data.js diff --git a/superset-frontend/temporary_superset_ui/superset-ui/package.json b/superset-frontend/temporary_superset_ui/superset-ui/package.json index 15afdec3f5..b41ca4b050 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/package.json @@ -38,7 +38,7 @@ ], "license": "Apache-2.0", "devDependencies": { - "@data-ui/build-config": "^0.0.39", + "@data-ui/build-config": "^0.0.40", "fast-glob": "^2.2.6", "fs-extra": "^7.0.1", "husky": "^1.1.2", diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/index.js b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/index.js index d730dcb3d3..fbaa76954f 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/index.js +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/index.js @@ -30,6 +30,7 @@ module.exports = class extends Generator { writing() { this.fs.copyTpl(this.templatePath('index.js'), this.destinationPath('index.js'), this.answers); + this.fs.copyTpl(this.templatePath('data.js'), this.destinationPath('data.js'), this.answers); this.fs.copyTpl( this.templatePath('Stories.jsx'), this.destinationPath('Stories.jsx'), diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/Stories.jsx b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/Stories.jsx index 681bc7d081..c3e24997c5 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/Stories.jsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/Stories.jsx @@ -1,6 +1,7 @@ /* eslint-disable no-magic-numbers */ import React from 'react'; import { SuperChart } from '@superset-ui/chart'; +import data from './data'; export default [ { @@ -10,14 +11,12 @@ export default [ chartProps={{ formData: {}, height: 400, - payload: { - data: [], - }, + payload: { data }, width: 400, }} /> ), - storyName: '<%= packageLabel %>ChartPlugin', - storyPath: 'plugin-chart-<%= packageName %>', + storyName: 'Basic', + storyPath: 'plugin-chart-<%= packageName %>|<%= packageLabel %>ChartPlugin', }, ]; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/data.js b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/data.js new file mode 100644 index 0000000000..fb1252c9d8 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/legacy-plugin-chart-demo/templates/data.js @@ -0,0 +1,2 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default {};