Move NOOP_CONTROL to storybook utils and change to a standalone file (#31421)

This commit is contained in:
Uchechukwu Obasi 2021-02-23 15:20:07 +01:00 committed by GitHub
parent 127effc8ab
commit af12e6d20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 16 deletions

View File

@ -59,5 +59,3 @@ export const parameters = {
escapeHTML: false,
},
};
export const NOOP_CONTROL = { control: { disable: true } };

View File

@ -1,7 +1,7 @@
import React from 'react';
import { Story } from '@storybook/react';
import { BarGauge, BarGaugeDisplayMode } from '@grafana/ui';
import { NOOP_CONTROL } from '@grafana/ui/.storybook/preview';
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
import { VizOrientation, ThresholdsMode, Field, FieldType, getDisplayProcessor } from '@grafana/data';
import { Props } from './BarGauge';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';

View File

@ -11,7 +11,7 @@ import {
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import mdx from './BigValue.mdx';
import { useTheme } from '../../themes';
import { NOOP_CONTROL } from '@grafana/ui/.storybook/preview';
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
import { ArrayVector, FieldSparkline, FieldType } from '@grafana/data';
export default {

View File

@ -2,7 +2,7 @@ import React from 'react';
import { Story } from '@storybook/react';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { ButtonCascader } from '@grafana/ui';
import { NOOP_CONTROL } from '@grafana/ui/.storybook/preview';
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
import { ButtonCascaderProps } from './ButtonCascader';
export default {

View File

@ -1,7 +1,7 @@
import React from 'react';
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
import { CallToActionCard, CallToActionCardProps } from './CallToActionCard';
import { NOOP_CONTROL } from '../../../.storybook/preview';
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
import { Story } from '@storybook/react';
import { Button } from '../Button/Button';
import { action } from '@storybook/addon-actions';

View File

@ -1,6 +1,6 @@
import { Story } from '@storybook/react';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { NOOP_CONTROL } from '../../../.storybook/preview';
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
import { Cascader } from '@grafana/ui';
import { CascaderProps } from './Cascader';
import mdx from './Cascader.mdx';

View File

@ -0,0 +1 @@
export const NOOP_CONTROL = { control: { disable: true } };

View File

@ -1,12 +1,4 @@
{
"exclude": [
"**/*.story.tsx",
"**/*.story.internal.tsx",
"**/*.test.ts*",
"**/*.tmpl.ts",
"dist",
"node_modules",
"src/utils/storybook"
],
"exclude": ["**/*.story.tsx", "**/*.test.ts*", "**/*.tmpl.ts", "dist", "node_modules", "src/utils/storybook"],
"extends": "./tsconfig.json"
}