Merge pull request #2259 from github/koesie10/upgrade-storybook-7
Upgrade to Storybook 7
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import type { StorybookConfig } from "@storybook/core-common";
|
import type { StorybookConfig } from "@storybook/react-webpack5";
|
||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||||
@@ -8,13 +8,13 @@ const config: StorybookConfig = {
|
|||||||
"@storybook/addon-interactions",
|
"@storybook/addon-interactions",
|
||||||
"./vscode-theme-addon/preset.ts",
|
"./vscode-theme-addon/preset.ts",
|
||||||
],
|
],
|
||||||
framework: "@storybook/react",
|
framework: {
|
||||||
core: {
|
name: "@storybook/react-webpack5",
|
||||||
builder: "@storybook/builder-webpack5",
|
options: {},
|
||||||
},
|
},
|
||||||
features: {
|
docs: {
|
||||||
babelModeV7: true,
|
autodocs: "tag",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
export default config;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { addons } from "@storybook/addons";
|
import { addons } from "@storybook/manager-api";
|
||||||
import { themes } from "@storybook/theming";
|
import { themes } from "@storybook/theming";
|
||||||
|
|
||||||
addons.setConfig({
|
addons.setConfig({
|
||||||
|
|||||||
@@ -1,31 +1,36 @@
|
|||||||
|
import { Preview } from "@storybook/react";
|
||||||
import { themes } from "@storybook/theming";
|
import { themes } from "@storybook/theming";
|
||||||
import { action } from "@storybook/addon-actions";
|
import { action } from "@storybook/addon-actions";
|
||||||
|
|
||||||
// Allow all stories/components to use Codicons
|
// Allow all stories/components to use Codicons
|
||||||
import "@vscode/codicons/dist/codicon.css";
|
import "@vscode/codicons/dist/codicon.css";
|
||||||
|
|
||||||
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
|
|
||||||
export const parameters = {
|
|
||||||
// All props starting with `on` will automatically receive an action as a prop
|
|
||||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
||||||
// All props matching these names will automatically get the correct control
|
|
||||||
controls: {
|
|
||||||
matchers: {
|
|
||||||
color: /(background|color)$/i,
|
|
||||||
date: /Date$/,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// Use a dark theme to be aligned with VSCode
|
|
||||||
docs: {
|
|
||||||
theme: themes.dark,
|
|
||||||
},
|
|
||||||
backgrounds: {
|
|
||||||
// The background is injected by our theme CSS files
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
(window as any).acquireVsCodeApi = () => ({
|
(window as any).acquireVsCodeApi = () => ({
|
||||||
postMessage: action("post-vscode-message"),
|
postMessage: action("post-vscode-message"),
|
||||||
setState: action("set-vscode-state"),
|
setState: action("set-vscode-state"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
|
||||||
|
const preview: Preview = {
|
||||||
|
parameters: {
|
||||||
|
// All props starting with `on` will automatically receive an action as a prop
|
||||||
|
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||||
|
// All props matching these names will automatically get the correct control
|
||||||
|
controls: {
|
||||||
|
matchers: {
|
||||||
|
color: /(background|color)$/i,
|
||||||
|
date: /Date$/,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// Use a dark theme to be aligned with VSCode
|
||||||
|
docs: {
|
||||||
|
theme: themes.dark,
|
||||||
|
},
|
||||||
|
backgrounds: {
|
||||||
|
// The background is injected by our theme CSS files
|
||||||
|
disable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default preview;
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { FunctionComponent, useCallback } from "react";
|
import { FunctionComponent, useCallback } from "react";
|
||||||
|
|
||||||
import { useGlobals } from "@storybook/api";
|
import { useGlobals } from "@storybook/manager-api";
|
||||||
import {
|
import {
|
||||||
IconButton,
|
IconButton,
|
||||||
Icons,
|
Icons,
|
||||||
WithTooltip,
|
|
||||||
TooltipLinkList,
|
TooltipLinkList,
|
||||||
Link,
|
WithTooltip,
|
||||||
WithHideFn,
|
|
||||||
} from "@storybook/components";
|
} from "@storybook/components";
|
||||||
|
|
||||||
import { themeNames, VSCodeTheme } from "./theme";
|
import { themeNames, VSCodeTheme } from "./theme";
|
||||||
@@ -26,7 +24,7 @@ export const ThemeSelector: FunctionComponent = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const createLinks = useCallback(
|
const createLinks = useCallback(
|
||||||
(onHide: () => void): Link[] =>
|
(onHide: () => void) =>
|
||||||
Object.values(VSCodeTheme).map((theme) => ({
|
Object.values(VSCodeTheme).map((theme) => ({
|
||||||
id: theme,
|
id: theme,
|
||||||
onClick() {
|
onClick() {
|
||||||
@@ -44,8 +42,8 @@ export const ThemeSelector: FunctionComponent = () => {
|
|||||||
<WithTooltip
|
<WithTooltip
|
||||||
placement="top"
|
placement="top"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
closeOnClick
|
closeOnOutsideClick
|
||||||
tooltip={({ onHide }: WithHideFn) => (
|
tooltip={({ onHide }: { onHide: () => void }) => (
|
||||||
<TooltipLinkList links={createLinks(onHide)} />
|
<TooltipLinkList links={createLinks(onHide)} />
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { addons, types } from "@storybook/addons";
|
import { addons, types } from "@storybook/manager-api";
|
||||||
import { ThemeSelector } from "./ThemeSelector";
|
import { ThemeSelector } from "./ThemeSelector";
|
||||||
|
|
||||||
const ADDON_ID = "vscode-theme-addon";
|
const ADDON_ID = "vscode-theme-addon";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export function config(entry = []) {
|
export function previewAnnotations(entry = []) {
|
||||||
return [...entry, require.resolve("./preview.ts")];
|
return [...entry, require.resolve("./preview.ts")];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useEffect, useGlobals } from "@storybook/addons";
|
import { useEffect } from "react";
|
||||||
import type {
|
import type {
|
||||||
AnyFramework,
|
|
||||||
PartialStoryFn as StoryFunction,
|
PartialStoryFn as StoryFunction,
|
||||||
StoryContext,
|
StoryContext,
|
||||||
} from "@storybook/csf";
|
} from "@storybook/csf";
|
||||||
@@ -34,11 +33,8 @@ const themeFiles: { [key in VSCodeTheme]: string } = {
|
|||||||
.default,
|
.default,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const withTheme = (
|
export const withTheme = (StoryFn: StoryFunction, context: StoryContext) => {
|
||||||
StoryFn: StoryFunction<AnyFramework>,
|
const { vscodeTheme } = context.globals;
|
||||||
context: StoryContext<AnyFramework>,
|
|
||||||
) => {
|
|
||||||
const [{ vscodeTheme }] = useGlobals();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const styleSelectorId =
|
const styleSelectorId =
|
||||||
|
|||||||
45602
extensions/ql-vscode/package-lock.json
generated
45602
extensions/ql-vscode/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1733,8 +1733,8 @@
|
|||||||
"lint": "eslint . --ext .js,.ts,.tsx --max-warnings=0",
|
"lint": "eslint . --ext .js,.ts,.tsx --max-warnings=0",
|
||||||
"lint:markdown": "markdownlint-cli2 \"../../**/*.{md,mdx}\" \"!**/node_modules/**\" \"!**/.vscode-test/**\" \"!**/build/cli/v*/**\"",
|
"lint:markdown": "markdownlint-cli2 \"../../**/*.{md,mdx}\" \"!**/node_modules/**\" \"!**/.vscode-test/**\" \"!**/build/cli/v*/**\"",
|
||||||
"format-staged": "lint-staged",
|
"format-staged": "lint-staged",
|
||||||
"storybook": "start-storybook -p 6006",
|
"storybook": "storybook dev -p 6006",
|
||||||
"build-storybook": "build-storybook",
|
"build-storybook": "storybook build",
|
||||||
"lint:scenarios": "ts-node scripts/lint-scenarios.ts",
|
"lint:scenarios": "ts-node scripts/lint-scenarios.ts",
|
||||||
"check-types": "find . -type f -name \"tsconfig.json\" -not -path \"./node_modules/*\" | sed -r 's|/[^/]+$||' | sort | uniq | xargs -I {} sh -c \"echo Checking types in {} && cd {} && npx tsc --noEmit\"",
|
"check-types": "find . -type f -name \"tsconfig.json\" -not -path \"./node_modules/*\" | sed -r 's|/[^/]+$||' | sort | uniq | xargs -I {} sh -c \"echo Checking types in {} && cd {} && npx tsc --noEmit\"",
|
||||||
"postinstall": "patch-package",
|
"postinstall": "patch-package",
|
||||||
@@ -1786,17 +1786,22 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.18.13",
|
"@babel/core": "^7.18.13",
|
||||||
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
||||||
|
"@babel/preset-env": "^7.21.4",
|
||||||
|
"@babel/preset-react": "^7.18.6",
|
||||||
|
"@babel/preset-typescript": "^7.21.4",
|
||||||
"@faker-js/faker": "^8.0.2",
|
"@faker-js/faker": "^8.0.2",
|
||||||
"@github/markdownlint-github": "^0.3.0",
|
"@github/markdownlint-github": "^0.3.0",
|
||||||
"@octokit/plugin-throttling": "^5.0.1",
|
"@octokit/plugin-throttling": "^5.0.1",
|
||||||
"@storybook/addon-actions": "^6.5.17-alpha.0",
|
"@storybook/addon-actions": "^7.1.0",
|
||||||
"@storybook/addon-essentials": "^6.5.17-alpha.0",
|
"@storybook/addon-essentials": "^7.1.0",
|
||||||
"@storybook/addon-interactions": "^6.5.17-alpha.0",
|
"@storybook/addon-interactions": "^7.1.0",
|
||||||
"@storybook/addon-links": "^6.5.17-alpha.0",
|
"@storybook/addon-links": "^7.1.0",
|
||||||
"@storybook/builder-webpack5": "^6.5.17-alpha.0",
|
"@storybook/components": "^7.1.0",
|
||||||
"@storybook/manager-webpack5": "^6.5.17-alpha.0",
|
"@storybook/csf": "^0.1.1",
|
||||||
"@storybook/react": "^6.5.17-alpha.0",
|
"@storybook/manager-api": "^7.1.0",
|
||||||
"@storybook/testing-library": "^0.0.13",
|
"@storybook/react": "^7.1.0",
|
||||||
|
"@storybook/react-webpack5": "^7.1.0",
|
||||||
|
"@storybook/theming": "^7.1.0",
|
||||||
"@testing-library/dom": "^9.3.0",
|
"@testing-library/dom": "^9.3.0",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^14.0.0",
|
"@testing-library/react": "^14.0.0",
|
||||||
@@ -1837,6 +1842,7 @@
|
|||||||
"@vscode/vsce": "^2.19.0",
|
"@vscode/vsce": "^2.19.0",
|
||||||
"ansi-colors": "^4.1.1",
|
"ansi-colors": "^4.1.1",
|
||||||
"applicationinsights": "^2.3.5",
|
"applicationinsights": "^2.3.5",
|
||||||
|
"cosmiconfig": "^7.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "~6.8.1",
|
"css-loader": "~6.8.1",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
@@ -1868,6 +1874,7 @@
|
|||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"patch-package": "^7.0.0",
|
"patch-package": "^7.0.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
|
"storybook": "^7.1.0",
|
||||||
"tar-stream": "^3.0.0",
|
"tar-stream": "^3.0.0",
|
||||||
"through2": "^4.0.2",
|
"through2": "^4.0.2",
|
||||||
"ts-jest": "^29.0.1",
|
"ts-jest": "^29.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
|
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
@@ -16,9 +16,9 @@ export default {
|
|||||||
</VariantAnalysisContainer>
|
</VariantAnalysisContainer>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} as ComponentMeta<typeof Alert>;
|
} as Meta<typeof Alert>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof Alert> = (args) => <Alert {...args} />;
|
const Template: StoryFn<typeof Alert> = (args) => <Alert {...args} />;
|
||||||
|
|
||||||
export const Warning = Template.bind({});
|
export const Warning = Template.bind({});
|
||||||
Warning.args = {
|
Warning.args = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { CodePaths } from "../../view/common";
|
import { CodePaths } from "../../view/common";
|
||||||
import type { CodeFlow } from "../../variant-analysis/shared/analysis-result";
|
import type { CodeFlow } from "../../variant-analysis/shared/analysis-result";
|
||||||
@@ -9,11 +9,9 @@ export default {
|
|||||||
title: "Code Paths",
|
title: "Code Paths",
|
||||||
component: CodePaths,
|
component: CodePaths,
|
||||||
decorators: [(Story) => <Story />],
|
decorators: [(Story) => <Story />],
|
||||||
} as ComponentMeta<typeof CodePaths>;
|
} as Meta<typeof CodePaths>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof CodePaths> = (args) => (
|
const Template: StoryFn<typeof CodePaths> = (args) => <CodePaths {...args} />;
|
||||||
<CodePaths {...args} />
|
|
||||||
);
|
|
||||||
|
|
||||||
export const PowerShell = Template.bind({});
|
export const PowerShell = Template.bind({});
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { FileCodeSnippet } from "../../view/common";
|
import { FileCodeSnippet } from "../../view/common";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "File Code Snippet",
|
title: "File Code Snippet",
|
||||||
component: FileCodeSnippet,
|
component: FileCodeSnippet,
|
||||||
} as ComponentMeta<typeof FileCodeSnippet>;
|
} as Meta<typeof FileCodeSnippet>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof FileCodeSnippet> = (args) => (
|
const Template: StoryFn<typeof FileCodeSnippet> = (args) => (
|
||||||
<FileCodeSnippet {...args} />
|
<FileCodeSnippet {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { LastUpdated as LastUpdatedComponent } from "../../view/common/LastUpdated";
|
import { LastUpdated as LastUpdatedComponent } from "../../view/common/LastUpdated";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Last Updated",
|
title: "Last Updated",
|
||||||
component: LastUpdatedComponent,
|
component: LastUpdatedComponent,
|
||||||
} as ComponentMeta<typeof LastUpdatedComponent>;
|
} as Meta<typeof LastUpdatedComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof LastUpdatedComponent> = (args) => (
|
const Template: StoryFn<typeof LastUpdatedComponent> = (args) => (
|
||||||
<LastUpdatedComponent {...args} />
|
<LastUpdatedComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import StarCountComponent from "../../view/common/StarCount";
|
import StarCountComponent from "../../view/common/StarCount";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Star Count",
|
title: "Star Count",
|
||||||
component: StarCountComponent,
|
component: StarCountComponent,
|
||||||
} as ComponentMeta<typeof StarCountComponent>;
|
} as Meta<typeof StarCountComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof StarCountComponent> = (args) => (
|
const Template: StoryFn<typeof StarCountComponent> = (args) => (
|
||||||
<StarCountComponent {...args} />
|
<StarCountComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import TextButtonComponent from "../../view/common/TextButton";
|
import TextButtonComponent from "../../view/common/TextButton";
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof TextButtonComponent>;
|
} as Meta<typeof TextButtonComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof TextButtonComponent> = (args) => (
|
const Template: StoryFn<typeof TextButtonComponent> = (args) => (
|
||||||
<TextButtonComponent {...args} />
|
<TextButtonComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { CodePaths, Codicon as CodiconComponent } from "../../../view/common";
|
import { Codicon as CodiconComponent } from "../../../view/common";
|
||||||
|
|
||||||
// To regenerate the icons, use the following command from the `extensions/ql-vscode` directory:
|
// To regenerate the icons, use the following command from the `extensions/ql-vscode` directory:
|
||||||
// jq -R '[inputs | [splits(", *")] as $row | $row[0]]' < node_modules/@vscode/codicons/dist/codicon.csv > src/stories/common/icon/vscode-icons.json
|
// jq -R '[inputs | [splits(", *")] as $row | $row[0]]' < node_modules/@vscode/codicons/dist/codicon.csv > src/stories/common/icon/vscode-icons.json
|
||||||
@@ -17,9 +17,9 @@ export default {
|
|||||||
options: icons,
|
options: icons,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof CodePaths>;
|
} as Meta<typeof CodiconComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof CodiconComponent> = (args) => (
|
const Template: StoryFn<typeof CodiconComponent> = (args) => (
|
||||||
<CodiconComponent {...args} />
|
<CodiconComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CodePaths,
|
CodePaths,
|
||||||
@@ -10,9 +10,9 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "Icon/Error Icon",
|
title: "Icon/Error Icon",
|
||||||
component: ErrorIconComponent,
|
component: ErrorIconComponent,
|
||||||
} as ComponentMeta<typeof CodePaths>;
|
} as Meta<typeof CodePaths>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof ErrorIconComponent> = (args) => (
|
const Template: StoryFn<typeof ErrorIconComponent> = (args) => (
|
||||||
<ErrorIconComponent {...args} />
|
<ErrorIconComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CodePaths,
|
CodePaths,
|
||||||
@@ -10,9 +10,9 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "Icon/Success Icon",
|
title: "Icon/Success Icon",
|
||||||
component: SuccessIconComponent,
|
component: SuccessIconComponent,
|
||||||
} as ComponentMeta<typeof CodePaths>;
|
} as Meta<typeof CodePaths>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof SuccessIconComponent> = (args) => (
|
const Template: StoryFn<typeof SuccessIconComponent> = (args) => (
|
||||||
<SuccessIconComponent {...args} />
|
<SuccessIconComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CodePaths,
|
CodePaths,
|
||||||
@@ -10,9 +10,9 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "Icon/Warning Icon",
|
title: "Icon/Warning Icon",
|
||||||
component: WarningIconComponent,
|
component: WarningIconComponent,
|
||||||
} as ComponentMeta<typeof CodePaths>;
|
} as Meta<typeof CodePaths>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof WarningIconComponent> = (args) => (
|
const Template: StoryFn<typeof WarningIconComponent> = (args) => (
|
||||||
<WarningIconComponent {...args} />
|
<WarningIconComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { Mode } from "../../data-extensions-editor/shared/mode";
|
import { Mode } from "../../data-extensions-editor/shared/mode";
|
||||||
import { DataExtensionsEditor as DataExtensionsEditorComponent } from "../../view/data-extensions-editor/DataExtensionsEditor";
|
import { DataExtensionsEditor as DataExtensionsEditorComponent } from "../../view/data-extensions-editor/DataExtensionsEditor";
|
||||||
@@ -9,11 +9,11 @@ import { CallClassification } from "../../data-extensions-editor/external-api-us
|
|||||||
export default {
|
export default {
|
||||||
title: "Data Extensions Editor/Data Extensions Editor",
|
title: "Data Extensions Editor/Data Extensions Editor",
|
||||||
component: DataExtensionsEditorComponent,
|
component: DataExtensionsEditorComponent,
|
||||||
} as ComponentMeta<typeof DataExtensionsEditorComponent>;
|
} as Meta<typeof DataExtensionsEditorComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof DataExtensionsEditorComponent> = (
|
const Template: StoryFn<typeof DataExtensionsEditorComponent> = (args) => (
|
||||||
args,
|
<DataExtensionsEditorComponent {...args} />
|
||||||
) => <DataExtensionsEditorComponent {...args} />;
|
);
|
||||||
|
|
||||||
export const DataExtensionsEditor = Template.bind({});
|
export const DataExtensionsEditor = Template.bind({});
|
||||||
DataExtensionsEditor.args = {
|
DataExtensionsEditor.args = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { MethodRow as MethodRowComponent } from "../../view/data-extensions-editor/MethodRow";
|
import { MethodRow as MethodRowComponent } from "../../view/data-extensions-editor/MethodRow";
|
||||||
import { CallClassification } from "../../data-extensions-editor/external-api-usage";
|
import { CallClassification } from "../../data-extensions-editor/external-api-usage";
|
||||||
@@ -8,9 +8,9 @@ import { CallClassification } from "../../data-extensions-editor/external-api-us
|
|||||||
export default {
|
export default {
|
||||||
title: "Data Extensions Editor/Method Row",
|
title: "Data Extensions Editor/Method Row",
|
||||||
component: MethodRowComponent,
|
component: MethodRowComponent,
|
||||||
} as ComponentMeta<typeof MethodRowComponent>;
|
} as Meta<typeof MethodRowComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof MethodRowComponent> = (args) => (
|
const Template: StoryFn<typeof MethodRowComponent> = (args) => (
|
||||||
<MethodRowComponent {...args} />
|
<MethodRowComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { DataFlowPaths as DataFlowPathsComponent } from "../../view/data-flow-paths/DataFlowPaths";
|
import { DataFlowPaths as DataFlowPathsComponent } from "../../view/data-flow-paths/DataFlowPaths";
|
||||||
import { createMockDataFlowPaths } from "../../../test/factories/variant-analysis/shared/data-flow-paths";
|
import { createMockDataFlowPaths } from "../../../test/factories/variant-analysis/shared/data-flow-paths";
|
||||||
export default {
|
export default {
|
||||||
title: "Data Flow Paths/Data Flow Paths",
|
title: "Data Flow Paths/Data Flow Paths",
|
||||||
component: DataFlowPathsComponent,
|
component: DataFlowPathsComponent,
|
||||||
} as ComponentMeta<typeof DataFlowPathsComponent>;
|
} as Meta<typeof DataFlowPathsComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof DataFlowPathsComponent> = (args) => (
|
const Template: StoryFn<typeof DataFlowPathsComponent> = (args) => (
|
||||||
<DataFlowPathsComponent {...args} />
|
<DataFlowPathsComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import AnalysisAlertResult from "../../view/variant-analysis/AnalysisAlertResult";
|
import AnalysisAlertResult from "../../view/variant-analysis/AnalysisAlertResult";
|
||||||
import type { AnalysisAlert } from "../../variant-analysis/shared/analysis-result";
|
import type { AnalysisAlert } from "../../variant-analysis/shared/analysis-result";
|
||||||
@@ -8,9 +8,9 @@ import type { AnalysisAlert } from "../../variant-analysis/shared/analysis-resul
|
|||||||
export default {
|
export default {
|
||||||
title: "Variant Analysis/Analysis Alert Result",
|
title: "Variant Analysis/Analysis Alert Result",
|
||||||
component: AnalysisAlertResult,
|
component: AnalysisAlertResult,
|
||||||
} as ComponentMeta<typeof AnalysisAlertResult>;
|
} as Meta<typeof AnalysisAlertResult>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof AnalysisAlertResult> = (args) => (
|
const Template: StoryFn<typeof AnalysisAlertResult> = (args) => (
|
||||||
<AnalysisAlertResult {...args} />
|
<AnalysisAlertResult {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
import { VariantAnalysisFailureReason } from "../../variant-analysis/shared/variant-analysis";
|
import { VariantAnalysisFailureReason } from "../../variant-analysis/shared/variant-analysis";
|
||||||
import { FailureReasonAlert } from "../../view/variant-analysis/FailureReasonAlert";
|
import { FailureReasonAlert } from "../../view/variant-analysis/FailureReasonAlert";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Variant Analysis/Failure reason alert",
|
title: "Variant Analysis/Failure reason alert",
|
||||||
component: FailureReasonAlert,
|
component: FailureReasonAlert,
|
||||||
} as ComponentMeta<typeof FailureReasonAlert>;
|
} as Meta<typeof FailureReasonAlert>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof FailureReasonAlert> = (args) => (
|
const Template: StoryFn<typeof FailureReasonAlert> = (args) => (
|
||||||
<FailureReasonAlert {...args} />
|
<FailureReasonAlert {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { QueryDetails as QueryDetailsComponent } from "../../view/variant-analysis/QueryDetails";
|
import { QueryDetails as QueryDetailsComponent } from "../../view/variant-analysis/QueryDetails";
|
||||||
@@ -29,9 +29,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof QueryDetailsComponent>;
|
} as Meta<typeof QueryDetailsComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof QueryDetailsComponent> = (args) => (
|
const Template: StoryFn<typeof QueryDetailsComponent> = (args) => (
|
||||||
<QueryDetailsComponent {...args} />
|
<QueryDetailsComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import {
|
import {
|
||||||
@@ -27,9 +27,9 @@ export default {
|
|||||||
</VariantAnalysisContainer>
|
</VariantAnalysisContainer>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} as ComponentMeta<typeof RepoRow>;
|
} as Meta<typeof RepoRow>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof RepoRow> = (args: RepoRowProps) => (
|
const Template: StoryFn<typeof RepoRow> = (args: RepoRowProps) => (
|
||||||
<RepoRow {...args} />
|
<RepoRow {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
|
|
||||||
import { RepositoriesFilter as RepositoriesFilterComponent } from "../../view/variant-analysis/RepositoriesFilter";
|
import { RepositoriesFilter as RepositoriesFilterComponent } from "../../view/variant-analysis/RepositoriesFilter";
|
||||||
import { FilterKey } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
import { FilterKey } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof RepositoriesFilterComponent>;
|
} as Meta<typeof RepositoriesFilterComponent>;
|
||||||
|
|
||||||
export const RepositoriesFilter = () => {
|
export const RepositoriesFilter = () => {
|
||||||
const [value, setValue] = useState(FilterKey.All);
|
const [value, setValue] = useState(FilterKey.All);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
|
|
||||||
import { RepositoriesSearch as RepositoriesSearchComponent } from "../../view/variant-analysis/RepositoriesSearch";
|
import { RepositoriesSearch as RepositoriesSearchComponent } from "../../view/variant-analysis/RepositoriesSearch";
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof RepositoriesSearchComponent>;
|
} as Meta<typeof RepositoriesSearchComponent>;
|
||||||
|
|
||||||
export const RepositoriesSearch = () => {
|
export const RepositoriesSearch = () => {
|
||||||
const [value, setValue] = useState("");
|
const [value, setValue] = useState("");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
|
|
||||||
import { RepositoriesSearchSortRow as RepositoriesSearchSortRowComponent } from "../../view/variant-analysis/RepositoriesSearchSortRow";
|
import { RepositoriesSearchSortRow as RepositoriesSearchSortRowComponent } from "../../view/variant-analysis/RepositoriesSearchSortRow";
|
||||||
import { defaultFilterSortState } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
import { defaultFilterSortState } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof RepositoriesSearchSortRowComponent>;
|
} as Meta<typeof RepositoriesSearchSortRowComponent>;
|
||||||
|
|
||||||
export const RepositoriesSearchSortRow = () => {
|
export const RepositoriesSearchSortRow = () => {
|
||||||
const [value, setValue] = useState(defaultFilterSortState);
|
const [value, setValue] = useState(defaultFilterSortState);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
|
|
||||||
import { RepositoriesSort as RepositoriesSortComponent } from "../../view/variant-analysis/RepositoriesSort";
|
import { RepositoriesSort as RepositoriesSortComponent } from "../../view/variant-analysis/RepositoriesSort";
|
||||||
import { SortKey } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
import { SortKey } from "../../variant-analysis/shared/variant-analysis-filter-sort";
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof RepositoriesSortComponent>;
|
} as Meta<typeof RepositoriesSortComponent>;
|
||||||
|
|
||||||
export const RepositoriesSort = () => {
|
export const RepositoriesSort = () => {
|
||||||
const [value, setValue] = useState(SortKey.Alphabetically);
|
const [value, setValue] = useState(SortKey.Alphabetically);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysis as VariantAnalysisComponent } from "../../view/variant-analysis/VariantAnalysis";
|
import { VariantAnalysis as VariantAnalysisComponent } from "../../view/variant-analysis/VariantAnalysis";
|
||||||
import {
|
import {
|
||||||
@@ -18,9 +18,9 @@ import { createMockRepositoryWithMetadata } from "../../../test/factories/varian
|
|||||||
export default {
|
export default {
|
||||||
title: "Variant Analysis/Variant Analysis",
|
title: "Variant Analysis/Variant Analysis",
|
||||||
component: VariantAnalysisComponent,
|
component: VariantAnalysisComponent,
|
||||||
} as ComponentMeta<typeof VariantAnalysisComponent>;
|
} as Meta<typeof VariantAnalysisComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisComponent> = (args) => (
|
const Template: StoryFn<typeof VariantAnalysisComponent> = (args) => (
|
||||||
<VariantAnalysisComponent {...args} />
|
<VariantAnalysisComponent {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisStatus } from "../../variant-analysis/shared/variant-analysis";
|
import { VariantAnalysisStatus } from "../../variant-analysis/shared/variant-analysis";
|
||||||
@@ -36,9 +36,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof VariantAnalysisActions>;
|
} as Meta<typeof VariantAnalysisActions>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisActions> = (args) => (
|
const Template: StoryFn<typeof VariantAnalysisActions> = (args) => (
|
||||||
<VariantAnalysisActions {...args} />
|
<VariantAnalysisActions {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { faker } from "@faker-js/faker";
|
import { faker } from "@faker-js/faker";
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ export default {
|
|||||||
</VariantAnalysisContainer>
|
</VariantAnalysisContainer>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} as ComponentMeta<typeof VariantAnalysisAnalyzedRepos>;
|
} as Meta<typeof VariantAnalysisAnalyzedRepos>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisAnalyzedRepos> = (
|
const Template: StoryFn<typeof VariantAnalysisAnalyzedRepos> = (args) => (
|
||||||
args,
|
<VariantAnalysisAnalyzedRepos {...args} />
|
||||||
) => <VariantAnalysisAnalyzedRepos {...args} />;
|
);
|
||||||
|
|
||||||
const interpretedResultsForRepo = (
|
const interpretedResultsForRepo = (
|
||||||
nwo: string,
|
nwo: string,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisHeader } from "../../view/variant-analysis/VariantAnalysisHeader";
|
import { VariantAnalysisHeader } from "../../view/variant-analysis/VariantAnalysisHeader";
|
||||||
@@ -59,9 +59,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof VariantAnalysisHeader>;
|
} as Meta<typeof VariantAnalysisHeader>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisHeader> = (args) => (
|
const Template: StoryFn<typeof VariantAnalysisHeader> = (args) => (
|
||||||
<VariantAnalysisHeader {...args} />
|
<VariantAnalysisHeader {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisLoading as VariantAnalysisLoadingComponent } from "../../view/variant-analysis/VariantAnalysisLoading";
|
import { VariantAnalysisLoading as VariantAnalysisLoadingComponent } from "../../view/variant-analysis/VariantAnalysisLoading";
|
||||||
@@ -16,9 +16,9 @@ export default {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
argTypes: {},
|
argTypes: {},
|
||||||
} as ComponentMeta<typeof VariantAnalysisLoadingComponent>;
|
} as Meta<typeof VariantAnalysisLoadingComponent>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisLoadingComponent> = () => (
|
const Template: StoryFn<typeof VariantAnalysisLoadingComponent> = () => (
|
||||||
<VariantAnalysisLoadingComponent />
|
<VariantAnalysisLoadingComponent />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisOutcomePanels } from "../../view/variant-analysis/VariantAnalysisOutcomePanels";
|
import { VariantAnalysisOutcomePanels } from "../../view/variant-analysis/VariantAnalysisOutcomePanels";
|
||||||
@@ -27,11 +27,9 @@ export default {
|
|||||||
</VariantAnalysisContainer>
|
</VariantAnalysisContainer>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} as ComponentMeta<typeof VariantAnalysisOutcomePanels>;
|
} as Meta<typeof VariantAnalysisOutcomePanels>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisOutcomePanels> = (
|
const Template: StoryFn<typeof VariantAnalysisOutcomePanels> = (args) => {
|
||||||
args,
|
|
||||||
) => {
|
|
||||||
const [filterSortState, setFilterSortState] =
|
const [filterSortState, setFilterSortState] =
|
||||||
useState<RepositoriesFilterSortState>(defaultFilterSortState);
|
useState<RepositoriesFilterSortState>(defaultFilterSortState);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisSkippedRepositoriesTab } from "../../view/variant-analysis/VariantAnalysisSkippedRepositoriesTab";
|
import { VariantAnalysisSkippedRepositoriesTab } from "../../view/variant-analysis/VariantAnalysisSkippedRepositoriesTab";
|
||||||
@@ -16,9 +16,9 @@ export default {
|
|||||||
</VariantAnalysisContainer>
|
</VariantAnalysisContainer>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} as ComponentMeta<typeof VariantAnalysisSkippedRepositoriesTab>;
|
} as Meta<typeof VariantAnalysisSkippedRepositoriesTab>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisSkippedRepositoriesTab> = (
|
const Template: StoryFn<typeof VariantAnalysisSkippedRepositoriesTab> = (
|
||||||
args,
|
args,
|
||||||
) => <VariantAnalysisSkippedRepositoriesTab {...args} />;
|
) => <VariantAnalysisSkippedRepositoriesTab {...args} />;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { Meta, StoryFn } from "@storybook/react";
|
||||||
|
|
||||||
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
|
||||||
import { VariantAnalysisStats } from "../../view/variant-analysis/VariantAnalysisStats";
|
import { VariantAnalysisStats } from "../../view/variant-analysis/VariantAnalysisStats";
|
||||||
@@ -24,9 +24,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof VariantAnalysisStats>;
|
} as Meta<typeof VariantAnalysisStats>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof VariantAnalysisStats> = (args) => (
|
const Template: StoryFn<typeof VariantAnalysisStats> = (args) => (
|
||||||
<VariantAnalysisStats {...args} />
|
<VariantAnalysisStats {...args} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
VariantAnalysisStats,
|
VariantAnalysisStats,
|
||||||
VariantAnalysisStatsProps,
|
VariantAnalysisStatsProps,
|
||||||
} from "../VariantAnalysisStats";
|
} from "../VariantAnalysisStats";
|
||||||
import { userEvent } from "@storybook/testing-library";
|
import userEvent from "@testing-library/user-event";
|
||||||
|
|
||||||
describe(VariantAnalysisStats.name, () => {
|
describe(VariantAnalysisStats.name, () => {
|
||||||
const onViewLogsClick = jest.fn();
|
const onViewLogsClick = jest.fn();
|
||||||
@@ -141,13 +141,13 @@ describe(VariantAnalysisStats.name, () => {
|
|||||||
).not.toBeInTheDocument();
|
).not.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders 'View logs' link when the variant analysis status is succeeded", () => {
|
it("renders 'View logs' link when the variant analysis status is succeeded", async () => {
|
||||||
render({
|
render({
|
||||||
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
||||||
completedAt: new Date(),
|
completedAt: new Date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
userEvent.click(screen.getByText("View logs"));
|
await userEvent.click(screen.getByText("View logs"));
|
||||||
expect(onViewLogsClick).toHaveBeenCalledTimes(1);
|
expect(onViewLogsClick).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user