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

Commit ee8525c

Browse files
committed
Fix all the things automatically with prettier-eslint
1 parent 8928bf6 commit ee8525c

File tree

96 files changed

+485
-1104
lines changed

Some content is hidden

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

96 files changed

+485
-1104
lines changed

src/console/App.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ class App extends Component<AppProps, AppState> {
9595
path="/shield"
9696
component={props =>
9797
this.state.username ? (
98-
<Normandy
99-
authToken={this.state.authToken}
100-
urlPrefix="/shield"
101-
{...props}
102-
/>
98+
<Normandy authToken={this.state.authToken} urlPrefix="/shield" {...props} />
10399
) : (
104100
<Redirect to="/login/?next=/shield" />
105101
)
@@ -111,8 +107,7 @@ class App extends Component<AppProps, AppState> {
111107
<div>
112108
<h2>404 - Page Not Found</h2>
113109
<p>
114-
No delivery-console match for{' '}
115-
<code>{location.pathname}</code>
110+
No delivery-console match for <code>{location.pathname}</code>
116111
</p>
117112
</div>
118113
)}

src/console/LoginPage.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ class LoginPage extends Component<Props, State> {
7272
</FormItem>
7373

7474
<FormItem>
75-
<Button
76-
type="primary"
77-
htmlType="submit"
78-
className="login-form-button"
79-
>
75+
<Button type="primary" htmlType="submit" className="login-form-button">
8076
Log in
8177
</Button>
8278
</FormItem>

src/normandy/components/common/CheckboxMenu.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ export default class CheckboxMenu extends React.PureComponent {
2020
render() {
2121
const { checkboxes, label, onChange, options } = this.props;
2222

23-
const menu = (
24-
<Checkbox.Group
25-
onChange={onChange}
26-
options={options}
27-
defaultValue={checkboxes}
28-
/>
29-
);
23+
const menu = <Checkbox.Group onChange={onChange} options={options} defaultValue={checkboxes} />;
3024

3125
return (
3226
<Dropdown overlay={menu}>

src/normandy/components/common/EnrollmentStatus.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ export default class EnrollmentSatus extends React.Component {
5353
to={`/recipe/${recipe.id}/`}
5454
className={cx('status-link', !recipe.enabled && 'is-lowkey')}
5555
>
56-
<Icon
57-
className={cx('status-icon', this.getColor())}
58-
type={this.getIcon()}
59-
/>
56+
<Icon className={cx('status-icon', this.getColor())} type={this.getIcon()} />
6057
<span className="enrollment-label">{this.getLabel()}</span>
6158
</Link>
6259
);

src/normandy/components/common/LoadingOverlay.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,15 @@ export class SimpleLoadingOverlay extends React.PureComponent {
5353
export default class LoadingOverlay extends React.PureComponent {
5454
static propTypes = {
5555
isLoading: PropTypes.bool.isRequired,
56-
requestIds: PropTypes.oneOfType([
57-
PropTypes.arrayOf(PropTypes.string),
58-
PropTypes.string,
59-
]).isRequired,
56+
requestIds: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.string])
57+
.isRequired,
6058
};
6159

6260
static defaultProps = {
6361
requestIds: null,
6462
};
6563

6664
render() {
67-
return (
68-
<SimpleLoadingOverlay isVisible={this.props.isLoading} {...this.props} />
69-
);
65+
return <SimpleLoadingOverlay isVisible={this.props.isLoading} {...this.props} />;
7066
}
7167
}

src/normandy/components/common/NavigationMenu.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ export default class NavigationMenu extends React.PureComponent {
2525
};
2626

2727
render() {
28-
const {
29-
recipeSessionHistory,
30-
extensionSessionHistory,
31-
history,
32-
} = this.props;
28+
const { recipeSessionHistory, extensionSessionHistory, history } = this.props;
3329
const { pathname, search } = history;
3430

3531
return (

src/normandy/components/common/ShieldIdenticon.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ export default class ShieldIdenticon extends React.PureComponent {
109109
};
110110

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

src/normandy/components/data/QueryFilteredRecipes.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ export default class QueryFilteredRecipes extends React.PureComponent {
2828

2929
componentWillReceiveProps(nextProps) {
3030
const { filters, pageNumber } = this.props;
31-
if (
32-
pageNumber !== nextProps.pageNumber ||
33-
!isEqual(filters, nextProps.filters)
34-
) {
35-
this.props.fetchFilteredRecipesPage(
36-
nextProps.pageNumber,
37-
nextProps.filters,
38-
);
31+
if (pageNumber !== nextProps.pageNumber || !isEqual(filters, nextProps.filters)) {
32+
this.props.fetchFilteredRecipesPage(nextProps.pageNumber, nextProps.filters);
3933
}
4034
}
4135

src/normandy/components/data/QueryMultipleExtensions.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export default class QueryMultipleExtensions extends React.PureComponent {
2727

2828
componentWillReceiveProps(nextProps) {
2929
const { fetchExtensionsPage, filters, pageNumber } = this.props;
30-
if (
31-
pageNumber !== nextProps.pageNumber ||
32-
!isEqual(filters, nextProps.filters)
33-
) {
30+
if (pageNumber !== nextProps.pageNumber || !isEqual(filters, nextProps.filters)) {
3431
fetchExtensionsPage(nextProps.pageNumber, nextProps.filters);
3532
}
3633
}

src/normandy/components/extensions/EditExtensionPage.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,9 @@ export default class EditExtensionPage extends React.PureComponent {
5353
const oldExtensions = this.props.extension;
5454

5555
// New extension means we add a session view.
56-
if (
57-
!is(oldExtensions, extension) &&
58-
oldExtensions.get('name') !== extension.get('name')
59-
) {
56+
if (!is(oldExtensions, extension) && oldExtensions.get('name') !== extension.get('name')) {
6057
const extensionName = extension.get('name');
61-
this.props.addSessionView(
62-
'extension',
63-
extensionName,
64-
extension.get('identicon_seed'),
65-
);
58+
this.props.addSessionView('extension', extensionName, extension.get('identicon_seed'));
6659
}
6760
}
6861

src/normandy/components/extensions/ExtensionSelect.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,10 @@ export default class ExtensionSelect extends React.Component {
6565
let displayedList = this.props.extensions;
6666
const queryFilters = search ? { text: search } : {};
6767

68-
const {
69-
placeholderElement,
70-
loadingDisplay,
71-
noOptionsDisplay,
72-
} = ExtensionSelect;
68+
const { placeholderElement, loadingDisplay, noOptionsDisplay } = ExtensionSelect;
7369

7470
const { isLoadingSearch, disabled, onChange, size, value } = this.props;
75-
const optGroupLabel = search
76-
? 'Search results'
77-
: 'Recently uploaded extensions';
71+
const optGroupLabel = search ? 'Search results' : 'Recently uploaded extensions';
7872

7973
if (isLoadingSearch) {
8074
displayedList = new List();

src/normandy/components/extensions/ListingActionBar.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ export default class ListingActionBar extends React.PureComponent {
4545
checkboxes={columns.toJS()}
4646
label="Columns"
4747
onChange={saveExtensionListingColumns}
48-
options={[
49-
{ label: 'Name', value: 'name' },
50-
{ label: 'XPI URL', value: 'xpi' },
51-
]}
48+
options={[{ label: 'Name', value: 'name' }, { label: 'XPI URL', value: 'xpi' }]}
5249
/>
5350
</Col>
5451
<Col span={8} className="righted">

src/normandy/components/forms/DocumentUrlInput.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ export default class DocumentUrlInput extends React.PureComponent {
3535
}
3636

3737
return (
38-
<Input
39-
disabled={disabled}
40-
type="url"
41-
addonAfter={addonAfter}
42-
value={value}
43-
{...props}
44-
/>
38+
<Input disabled={disabled} type="url" addonAfter={addonAfter} value={value} {...props} />
4539
);
4640
}
4741
}

src/normandy/components/forms/FormItem.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ export default class FormItem extends React.PureComponent {
8383

8484
if (trimWhitespace) {
8585
if (config.getValueFromEvent) {
86-
throw Error(
87-
'config.getValueFromEvent is already defined, do not also use trimWhitespace.',
88-
);
86+
throw Error('config.getValueFromEvent is already defined, do not also use trimWhitespace.');
8987
}
9088
}
9189

src/normandy/components/forms/LabeledInput.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ export default class LabeledInput extends React.Component {
4242
<Element onChange={onChange} {...this.getElementProps()} />
4343

4444
{children && (
45-
<span
46-
className="label"
47-
onClick={this.handleLabelClick}
48-
{...this.getLabelProps()}
49-
>
45+
<span className="label" onClick={this.handleLabelClick} {...this.getLabelProps()}>
5046
{children}
5147
</span>
5248
)}

src/normandy/components/pages/Gateway.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import { Row, Col, Icon, Card } from 'antd';
66
export default class Gateway extends React.PureComponent {
77
render() {
88
return (
9-
<Row
10-
className="page-gateway"
11-
type="flex"
12-
justify="space-around"
13-
align="top"
14-
>
9+
<Row className="page-gateway" type="flex" justify="space-around" align="top">
1510
<Col className="gw-col" xs={24} sm={10} md={8}>
1611
<Card title="Recipes" id="gw-recipes-card">
1712
<Icon type="book" />

src/normandy/components/recipes/ApprovalDetails.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export default class ApprovalDetails extends React.PureComponent {
1717
<dd>{request.getIn(['approver', 'email'])}</dd>
1818

1919
<dt>Responsed</dt>
20-
<dd
21-
title={moment(request.get('created')).format('MMMM Do YYYY, h:mm a')}
22-
>
20+
<dd title={moment(request.get('created')).format('MMMM Do YYYY, h:mm a')}>
2321
{moment(request.get('created')).fromNow()}
2422
</dd>
2523

src/normandy/components/recipes/ApprovalForm.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,10 @@ export default class ApprovalForm extends React.PureComponent {
7575
<SimpleLoadingOverlay isVisible={isSubmitting}>
7676
<FormActions>
7777
<FormActions.Primary>
78-
<Button
79-
icon="dislike"
80-
onClick={this.handleRejectClick}
81-
type="danger"
82-
id="af-reject"
83-
>
78+
<Button icon="dislike" onClick={this.handleRejectClick} type="danger" id="af-reject">
8479
Reject
8580
</Button>
86-
<Button
87-
icon="like"
88-
onClick={this.handleApproveClick}
89-
type="primary"
90-
id="af-approve"
91-
>
81+
<Button icon="like" onClick={this.handleApproveClick} type="primary" id="af-approve">
9282
Approve
9383
</Button>
9484
</FormActions.Primary>

src/normandy/components/recipes/ApprovalRequest.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ export default class ApprovalRequest extends React.PureComponent {
4747
};
4848

4949
async handleSubmit(values, context) {
50-
const {
51-
approvalRequest,
52-
approveApprovalRequest,
53-
rejectApprovalRequest,
54-
} = this.props;
50+
const { approvalRequest, approveApprovalRequest, rejectApprovalRequest } = this.props;
5551

5652
this.setState({
5753
isSubmitting: true,
@@ -72,10 +68,7 @@ export default class ApprovalRequest extends React.PureComponent {
7268
await action(approvalRequest.get('id'), values);
7369
message.success(successMessage);
7470
} catch (error) {
75-
handleError(
76-
`Unable to ${context.approved ? 'approve' : 'reject'} request.`,
77-
error,
78-
);
71+
handleError(`Unable to ${context.approved ? 'approve' : 'reject'} request.`, error);
7972

8073
if (error.data) {
8174
this.setState({ formErrors: error.data });
@@ -127,11 +120,7 @@ export default class ApprovalRequest extends React.PureComponent {
127120
<dd>{approvalRequest.getIn(['creator', 'email'])}</dd>
128121

129122
<dt>Requested</dt>
130-
<dd
131-
title={moment(approvalRequest.get('created')).format(
132-
'MMMM Do YYYY, h:mm a',
133-
)}
134-
>
123+
<dd title={moment(approvalRequest.get('created')).format('MMMM Do YYYY, h:mm a')}>
135124
{moment(approvalRequest.get('created')).fromNow()}
136125
</dd>
137126
</dl>

src/normandy/components/recipes/CloneRecipePage.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,12 @@ export default class CloneRecipePage extends React.PureComponent {
8181
renderHeader() {
8282
const { isLatestRevision, recipe, recipeId, revisionId } = this.props;
8383

84-
const recipeDetailsURL = `/recipe/${recipeId}${
85-
isLatestRevision ? '' : `/rev/${revisionId}`
86-
}/`;
84+
const recipeDetailsURL = `/recipe/${recipeId}${isLatestRevision ? '' : `/rev/${revisionId}`}/`;
8785

8886
const recipeName = recipe.get('name');
8987

9088
// Only display revision hash if we're _not_ on the latest version.
91-
const revisionAddendum = isLatestRevision
92-
? ''
93-
: `(Revision: ${revisionId.slice(0, 7)})`;
89+
const revisionAddendum = isLatestRevision ? '' : `(Revision: ${revisionId.slice(0, 7)})`;
9490
const cloningMessage = `Cloning recipe values from "${recipeName}" ${revisionAddendum}`;
9591

9692
return (
@@ -114,12 +110,7 @@ export default class CloneRecipePage extends React.PureComponent {
114110
<QueryRevision pk={revisionId} />
115111
{this.renderHeader()}
116112

117-
<LoadingOverlay
118-
requestIds={[
119-
`fetch-recipe-${recipeId}`,
120-
`fetch-revision-${revisionId}`,
121-
]}
122-
>
113+
<LoadingOverlay requestIds={[`fetch-recipe-${recipeId}`, `fetch-revision-${revisionId}`]}>
123114
<GenericFormContainer
124115
form={RecipeForm}
125116
formAction={this.formAction}

src/normandy/components/recipes/DetailsActionBar.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,14 @@ import {
1212
enableRecipe as enableRecipeAction,
1313
} from 'normandy/state/app/recipes/actions';
1414
import { requestRevisionApproval as requestRevisionApprovalAction } from 'normandy/state/app/revisions/actions';
15-
import {
16-
getLatestRevisionIdForRecipe,
17-
getRecipe,
18-
} from 'normandy/state/app/recipes/selectors';
15+
import { getLatestRevisionIdForRecipe, getRecipe } from 'normandy/state/app/recipes/selectors';
1916
import {
2017
isApprovableRevision,
2118
isLatestApprovedRevision,
2219
isLatestRevision,
2320
isRevisionPendingApproval,
2421
} from 'normandy/state/app/revisions/selectors';
25-
import {
26-
getRouterPath,
27-
getUrlParam,
28-
getUrlParamAsInt,
29-
} from 'normandy/state/router/selectors';
22+
import { getRouterPath, getUrlParam, getUrlParamAsInt } from 'normandy/state/router/selectors';
3023

3124
@withRouter
3225
@connect(

0 commit comments

Comments
 (0)