Skip to content

Commit

Permalink
fix(storybook): fix broken Storybook stories during development (apac…
Browse files Browse the repository at this point in the history
…he#29587)

Signed-off-by: hainenber <dotronghai96@gmail.com>
  • Loading branch information
hainenber authored Jul 15, 2024
1 parent fb15278 commit 462cda4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const parameters = {
};

// Superset setup

configure();

// Register color schemes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import data from '../data';
export const basic = () => (
<SuperChart
chartType="box-plot"
width={400}
height={400}
width={800}
height={600}
datasource={dummyDatasource}
queriesData={[{ data }]}
formData={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export default function transformProps(chartProps) {
const data = Array.isArray(rawData)
? rawData.map(row => ({
...row,
values: row.values.map(value => ({ ...value })),
values: Array.isArray(row.values)
? row.values.map(value => ({ ...value }))
: row.values,
key: formatLabel(row.key, datasource.verboseMap),
}))
: rawData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
import { configure as configureTranslation } from '@superset-ui/core';
import CertifiedBadge, { CertifiedBadgeProps } from '.';

configureTranslation();

export default {
title: 'CertifiedBadgeWithTooltip',
};
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if (!isDevMode) {
const plugins = [
new webpack.ProvidePlugin({
process: 'process/browser.js',
...(isDevMode ? { Buffer: ['buffer', 'Buffer'] } : {}), // Fix legacy-plugin-chart-paired-t-test broken Story
}),

// creates a manifest.json mapping of name to hashed output used in template files
Expand Down Expand Up @@ -336,6 +337,7 @@ const config = {
fs: false,
vm: require.resolve('vm-browserify'),
path: false,
...(isDevMode ? { buffer: require.resolve('buffer/') } : {}), // Fix legacy-plugin-chart-paired-t-test broken Story
},
},
context: APP_DIR, // to automatically find tsconfig.json
Expand Down

0 comments on commit 462cda4

Please sign in to comment.