diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-07-17 10:07:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 10:07:30 +0200 |
commit | d5b076b2fc8988e9a3799ba7775f851e1a12cbb7 (patch) | |
tree | 3c0f98977cc487747efeeeb47974fc13e70eab97 /server/sonar-web/src/main/js/components/common | |
parent | c8797aabc9b4d705f7da59b43717e5c0fe0e80fb (diff) | |
download | sonarqube-d5b076b2fc8988e9a3799ba7775f851e1a12cbb7.tar.gz sonarqube-d5b076b2fc8988e9a3799ba7775f851e1a12cbb7.zip |
upgrade prettier and remove prettier-eslint (#2254)
Diffstat (limited to 'server/sonar-web/src/main/js/components/common')
13 files changed, 67 insertions, 30 deletions
diff --git a/server/sonar-web/src/main/js/components/common/BubblePopupHelper.js b/server/sonar-web/src/main/js/components/common/BubblePopupHelper.js index 81923c806ba..9a6b17f561e 100644 --- a/server/sonar-web/src/main/js/components/common/BubblePopupHelper.js +++ b/server/sonar-web/src/main/js/components/common/BubblePopupHelper.js @@ -30,7 +30,7 @@ type Props = { }, popup: Object, position: 'bottomleft' | 'bottomright', - togglePopup: ?boolean => void + togglePopup: (?boolean) => void }; type State = { diff --git a/server/sonar-web/src/main/js/components/common/EmptySearch.js b/server/sonar-web/src/main/js/components/common/EmptySearch.js index 719a2239c90..8a426f4474c 100644 --- a/server/sonar-web/src/main/js/components/common/EmptySearch.js +++ b/server/sonar-web/src/main/js/components/common/EmptySearch.js @@ -22,11 +22,14 @@ import React from 'react'; import { translate } from '../../helpers/l10n'; import './EmptySearch.css'; -const EmptySearch = () => ( +const EmptySearch = () => <div className="empty-search"> - <h3>{translate('no_results_search')}</h3> - <p className="big-spacer-top">{translate('no_results_search.2')}</p> - </div> -); + <h3> + {translate('no_results_search')} + </h3> + <p className="big-spacer-top"> + {translate('no_results_search.2')} + </p> + </div>; export default EmptySearch; diff --git a/server/sonar-web/src/main/js/components/common/FavoriteIcon.js b/server/sonar-web/src/main/js/components/common/FavoriteIcon.js index 98157aa9e5d..5d16a8d4b70 100644 --- a/server/sonar-web/src/main/js/components/common/FavoriteIcon.js +++ b/server/sonar-web/src/main/js/components/common/FavoriteIcon.js @@ -31,7 +31,11 @@ export default function FavoriteIcon(props: Props) { /* eslint max-len: 0 */ return ( <span - className={classNames('icon-star', { 'icon-star-favorite': props.favorite }, props.className)}> + className={classNames( + 'icon-star', + { 'icon-star-favorite': props.favorite }, + props.className + )}> <svg width={props.size} height={props.size} viewBox="0 0 16 16"> <path d="M15.4275,5.77678C15.4275,5.90773 15.3501,6.05059 15.1953,6.20536L11.9542,9.36608L12.7221,13.8304C12.728,13.872 12.731,13.9316 12.731,14.0089C12.731,14.1339 12.6998,14.2396 12.6373,14.3259C12.5748,14.4122 12.484,14.4554 12.3649,14.4554C12.2518,14.4554 12.1328,14.4197 12.0078,14.3482L7.99888,12.2411L3.98995,14.3482C3.85901,14.4197 3.73996,14.4554 3.63281,14.4554C3.50781,14.4554 3.41406,14.4122 3.35156,14.3259C3.28906,14.2396 3.25781,14.1339 3.25781,14.0089C3.25781,13.9732 3.26377,13.9137 3.27567,13.8304L4.04353,9.36608L0.793531,6.20536C0.644719,6.04464 0.570313,5.90178 0.570313,5.77678C0.570313,5.55654 0.736979,5.41964 1.07031,5.36606L5.55245,4.71428L7.56138,0.651781C7.67447,0.407729 7.8203,0.285703 7.99888,0.285703C8.17745,0.285703 8.32328,0.407729 8.43638,0.651781L10.4453,4.71428L14.9274,5.36606C15.2608,5.41964 15.4274,5.55654 15.4274,5.77678L15.4275,5.77678Z" /> </svg> diff --git a/server/sonar-web/src/main/js/components/common/MarkdownTips.js b/server/sonar-web/src/main/js/components/common/MarkdownTips.js index 8c5db3a8fe1..323838e06c5 100644 --- a/server/sonar-web/src/main/js/components/common/MarkdownTips.js +++ b/server/sonar-web/src/main/js/components/common/MarkdownTips.js @@ -35,9 +35,15 @@ export default class MarkdownTips extends React.PureComponent { {translate('markdown.helplink')} </a> {':'} - <span className="spacer-left">*{translate('bold')}*</span> - <span className="spacer-left">``{translate('code')}``</span> - <span className="spacer-left">* {translate('bulleted_point')}</span> + <span className="spacer-left"> + *{translate('bold')}* + </span> + <span className="spacer-left"> + ``{translate('code')}`` + </span> + <span className="spacer-left"> + * {translate('bulleted_point')} + </span> </div> ); } diff --git a/server/sonar-web/src/main/js/components/common/MultiSelect.js b/server/sonar-web/src/main/js/components/common/MultiSelect.js index 2c75904d706..5e618e45e1f 100644 --- a/server/sonar-web/src/main/js/components/common/MultiSelect.js +++ b/server/sonar-web/src/main/js/components/common/MultiSelect.js @@ -242,7 +242,7 @@ export default class MultiSelect extends React.PureComponent { </div> <ul className="menu"> {selectedElements.length > 0 && - selectedElements.map(element => ( + selectedElements.map(element => <MultiSelectOption key={element} element={element} @@ -251,9 +251,9 @@ export default class MultiSelect extends React.PureComponent { onSelectChange={this.handleSelectChange} onHover={this.handleElementHover} /> - ))} + )} {unselectedElements.length > 0 && - unselectedElements.map(element => ( + unselectedElements.map(element => <MultiSelectOption key={element} element={element} @@ -261,7 +261,7 @@ export default class MultiSelect extends React.PureComponent { onSelectChange={this.handleSelectChange} onHover={this.handleElementHover} /> - ))} + )} {this.isNewElement(query, this.props) && <MultiSelectOption key={query} diff --git a/server/sonar-web/src/main/js/components/common/MultiSelectOption.js b/server/sonar-web/src/main/js/components/common/MultiSelectOption.js index 02291254fc1..c9fb52632eb 100644 --- a/server/sonar-web/src/main/js/components/common/MultiSelectOption.js +++ b/server/sonar-web/src/main/js/components/common/MultiSelectOption.js @@ -64,7 +64,8 @@ export default class MultiSelectOption extends React.PureComponent { onClick={this.handleSelect} onMouseOver={this.handleHover} onFocus={this.handleHover}> - <i className={className} />{' '}{this.props.custom && '+ '}{this.props.element} + <i className={className} /> {this.props.custom && '+ '} + {this.props.element} </a> </li> ); diff --git a/server/sonar-web/src/main/js/components/common/SelectList.js b/server/sonar-web/src/main/js/components/common/SelectList.js index cbfadc9307a..d4096080c66 100644 --- a/server/sonar-web/src/main/js/components/common/SelectList.js +++ b/server/sonar-web/src/main/js/components/common/SelectList.js @@ -144,7 +144,7 @@ export default class SelectList extends React.PureComponent { }) )} {!hasChildren && - this.props.items.map(item => ( + this.props.items.map(item => <SelectListItem active={this.state.active} item={item} @@ -152,7 +152,7 @@ export default class SelectList extends React.PureComponent { onHover={this.handleHover} onSelect={this.handleSelect} /> - ))} + )} </ul> ); } diff --git a/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.js b/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.js index 0a521fd2391..eceab041969 100644 --- a/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.js +++ b/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.js @@ -30,9 +30,13 @@ type Props = { export default function UpgradeOrganizationBox(props: Props) { return ( <div className="boxed-group boxed-group-inner upgrade-organization-box"> - <h3 className="spacer-bottom">{translate('billing.upgrade_box.header')}</h3> + <h3 className="spacer-bottom"> + {translate('billing.upgrade_box.header')} + </h3> - <p>{translate('billing.upgrade_box.text')}</p> + <p> + {translate('billing.upgrade_box.text')} + </p> {hasMessage('billing.upgrade_box.button') && <div className="big-spacer-top"> diff --git a/server/sonar-web/src/main/js/components/common/VisibilitySelector.js b/server/sonar-web/src/main/js/components/common/VisibilitySelector.js index 08f204e48ab..dd35ad56609 100644 --- a/server/sonar-web/src/main/js/components/common/VisibilitySelector.js +++ b/server/sonar-web/src/main/js/components/common/VisibilitySelector.js @@ -57,7 +57,9 @@ export default class VisibilitySelector extends React.PureComponent { 'is-checked': this.props.visibility === 'public' })} /> - <span className="spacer-left">{translate('visibility.public')}</span> + <span className="spacer-left"> + {translate('visibility.public')} + </span> </a> {this.props.canTurnToPrivate @@ -71,7 +73,9 @@ export default class VisibilitySelector extends React.PureComponent { 'is-checked': this.props.visibility === 'private' })} /> - <span className="spacer-left">{translate('visibility.private')}</span> + <span className="spacer-left"> + {translate('visibility.private')} + </span> </a> : <span className="huge-spacer-left text-muted cursor-not-allowed" @@ -81,7 +85,9 @@ export default class VisibilitySelector extends React.PureComponent { 'is-checked': this.props.visibility === 'private' })} /> - <span className="spacer-left">{translate('visibility.private')}</span> + <span className="spacer-left"> + {translate('visibility.private')} + </span> </span>} </div> ); diff --git a/server/sonar-web/src/main/js/components/common/__tests__/BubblePopup-test.js b/server/sonar-web/src/main/js/components/common/__tests__/BubblePopup-test.js index add930864e5..f9b67ca38b3 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/BubblePopup-test.js +++ b/server/sonar-web/src/main/js/components/common/__tests__/BubblePopup-test.js @@ -27,6 +27,10 @@ const props = { }; it('should render popup', () => { - const popup = shallow(<BubblePopup {...props}><span>test</span></BubblePopup>); + const popup = shallow( + <BubblePopup {...props}> + <span>test</span> + </BubblePopup> + ); expect(popup).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/components/common/__tests__/DeferredSpinner-test.js b/server/sonar-web/src/main/js/components/common/__tests__/DeferredSpinner-test.js index 62d755cc949..560c705c4cb 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/DeferredSpinner-test.js +++ b/server/sonar-web/src/main/js/components/common/__tests__/DeferredSpinner-test.js @@ -38,14 +38,22 @@ it('add custom className', () => { }); it('renders children before timeout', () => { - const spinner = mount(<DeferredSpinner><div>foo</div></DeferredSpinner>); + const spinner = mount( + <DeferredSpinner> + <div>foo</div> + </DeferredSpinner> + ); expect(spinner).toMatchSnapshot(); jest.runAllTimers(); expect(spinner).toMatchSnapshot(); }); it('is controlled by loading prop', () => { - const spinner = mount(<DeferredSpinner loading={false}><div>foo</div></DeferredSpinner>); + const spinner = mount( + <DeferredSpinner loading={false}> + <div>foo</div> + </DeferredSpinner> + ); expect(spinner).toMatchSnapshot(); spinner.setProps({ loading: true }); expect(spinner).toMatchSnapshot(); diff --git a/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.js b/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.js index 58afbecad26..817f852d023 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.js +++ b/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.js @@ -42,11 +42,11 @@ it('should render correctly with children', () => { expect( shallow( <SelectList items={items} currentItem="seconditem" onSelect={onSelect}> - {items.map(item => ( + {items.map(item => <SelectListItem key={item} item={item}> <i className="myicon" />item </SelectListItem> - ))} + )} </SelectList> ) ).toMatchSnapshot(); @@ -57,11 +57,11 @@ it('should correclty handle user actions', () => { const items = ['item', 'seconditem', 'third']; const list = mount( <SelectList items={items} currentItem="seconditem" onSelect={onSelect}> - {items.map(item => ( + {items.map(item => <SelectListItem key={item} item={item}> <i className="myicon" />item </SelectListItem> - ))} + )} </SelectList> ); keydown(40); diff --git a/server/sonar-web/src/main/js/components/common/__tests__/SelectListItem-test.js b/server/sonar-web/src/main/js/components/common/__tests__/SelectListItem-test.js index 235be5bfae6..6e839b45e6e 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/SelectListItem-test.js +++ b/server/sonar-web/src/main/js/components/common/__tests__/SelectListItem-test.js @@ -29,7 +29,8 @@ it('should render correctly with children', () => { expect( shallow( <SelectListItem active="myitem" item="seconditem"> - <i className="custom-icon" /><p>seconditem</p> + <i className="custom-icon" /> + <p>seconditem</p> </SelectListItem> ) ).toMatchSnapshot(); |