Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 826ed8d

Browse files
authored
Merge pull request #38 from andymikulski/normandy-fix-prettier
Fix normandy prettier-ing
2 parents fc67ba5 + 6a489fe commit 826ed8d

File tree

155 files changed

+1484
-1296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1484
-1296
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"eject": "react-scripts eject",
3232
"lint:flow": "flow",
3333
"lint:less": "stylelint 'src/**/*.less' --config .stylelintrc",
34-
"lint:prettier": "prettier --list-different src/**/*.js | ./lint_problems.sh",
35-
"lint:prettierfix": "prettier src/**/*.js --write",
34+
"lint:prettier": "prettier --list-different 'src/**/*.js' | ./lint_problems.sh",
35+
"lint:prettierfix": "prettier 'src/**/*.js' --write",
3636
"lint": "yarn run lint:flow && yarn run lint:prettier && yarn run lint:less"
3737
},
3838
"devDependencies": {

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
3-
import DevConsoleApp from "./console/App";
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import DevConsoleApp from './console/App';
44

5-
ReactDOM.render(<DevConsoleApp />, document.getElementById("root"));
5+
ReactDOM.render(<DevConsoleApp />, document.getElementById('root'));

src/normandy/components/App.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import QueryServiceInfo from 'normandy/components/data/QueryServiceInfo';
1313

1414
const { Content, Header, Sider } = Layout;
1515

16-
1716
export default class App extends React.PureComponent {
1817
static propTypes = {
1918
children: PropTypes.node,
@@ -46,20 +45,14 @@ export default class App extends React.PureComponent {
4645
</Header>
4746

4847
<Layout>
49-
<Sider
50-
className="sidebar"
51-
breakpoint="sm"
52-
collapsedWidth="0"
53-
>
48+
<Sider className="sidebar" breakpoint="sm" collapsedWidth="0">
5449
<NavigationMenu />
5550
</Sider>
5651

5752
<Layout className="content-wrapper">
5853
<NavigationCrumbs />
5954

60-
<Content className="content">
61-
{children}
62-
</Content>
55+
<Content className="content">{children}</Content>
6356
</Layout>
6457
</Layout>
6558
</Layout>

src/normandy/components/common/BooleanIcon.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Icon } from 'antd';
22
import PropTypes from 'prop-types';
33
import React from 'react';
44

5-
65
export default class BooleanIcon extends React.PureComponent {
76
static propTypes = {
87
value: PropTypes.bool.isRequired,

src/normandy/components/common/CheckboxMenu.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Button, Checkbox, Dropdown } from 'antd';
22
import PropTypes from 'prop-types';
33
import React from 'react';
44

5-
65
export default class CheckboxMenu extends React.PureComponent {
76
static propTypes = {
87
checkboxes: PropTypes.array,

src/normandy/components/common/CurrentUserDetails.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ import {
99
getLogoutUrl,
1010
} from 'normandy/state/app/serviceInfo/selectors';
1111

12-
13-
@connect(
14-
state => ({
15-
user: getCurrentUser(state, new Map()),
16-
logoutUrl: getLogoutUrl(state, ''),
17-
}),
18-
)
12+
@connect(state => ({
13+
user: getCurrentUser(state, new Map()),
14+
logoutUrl: getLogoutUrl(state, ''),
15+
}))
1916
export default class CurrentUserDetails extends React.PureComponent {
2017
static propTypes = {
2118
logoutUrl: PropTypes.string.isRequired,

src/normandy/components/common/EnrollmentStatus.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ export default class EnrollmentSatus extends React.Component {
4646
}
4747

4848
render() {
49-
const {
50-
recipe,
51-
} = this.props;
49+
const { recipe } = this.props;
5250

5351
return (
54-
<Link href={`/recipe/${recipe.id}/`} className={cx('status-link', !recipe.enabled && 'is-lowkey')}>
52+
<Link
53+
href={`/recipe/${recipe.id}/`}
54+
className={cx('status-link', !recipe.enabled && 'is-lowkey')}
55+
>
5556
<Icon
5657
className={cx('status-icon', this.getColor())}
5758
type={this.getIcon()}

src/normandy/components/common/EnvAlert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default class EnvAlert extends React.PureComponent {
2525
rel="noopener noreferrer"
2626
>
2727
Learn more about Normandy environments.
28-
</a>);
28+
</a>
29+
);
2930

3031
/**
3132
* Given a URL and an array of strings, determines if that URL contains at least

src/normandy/components/common/LoadingOverlay.js

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
isRequestInProgress,
99
} from 'normandy/state/app/requests/selectors';
1010

11-
1211
export class SimpleLoadingOverlay extends React.PureComponent {
1312
static propTypes = {
1413
children: PropTypes.any,
@@ -23,45 +22,34 @@ export class SimpleLoadingOverlay extends React.PureComponent {
2322
};
2423

2524
render() {
26-
const {
27-
children,
28-
className,
29-
isVisible,
30-
} = this.props;
25+
const { children, className, isVisible } = this.props;
3126

3227
const Wrapper = isVisible ? Spin : 'div';
3328

34-
return (
35-
<Wrapper className={className}>
36-
{children}
37-
</Wrapper>
38-
);
29+
return <Wrapper className={className}>{children}</Wrapper>;
3930
}
4031
}
4132

33+
@connect((state, { requestIds }) => {
34+
let isLoading;
4235

43-
@connect(
44-
(state, { requestIds }) => {
45-
let isLoading;
46-
47-
// If we're given one or more request IDs, check if at least one is in progress.
48-
// If nothing is given, simply check if _any_ request is in progress.
49-
if (requestIds) {
50-
let requestArray = requestIds;
51-
if (!(requestArray instanceof Array)) {
52-
requestArray = [requestIds];
53-
}
54-
55-
isLoading = !!requestArray.find(reqId => isRequestInProgress(state, reqId));
56-
} else {
57-
isLoading = areAnyRequestsInProgress(state);
36+
// If we're given one or more request IDs, check if at least one is in progress.
37+
// If nothing is given, simply check if _any_ request is in progress.
38+
if (requestIds) {
39+
let requestArray = requestIds;
40+
if (!(requestArray instanceof Array)) {
41+
requestArray = [requestIds];
5842
}
5943

60-
return {
61-
isLoading,
62-
};
63-
},
64-
)
44+
isLoading = !!requestArray.find(reqId => isRequestInProgress(state, reqId));
45+
} else {
46+
isLoading = areAnyRequestsInProgress(state);
47+
}
48+
49+
return {
50+
isLoading,
51+
};
52+
})
6553
export default class LoadingOverlay extends React.PureComponent {
6654
static propTypes = {
6755
isLoading: PropTypes.bool.isRequired,

src/normandy/components/common/NavigationCrumbs.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { Link } from 'redux-little-router';
77

88
import { getBreadcrumbs } from 'normandy/state/router/selectors';
99

10-
@connect(
11-
state => ({
12-
breadcrumbs: getBreadcrumbs(state),
13-
}),
14-
)
10+
@connect(state => ({
11+
breadcrumbs: getBreadcrumbs(state),
12+
}))
1513
@autobind
1614
export default class NavigationCrumbs extends React.PureComponent {
1715
static propTypes = {
@@ -27,11 +25,13 @@ export default class NavigationCrumbs extends React.PureComponent {
2725

2826
return (
2927
<Breadcrumb>
30-
{breadcrumbs.map((crumb, idx) =>
31-
(<Breadcrumb.Item key={idx}>
32-
<Link href={crumb.link} id={this.getCrumbSlug(crumb)}>{ crumb.name }</Link>
33-
</Breadcrumb.Item>),
34-
)}
28+
{breadcrumbs.map((crumb, idx) => (
29+
<Breadcrumb.Item key={idx}>
30+
<Link href={crumb.link} id={this.getCrumbSlug(crumb)}>
31+
{crumb.name}
32+
</Link>
33+
</Breadcrumb.Item>
34+
))}
3535
</Breadcrumb>
3636
);
3737
}

src/normandy/components/common/NavigationMenu.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ import ShieldIdenticon from 'normandy/components/common/ShieldIdenticon';
1111

1212
const { Divider, Item, SubMenu } = Menu;
1313

14-
@connect(
15-
state => ({
16-
recipeSessionHistory: getSessionHistory(state, 'recipe'),
17-
extensionSessionHistory: getSessionHistory(state, 'extension'),
18-
router: state.router,
19-
}),
20-
)
14+
@connect(state => ({
15+
recipeSessionHistory: getSessionHistory(state, 'recipe'),
16+
extensionSessionHistory: getSessionHistory(state, 'extension'),
17+
router: state.router,
18+
}))
2119
export default class NavigationMenu extends React.PureComponent {
2220
static propTypes = {
2321
recipeSessionHistory: PropTypes.instanceOf(List).isRequired,
@@ -26,7 +24,11 @@ export default class NavigationMenu extends React.PureComponent {
2624
};
2725

2826
render() {
29-
const { router, recipeSessionHistory, extensionSessionHistory } = this.props;
27+
const {
28+
router,
29+
recipeSessionHistory,
30+
extensionSessionHistory,
31+
} = this.props;
3032
const { pathname, search } = router;
3133

3234
return (
@@ -37,7 +39,9 @@ export default class NavigationMenu extends React.PureComponent {
3739
selectedKeys={[pathname + search]}
3840
mode="inline"
3941
>
40-
<Item key="/"><Link href="/">Home</Link></Item>
42+
<Item key="/">
43+
<Link href="/">Home</Link>
44+
</Item>
4145

4246
<SubMenu title="Recipes" key="Recipes">
4347
<Item key="/recipe/">
@@ -46,16 +50,14 @@ export default class NavigationMenu extends React.PureComponent {
4650

4751
{recipeSessionHistory.size > 0 && <Divider />}
4852

49-
{
50-
recipeSessionHistory.map(item =>
51-
(<Item key={item.get('url')}>
52-
<Link href={item.get('url')}>
53-
<ShieldIdenticon seed={item.get('identicon')} size={20} />
54-
{ item.get('caption') }
55-
</Link>
56-
</Item>),
57-
)
58-
}
53+
{recipeSessionHistory.map(item => (
54+
<Item key={item.get('url')}>
55+
<Link href={item.get('url')}>
56+
<ShieldIdenticon seed={item.get('identicon')} size={20} />
57+
{item.get('caption')}
58+
</Link>
59+
</Item>
60+
))}
5961
</SubMenu>
6062

6163
<SubMenu title="Extensions" key="Extensions">
@@ -65,13 +67,11 @@ export default class NavigationMenu extends React.PureComponent {
6567

6668
{extensionSessionHistory.size > 0 && <Divider />}
6769

68-
{
69-
extensionSessionHistory.map(item =>
70-
(<Item key={item.get('url')}>
71-
<Link href={item.get('url')}>{ item.get('caption') }</Link>
72-
</Item>),
73-
)
74-
}
70+
{extensionSessionHistory.map(item => (
71+
<Item key={item.get('url')}>
72+
<Link href={item.get('url')}>{item.get('caption')}</Link>
73+
</Item>
74+
))}
7575
</SubMenu>
7676
</Menu>
7777
</div>

src/normandy/components/common/ShieldIdenticon.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ export default class ShieldIdenticon extends React.PureComponent {
109109
};
110110

111111
return (
112-
<span style={containerStyle} className={cx(className, 'shield-container')}>
113-
{ isLoading && <Spin size="small" /> }
112+
<span
113+
style={containerStyle}
114+
className={cx(className, 'shield-container')}
115+
>
116+
{isLoading && <Spin size="small" />}
114117
<img
115118
alt="Shield Identicon"
116119
height={size}

src/normandy/components/data/QueryActions.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ import { connect } from 'react-redux';
44

55
import { fetchAllActions } from 'normandy/state/app/actions/actions';
66

7-
@connect(
8-
null,
9-
{
10-
fetchAllActions,
11-
},
12-
)
7+
@connect(null, {
8+
fetchAllActions,
9+
})
1310
export default class QueryActions extends React.PureComponent {
1411
static propTypes = {
1512
fetchAllActions: PropTypes.func.isRequired,
16-
}
13+
};
1714

1815
componentWillMount() {
1916
this.props.fetchAllActions();

src/normandy/components/data/QueryExtension.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ import { connect } from 'react-redux';
44

55
import { fetchExtension } from 'normandy/state/app/extensions/actions';
66

7-
8-
@connect(
9-
null,
10-
{
11-
fetchExtension,
12-
},
13-
)
7+
@connect(null, {
8+
fetchExtension,
9+
})
1410
export default class QueryExtension extends React.PureComponent {
1511
static propTypes = {
1612
fetchExtension: PropTypes.func.isRequired,
1713
pk: PropTypes.number.isRequired,
18-
}
14+
};
1915

2016
componentWillMount() {
2117
const { pk } = this.props;

src/normandy/components/data/QueryExtensionListingColumns.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ import { connect } from 'react-redux';
44

55
import { loadExtensionListingColumns } from 'normandy/state/app/extensions/actions';
66

7-
8-
@connect(
9-
null,
10-
{
11-
loadExtensionListingColumns,
12-
},
13-
)
7+
@connect(null, {
8+
loadExtensionListingColumns,
9+
})
1410
export default class QueryExtensionListingColumns extends React.PureComponent {
1511
static propTypes = {
1612
loadExtensionListingColumns: PropTypes.func.isRequired,

0 commit comments

Comments
 (0)