This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 66bd0ce3d0 test(storybook): fix component stories (#29245)
66bd0ce3d0 is described below
commit 66bd0ce3d01c29039b2ff7935a20bea06f20c08a
Author: Mehmet Salih Yavuz <[email protected]>
AuthorDate: Fri Jun 14 17:33:08 2024 +0300
test(storybook): fix component stories (#29245)
---
.../src/components/Alert/Alert.stories.tsx | 3 ++-
.../AsyncAceEditor/AsyncAceEditor.stories.tsx | 6 +++--
.../src/components/Badge/Badge.stories.tsx | 10 ++++----
.../src/components/Button/Button.stories.tsx | 6 +++--
.../components/ButtonGroup/ButtonGroup.stories.tsx | 6 +++--
.../CopyToClipboard/CopyToClipboard.stories.tsx | 3 ++-
.../components/DatePicker/DatePicker.stories.tsx | 4 +--
.../src/components/Dropdown/Dropdown.stories.tsx | 3 ++-
.../DropdownButton/DropdownButton.stories.tsx | 3 ++-
.../components/IconButton/IconButton.stories.tsx | 12 ++++-----
.../components/IconTooltip/IconTooltip.stories.tsx | 3 ++-
.../src/components/Icons/Icons.stories.tsx | 6 +++--
.../components/InfoTooltip/InfoTooltip.stories.tsx | 30 +++++++++++-----------
.../src/components/Loading/Loading.stories.tsx | 3 ++-
.../src/components/Popover/Popover.stories.tsx | 6 +++--
.../PopoverDropdown/PopoverDropdown.stories.tsx | 6 +++--
.../components/ProgressBar/ProgressBar.stories.tsx | 6 ++---
.../src/components/Switch/Switch.stories.tsx | 3 ++-
.../src/components/TableView/TableView.stories.tsx | 2 +-
.../src/components/Tabs/Tabs.stories.tsx | 2 +-
.../src/components/Timer/Timer.stories.tsx | 18 ++++++-------
.../src/components/Tooltip/Tooltip.stories.tsx | 6 +++--
22 files changed, 84 insertions(+), 63 deletions(-)
diff --git a/superset-frontend/src/components/Alert/Alert.stories.tsx
b/superset-frontend/src/components/Alert/Alert.stories.tsx
index 50c77ed6fb..10a9f8d677 100644
--- a/superset-frontend/src/components/Alert/Alert.stories.tsx
+++ b/superset-frontend/src/components/Alert/Alert.stories.tsx
@@ -87,6 +87,7 @@ InteractiveAlert.args = {
InteractiveAlert.argTypes = {
onClose: { action: 'onClose' },
type: {
- control: { type: 'select', options: types },
+ control: { type: 'select' },
+ options: types,
},
};
diff --git
a/superset-frontend/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx
b/superset-frontend/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx
index 2d751f7312..c537e40985 100644
--- a/superset-frontend/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx
+++ b/superset-frontend/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx
@@ -87,11 +87,13 @@ AsyncAceEditor.args = {
AsyncAceEditor.argTypes = {
editorType: {
defaultValue: 'json',
- control: { type: 'select', options: editorTypes },
+ control: { type: 'select' },
+ options: editorTypes,
},
defaultTheme: {
defaultValue: 'github',
- control: { type: 'radio', options: ['textmate', 'github'] },
+ control: { type: 'radio' },
+ options: ['textmate', 'github'],
},
};
diff --git a/superset-frontend/src/components/Badge/Badge.stories.tsx
b/superset-frontend/src/components/Badge/Badge.stories.tsx
index aa7f6b86af..6027ef0b8e 100644
--- a/superset-frontend/src/components/Badge/Badge.stories.tsx
+++ b/superset-frontend/src/components/Badge/Badge.stories.tsx
@@ -73,32 +73,32 @@ InteractiveBadge.argTypes = {
status: {
control: {
type: 'select',
- options: [undefined, ...STATUSES],
},
+ options: [undefined, ...STATUSES],
},
size: {
control: {
type: 'select',
- options: SIZES.options,
},
+ options: SIZES.options,
},
color: {
control: {
type: 'select',
- options: [undefined, ...COLORS.options],
},
+ options: [undefined, ...COLORS.options],
},
textColor: {
control: {
type: 'select',
- options: [undefined, ...COLORS.options],
},
+ options: [undefined, ...COLORS.options],
},
count: {
control: {
type: 'select',
- options: [undefined, ...Array(100).keys()],
},
+ options: [undefined, ...Array(100).keys()],
},
};
diff --git a/superset-frontend/src/components/Button/Button.stories.tsx
b/superset-frontend/src/components/Button/Button.stories.tsx
index 5435ec226f..800d5af104 100644
--- a/superset-frontend/src/components/Button/Button.stories.tsx
+++ b/superset-frontend/src/components/Button/Button.stories.tsx
@@ -117,11 +117,13 @@ InteractiveButton.args = {
InteractiveButton.argTypes = {
target: {
name: TARGETS.label,
- control: { type: 'select', options: Object.values(TARGETS.options) },
+ control: { type: 'select' },
+ options: Object.values(TARGETS.options),
},
href: {
name: HREFS.label,
- control: { type: 'select', options: Object.values(HREFS.options) },
+ control: { type: 'select' },
+ options: Object.values(HREFS.options),
},
onClick: { action: 'clicked' },
};
diff --git
a/superset-frontend/src/components/ButtonGroup/ButtonGroup.stories.tsx
b/superset-frontend/src/components/ButtonGroup/ButtonGroup.stories.tsx
index 98d1fd5adf..bb1bfc1929 100644
--- a/superset-frontend/src/components/ButtonGroup/ButtonGroup.stories.tsx
+++ b/superset-frontend/src/components/ButtonGroup/ButtonGroup.stories.tsx
@@ -49,11 +49,13 @@ InteractiveButtonGroup.args = {
InteractiveButtonGroup.argTypes = {
buttonStyle: {
name: STYLES.label,
- control: { type: 'select', options: STYLES.options },
+ control: { type: 'select' },
+ options: STYLES.options,
},
buttonSize: {
name: SIZES.label,
- control: { type: 'select', options: SIZES.options },
+ control: { type: 'select' },
+ options: SIZES.options,
},
};
diff --git
a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx
b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx
index 60e9b99d8d..861e25f5ce 100644
---
a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx
+++
b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx
@@ -55,6 +55,7 @@ InteractiveCopyToClipboard.argTypes = {
onCopyEnd: { action: 'onCopyEnd' },
copyNode: {
defaultValue: 'Button',
- control: { type: 'radio', options: ['Button', 'Icon', 'Text'] },
+ control: { type: 'radio' },
+ options: ['Button', 'Icon', 'Text'],
},
};
diff --git a/superset-frontend/src/components/DatePicker/DatePicker.stories.tsx
b/superset-frontend/src/components/DatePicker/DatePicker.stories.tsx
index fff250e9d7..69a2b689ae 100644
--- a/superset-frontend/src/components/DatePicker/DatePicker.stories.tsx
+++ b/superset-frontend/src/components/DatePicker/DatePicker.stories.tsx
@@ -40,14 +40,14 @@ const interactiveTypes = {
picker: {
control: {
type: 'select',
- options: ['', 'date', 'week', 'month', 'quarter', 'year'],
},
+ options: ['', 'date', 'week', 'month', 'quarter', 'year'],
},
size: {
control: {
type: 'select',
- options: ['large', 'middle', 'small'],
},
+ options: ['large', 'middle', 'small'],
},
};
diff --git a/superset-frontend/src/components/Dropdown/Dropdown.stories.tsx
b/superset-frontend/src/components/Dropdown/Dropdown.stories.tsx
index 911cc47dda..43d281505a 100644
--- a/superset-frontend/src/components/Dropdown/Dropdown.stories.tsx
+++ b/superset-frontend/src/components/Dropdown/Dropdown.stories.tsx
@@ -60,6 +60,7 @@ export const InteractiveDropdown = ({
InteractiveDropdown.argTypes = {
overlayType: {
defaultValue: 'menu',
- control: { type: 'radio', options: ['menu', 'custom'] },
+ control: { type: 'radio' },
+ options: ['menu', 'custom'],
},
};
diff --git
a/superset-frontend/src/components/DropdownButton/DropdownButton.stories.tsx
b/superset-frontend/src/components/DropdownButton/DropdownButton.stories.tsx
index fd92ba507e..57b5e3e0c2 100644
--- a/superset-frontend/src/components/DropdownButton/DropdownButton.stories.tsx
+++ b/superset-frontend/src/components/DropdownButton/DropdownButton.stories.tsx
@@ -59,7 +59,8 @@ InteractiveDropdownButton.args = {
InteractiveDropdownButton.argTypes = {
placement: {
defaultValue: 'top',
- control: { type: 'select', options: PLACEMENTS },
+ control: { type: 'select' },
+ options: PLACEMENTS,
},
overlay: {
defaultValue: menu,
diff --git a/superset-frontend/src/components/IconButton/IconButton.stories.tsx
b/superset-frontend/src/components/IconButton/IconButton.stories.tsx
index 13dc319c0b..0cc10f32f8 100644
--- a/superset-frontend/src/components/IconButton/IconButton.stories.tsx
+++ b/superset-frontend/src/components/IconButton/IconButton.stories.tsx
@@ -46,12 +46,12 @@ InteractiveIconButton.argTypes = {
defaultValue: '/images/icons/sql.svg',
control: {
type: 'select',
- options: [
- '/images/icons/sql.svg',
- '/images/icons/server.svg',
- '/images/icons/image.svg',
- 'Click to see example alt text',
- ],
},
+ options: [
+ '/images/icons/sql.svg',
+ '/images/icons/server.svg',
+ '/images/icons/image.svg',
+ 'Click to see example alt text',
+ ],
},
};
diff --git
a/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx
b/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx
index 97c432a61f..875d6375e8 100644
--- a/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx
+++ b/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx
@@ -53,6 +53,7 @@ InteractiveIconTooltip.args = {
InteractiveIconTooltip.argTypes = {
placement: {
defaultValue: 'top',
- control: { type: 'select', options: PLACEMENTS },
+ control: { type: 'select' },
+ options: PLACEMENTS,
},
};
diff --git a/superset-frontend/src/components/Icons/Icons.stories.tsx
b/superset-frontend/src/components/Icons/Icons.stories.tsx
index 50a95db491..db7410ca62 100644
--- a/superset-frontend/src/components/Icons/Icons.stories.tsx
+++ b/superset-frontend/src/components/Icons/Icons.stories.tsx
@@ -71,11 +71,13 @@ InteractiveIcons.argTypes = {
},
iconSize: {
defaultValue: 'xl',
- control: { type: 'inline-radio', options: ['s', 'l', 'm', 'xl', 'xxl'] },
+ control: { type: 'inline-radio' },
+ options: ['s', 'l', 'm', 'xl', 'xxl'],
},
iconColor: {
defaultValue: null,
- control: { type: 'select', options: palette },
+ control: { type: 'select' },
+ options: palette,
},
theme: {
table: {
diff --git
a/superset-frontend/src/components/InfoTooltip/InfoTooltip.stories.tsx
b/superset-frontend/src/components/InfoTooltip/InfoTooltip.stories.tsx
index 1d9d5ffa50..17fa3e2d24 100644
--- a/superset-frontend/src/components/InfoTooltip/InfoTooltip.stories.tsx
+++ b/superset-frontend/src/components/InfoTooltip/InfoTooltip.stories.tsx
@@ -44,27 +44,27 @@ InteractiveInfoTooltip.argTypes = {
defaultValue: 'top',
control: {
type: 'select',
- options: [
- 'bottom',
- 'left',
- 'right',
- 'top',
- 'topLeft',
- 'topRight',
- 'bottomLeft',
- 'bottomRight',
- 'leftTop',
- 'leftBottom',
- 'rightTop',
- 'rightBottom',
- ],
},
+ options: [
+ 'bottom',
+ 'left',
+ 'right',
+ 'top',
+ 'topLeft',
+ 'topRight',
+ 'bottomLeft',
+ 'bottomRight',
+ 'leftTop',
+ 'leftBottom',
+ 'rightTop',
+ 'rightBottom',
+ ],
},
trigger: {
defaultValue: 'hover',
control: {
type: 'select',
- options: ['hover', 'click'],
},
+ options: ['hover', 'click'],
},
};
diff --git a/superset-frontend/src/components/Loading/Loading.stories.tsx
b/superset-frontend/src/components/Loading/Loading.stories.tsx
index 7fe394efc2..44fbce64ac 100644
--- a/superset-frontend/src/components/Loading/Loading.stories.tsx
+++ b/superset-frontend/src/components/Loading/Loading.stories.tsx
@@ -64,6 +64,7 @@ InteractiveLoading.args = {
InteractiveLoading.argTypes = {
position: {
name: 'position',
- control: { type: 'select', options: POSITIONS },
+ control: { type: 'select' },
+ options: POSITIONS,
},
};
diff --git a/superset-frontend/src/components/Popover/Popover.stories.tsx
b/superset-frontend/src/components/Popover/Popover.stories.tsx
index 7fdef7ba7d..d9baaf1078 100644
--- a/superset-frontend/src/components/Popover/Popover.stories.tsx
+++ b/superset-frontend/src/components/Popover/Popover.stories.tsx
@@ -71,10 +71,12 @@ InteractivePopover.args = {
InteractivePopover.argTypes = {
placement: {
name: PLACEMENTS.label,
- control: { type: 'select', options: PLACEMENTS.options },
+ control: { type: 'select' },
+ options: PLACEMENTS.options,
},
trigger: {
name: TRIGGERS.label,
- control: { type: 'select', options: TRIGGERS.options },
+ control: { type: 'select' },
+ options: TRIGGERS.options,
},
};
diff --git
a/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.stories.tsx
b/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.stories.tsx
index 16556aaadf..b35aa27419 100644
---
a/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.stories.tsx
+++
b/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.stories.tsx
@@ -68,11 +68,13 @@ export const InteractivePopoverDropdown = (props: Props) =>
{
InteractivePopoverDropdown.argTypes = {
buttonType: {
defaultValue: 'default',
- control: { type: 'radio', options: ['default', 'button'] },
+ control: { type: 'radio' },
+ options: ['default', 'button'],
},
optionType: {
defaultValue: 'default',
- control: { type: 'radio', options: ['default', 'button'] },
+ control: { type: 'radio' },
+ options: ['default', 'button'],
},
value: {
defaultValue: OPTIONS[0].value,
diff --git
a/superset-frontend/src/components/ProgressBar/ProgressBar.stories.tsx
b/superset-frontend/src/components/ProgressBar/ProgressBar.stories.tsx
index b17d82d2ca..ffab337255 100644
--- a/superset-frontend/src/components/ProgressBar/ProgressBar.stories.tsx
+++ b/superset-frontend/src/components/ProgressBar/ProgressBar.stories.tsx
@@ -42,19 +42,19 @@ InteractiveProgressBar.argTypes = {
status: {
control: {
type: 'select',
- options: ['normal', 'success', 'exception', 'active'],
},
+ options: ['normal', 'success', 'exception', 'active'],
},
strokeLinecap: {
control: {
type: 'select',
- options: ['round', 'square'],
},
+ options: ['round', 'square'],
},
type: {
control: {
type: 'select',
- options: ['line', 'circle', 'dashboard'],
},
+ options: ['line', 'circle', 'dashboard'],
},
};
diff --git a/superset-frontend/src/components/Switch/Switch.stories.tsx
b/superset-frontend/src/components/Switch/Switch.stories.tsx
index 0dd208b00f..bba42f206a 100644
--- a/superset-frontend/src/components/Switch/Switch.stories.tsx
+++ b/superset-frontend/src/components/Switch/Switch.stories.tsx
@@ -44,6 +44,7 @@ InteractiveSwitch.args = {
InteractiveSwitch.argTypes = {
size: {
defaultValue: 'default',
- control: { type: 'radio', options: ['small', 'default'] },
+ control: { type: 'radio' },
+ options: ['small', 'default'],
},
};
diff --git a/superset-frontend/src/components/TableView/TableView.stories.tsx
b/superset-frontend/src/components/TableView/TableView.stories.tsx
index 8e3c6d5363..5a5abbc71f 100644
--- a/superset-frontend/src/components/TableView/TableView.stories.tsx
+++ b/superset-frontend/src/components/TableView/TableView.stories.tsx
@@ -83,8 +83,8 @@ InteractiveTableView.argTypes = {
emptyWrapperType: {
control: {
type: 'select',
- options: [EmptyWrapperType.Default, EmptyWrapperType.Small],
},
+ options: [EmptyWrapperType.Default, EmptyWrapperType.Small],
},
pageSize: {
control: {
diff --git a/superset-frontend/src/components/Tabs/Tabs.stories.tsx
b/superset-frontend/src/components/Tabs/Tabs.stories.tsx
index a171fd7f6f..2156e1ef84 100644
--- a/superset-frontend/src/components/Tabs/Tabs.stories.tsx
+++ b/superset-frontend/src/components/Tabs/Tabs.stories.tsx
@@ -53,7 +53,7 @@ InteractiveTabs.argTypes = {
defaultValue: 'line',
control: {
type: 'inline-radio',
- options: ['line', 'card', 'editable-card'],
},
+ options: ['line', 'card', 'editable-card'],
},
};
diff --git a/superset-frontend/src/components/Timer/Timer.stories.tsx
b/superset-frontend/src/components/Timer/Timer.stories.tsx
index dbd92f8efa..cb6744792d 100644
--- a/superset-frontend/src/components/Timer/Timer.stories.tsx
+++ b/superset-frontend/src/components/Timer/Timer.stories.tsx
@@ -45,16 +45,16 @@ InteractiveTimer.argTypes = {
status: {
control: {
type: 'select',
- options: [
- 'success',
- 'warning',
- 'danger',
- 'info',
- 'default',
- 'primary',
- 'secondary',
- ],
},
+ options: [
+ 'success',
+ 'warning',
+ 'danger',
+ 'info',
+ 'default',
+ 'primary',
+ 'secondary',
+ ],
},
};
diff --git a/superset-frontend/src/components/Tooltip/Tooltip.stories.tsx
b/superset-frontend/src/components/Tooltip/Tooltip.stories.tsx
index cca61e689a..72d586bb1a 100644
--- a/superset-frontend/src/components/Tooltip/Tooltip.stories.tsx
+++ b/superset-frontend/src/components/Tooltip/Tooltip.stories.tsx
@@ -57,11 +57,13 @@ InteractiveTooltip.args = {
InteractiveTooltip.argTypes = {
placement: {
defaultValue: 'top',
- control: { type: 'select', options: PLACEMENTS },
+ control: { type: 'select' },
+ options: PLACEMENTS,
},
trigger: {
defaultValue: 'hover',
- control: { type: 'select', options: TRIGGERS },
+ control: { type: 'select' },
+ options: TRIGGERS,
},
color: { control: { type: 'color' } },
onVisibleChange: { action: 'onVisibleChange' },