fix(storybook): fix broken Storybook stories during development (#29587)

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
Đỗ Trọng Hải
2024-07-15 22:34:38 +07:00
committed by GitHub
parent fb15278f97
commit 462cda400b
6 changed files with 10 additions and 4 deletions

View File

@@ -55,7 +55,6 @@ export const parameters = {
};
// Superset setup
configure();
// Register color schemes

View File

@@ -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={{

View File

@@ -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;

View File

@@ -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',
};

View File

@@ -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
@@ -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