Skip to content

Commit

Permalink
Refs #25542 - lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Strachota committed Dec 5, 2018
1 parent 7aa8113 commit aec6d5e
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 38 deletions.
Expand Up @@ -3,9 +3,8 @@ import { storiesOf } from '@storybook/react';
import Story from '../../../../../stories/components/Story';
import MockPagination from './PaginationWrapper.fixtures';

storiesOf('Components/Pagination', module)
.add('Show paginated items', () => (
<Story narrow>
<MockPagination />
</Story>
));
storiesOf('Components/Pagination', module).add('Show paginated items', () => (
<Story narrow>
<MockPagination />
</Story>
));
Expand Up @@ -17,11 +17,14 @@ mock.onGet(someAutoCompletePath).reply(({ url }) => {
return [200, results || []];
});

storiesOf('Components/SearchBar', module).add('Search Bar with mocked data', () => (
<Provider store={Store}>
<Story narrow>
<h4>Try typing something like: "name = "</h4>
<SearchBar data={SearchBarProps.data} />
</Story>
</Provider>
));
storiesOf('Components/SearchBar', module).add(
'Search Bar with mocked data',
() => (
<Provider store={Store}>
<Story narrow>
<h4>Try typing something like: &quot;name = &quot;</h4>
<SearchBar data={SearchBarProps.data} />
</Story>
</Provider>
)
);
Expand Up @@ -35,7 +35,10 @@ storiesOf('Components/Empty State Pattern', module)
header={text('header', 'Header')}
description={text('description', 'Description!')}
action={
<button onClick={action('create clicked')} className="btn btn-primary">
<button
onClick={action('create clicked')}
className="btn btn-primary"
>
Create
</button>
}
Expand Down Expand Up @@ -87,7 +90,11 @@ storiesOf('Components/Empty State Pattern', module)
return (
<Story>
<DefaultEmptyState
icon={select('icons', ['add-circle-o', 'edit', 'key', 'print'], 'key')}
icon={select(
'icons',
['add-circle-o', 'edit', 'key', 'print'],
'key'
)}
header={text('header', 'Header')}
description={text('description', 'Description!')}
documentation={docObject}
Expand Down
Expand Up @@ -4,9 +4,8 @@ import BarChart from './';
import { barChartData } from './BarChart.fixtures';
import Story from '../../../../../../../stories/components/Story';

storiesOf('Components/Charts', module)
.add('Bar Chart', () => (
<Story>
<BarChart {...barChartData} />
</Story>
));
storiesOf('Components/Charts', module).add('Bar Chart', () => (
<Story>
<BarChart {...barChartData} />
</Story>
));
Expand Up @@ -28,7 +28,7 @@ storiesOf('Page chunks/FactChartModal', module)
<Story>
<FactChart
store={mockStore({ factChart: modalSuccessState })}
data ={dataProp}
data={dataProp}
/>
</Story>
))
Expand Down
Expand Up @@ -37,7 +37,6 @@ const initializeMocks = () => {
});
};


storiesOf('Page chunks/Host VMWare Storage', module)
.add('default state for new host', () => {
initializeMocks();
Expand Down
Expand Up @@ -7,20 +7,31 @@ import Story from '../../../../../stories/components/Story';
storiesOf('Components/Charts', module)
.add('Loading', () => (
<Story narrow>
<ChartBox chart={{ data: [] }} noDataMsg={'No data here'} title="Title" status="PENDING" />
<ChartBox
chart={{ data: [] }}
noDataMsg="No data here"
title="Title"
status="PENDING"
/>
</Story>
))
.add('Without Data', () => (
<Story narrow>
<ChartBox type="donut" chart={{ data: [] }} noDataMsg={'No data here'} title="Title" status="RESOLVED" />
<ChartBox
type="donut"
chart={{ data: [] }}
noDataMsg="No data here"
title="Title"
status="RESOLVED"
/>
</Story>
))
.add('With Error', () => (
<Story narrow>
<ChartBox
chart={{ data: [] }}
title="Title"
noDataMsg={'No data here'}
noDataMsg="No data here"
errorText="Ooops"
status="ERROR"
/>
Expand Down
11 changes: 6 additions & 5 deletions webpack/stories/components/Story/Story.js
Expand Up @@ -5,19 +5,20 @@ import './Story.scss';
const Story = ({ narrow, children }) => {
const classes = `story ${narrow ? 'narrow' : ''}`;

return (
<div className={classes}>
{children}
</div>
);
return <div className={classes}>{children}</div>;
};

Story.propTypes = {
narrow: PropTypes.bool,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
};

Story.defaultProps = {
narrow: false,
children: null,
};

export default Story;
18 changes: 13 additions & 5 deletions webpack/stories/components/Text/Text.js
@@ -1,10 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import './Text.scss';

const Text = ({ children }) => (
<div className="text">
{children}
</div>
);
const Text = ({ children }) => <div className="text">{children}</div>;

Text.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
};

Text.defaultProps = {
children: null,
};

export default Text;
6 changes: 5 additions & 1 deletion webpack/stories/index.js
Expand Up @@ -17,7 +17,11 @@ require('patternfly/dist/js/patternfly');

require('./index.scss');

const req = require.context('../assets/javascripts/react_app', true, /.stories.js$/);
const req = require.context(
'../assets/javascripts/react_app',
true,
/.stories.js$/
);

const loadStories = () => req.keys().forEach(filename => req(filename));

Expand Down

0 comments on commit aec6d5e

Please sign in to comment.