mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Package][Expandable flyout] - fix Storybook (#185036)
This commit is contained in:
parent
e767ef47d3
commit
2ae94e8ad0
3 changed files with 67 additions and 47 deletions
|
@ -101,13 +101,17 @@ const registeredPanels = [
|
|||
];
|
||||
|
||||
export const Right: Story<void> = () => {
|
||||
const state = {
|
||||
right: {
|
||||
id: 'right',
|
||||
const state: State = {
|
||||
byId: {
|
||||
memory: {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: undefined,
|
||||
preview: undefined,
|
||||
},
|
||||
},
|
||||
left: {},
|
||||
preview: [],
|
||||
} as unknown as State;
|
||||
};
|
||||
|
||||
return (
|
||||
<TestProvider state={state}>
|
||||
|
@ -117,15 +121,19 @@ export const Right: Story<void> = () => {
|
|||
};
|
||||
|
||||
export const Left: Story<void> = () => {
|
||||
const state = {
|
||||
right: {
|
||||
id: 'right',
|
||||
const state: State = {
|
||||
byId: {
|
||||
memory: {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: undefined,
|
||||
},
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: [],
|
||||
} as unknown as State;
|
||||
};
|
||||
|
||||
return (
|
||||
<TestProvider state={state}>
|
||||
|
@ -135,19 +143,23 @@ export const Left: Story<void> = () => {
|
|||
};
|
||||
|
||||
export const Preview: Story<void> = () => {
|
||||
const state = {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: [
|
||||
{
|
||||
id: 'preview1',
|
||||
const state: State = {
|
||||
byId: {
|
||||
memory: {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: [
|
||||
{
|
||||
id: 'preview1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as unknown as State;
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<TestProvider state={state}>
|
||||
|
@ -157,22 +169,26 @@ export const Preview: Story<void> = () => {
|
|||
};
|
||||
|
||||
export const MultiplePreviews: Story<void> = () => {
|
||||
const state = {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: [
|
||||
{
|
||||
id: 'preview1',
|
||||
const state: State = {
|
||||
byId: {
|
||||
memory: {
|
||||
right: {
|
||||
id: 'right',
|
||||
},
|
||||
left: {
|
||||
id: 'left',
|
||||
},
|
||||
preview: [
|
||||
{
|
||||
id: 'preview1',
|
||||
},
|
||||
{
|
||||
id: 'preview2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'preview2',
|
||||
},
|
||||
],
|
||||
} as unknown as State;
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<TestProvider state={state}>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
import { Provider as ReduxProvider } from 'react-redux';
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
import React, { FC, PropsWithChildren } from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { ExpandableFlyoutContextProvider } from '../context';
|
||||
import { reducer } from '../reducer';
|
||||
import { Context } from '../redux';
|
||||
|
@ -32,10 +33,12 @@ export const TestProvider: FC<PropsWithChildren<TestProviderProps>> = ({
|
|||
});
|
||||
|
||||
return (
|
||||
<ExpandableFlyoutContextProvider urlKey={urlKey}>
|
||||
<ReduxProvider store={store} context={Context}>
|
||||
{children}
|
||||
</ReduxProvider>
|
||||
</ExpandableFlyoutContextProvider>
|
||||
<I18nProvider>
|
||||
<ExpandableFlyoutContextProvider urlKey={urlKey}>
|
||||
<ReduxProvider store={store} context={Context}>
|
||||
{children}
|
||||
</ReduxProvider>
|
||||
</ExpandableFlyoutContextProvider>
|
||||
</I18nProvider>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
],
|
||||
"kbn_references": [
|
||||
"@kbn/i18n",
|
||||
"@kbn/kibana-utils-plugin"
|
||||
"@kbn/kibana-utils-plugin",
|
||||
"@kbn/i18n-react"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue