Add Feature Flags support to storybook (#2994)

This commit is contained in:
Krzysztof Żuraw 2023-01-18 14:23:43 +01:00 committed by GitHub
parent 931467a73a
commit b88ee3c3b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 19 deletions

View file

@ -1,18 +0,0 @@
import Decorator from "@dashboard/storybook/Decorator";
import { storiesOf } from "@storybook/react";
import React from "react";
import AppActivateDialog, { AppActivateDialogProps } from "./AppActivateDialog";
const props: AppActivateDialogProps = {
confirmButtonState: "default",
name: "App",
onClose: () => undefined,
onConfirm: () => undefined,
open: true,
};
storiesOf("Views / Apps / Activate app", module)
.addDecorator(Decorator)
.add("default", () => <AppActivateDialog {...props} />)
.add("unnamed app", () => <AppActivateDialog {...props} name={null} />);

View file

@ -10,7 +10,7 @@ const props: AppListPageProps = {
installedApps: installedAppsList,
};
storiesOf("Views / New Apps / App List", module)
storiesOf("Apps / New Apps / App List", module)
.addDecorator(Decorator)
.add("default", () => <AppListPage {...props} />)
.add("empty", () => (

View file

@ -2,6 +2,7 @@
const path = require("path");
const CheckerPlugin = require("fork-ts-checker-webpack-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const webpack = require("webpack");
module.exports = ({ config }) => {
config.module.rules.push({
@ -35,6 +36,10 @@ module.exports = ({ config }) => {
new CheckerPlugin({
eslint: true,
}),
new webpack.DefinePlugin({
FLAGS_SERVICE_ENABLED: false,
FLAGS: {},
}),
);
return config;
};