Skip to content

Commit

Permalink
Enable APM storybook publishing (#93353) (#93964)
Browse files Browse the repository at this point in the history
Changes to fix APM's Storybook setup were made in #93087 and #93294. This re-enables it and fixes a couple places where we weren't using a theme provider.

Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
  • Loading branch information
kibanamachine and smith authored Mar 8, 2021
1 parent 05ece63 commit 2c3efd3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/scripts/jenkins_storybook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node scripts/storybook --dll

cd "$KIBANA_DIR"

# yarn storybook --site apm # TODO re-enable after being fixed
yarn storybook --site apm
yarn storybook --site canvas
yarn storybook --site ci_composite
yarn storybook --site url_template_editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { ErrorCountAlertTrigger } from '.';
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context';
import {
mockApmPluginContextValue,
Expand All @@ -19,15 +20,19 @@ export default {
component: ErrorCountAlertTrigger,
decorators: [
(Story: React.ComponentClass) => (
<MockApmPluginContextWrapper
value={(mockApmPluginContextValue as unknown) as ApmPluginContextValue}
>
<MemoryRouter>
<div style={{ width: 400 }}>
<Story />
</div>
</MemoryRouter>
</MockApmPluginContextWrapper>
<EuiThemeProvider>
<MockApmPluginContextWrapper
value={
(mockApmPluginContextValue as unknown) as ApmPluginContextValue
}
>
<MemoryRouter>
<div style={{ width: 400 }}>
<Story />
</div>
</MemoryRouter>
</MockApmPluginContextWrapper>
</EuiThemeProvider>
),
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EuiTitle } from '@elastic/eui';
import React, { ComponentType } from 'react';
import { MemoryRouter } from 'react-router-dom';
import { HttpSetup } from '../../../../../../../src/core/public';
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider';
import { createCallApmApi } from '../../../services/rest/createCallApmApi';
Expand All @@ -22,15 +23,17 @@ export default {
createCallApmApi(({} as unknown) as HttpSetup);

return (
<MockUrlParamsContextProvider
params={{ rangeFrom: 'now-15m', rangeTo: 'now' }}
>
<MockApmPluginContextWrapper>
<MemoryRouter>
<Story />
</MemoryRouter>
</MockApmPluginContextWrapper>
</MockUrlParamsContextProvider>
<EuiThemeProvider>
<MockUrlParamsContextProvider
params={{ rangeFrom: 'now-15m', rangeTo: 'now' }}
>
<MockApmPluginContextWrapper>
<MemoryRouter>
<Story />
</MemoryRouter>
</MockApmPluginContextWrapper>
</MockUrlParamsContextProvider>
</EuiThemeProvider>
);
},
],
Expand Down

0 comments on commit 2c3efd3

Please sign in to comment.