diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-08-10 16:02:22 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-10 20:21:32 +0200 |
commit | d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4 (patch) | |
tree | 03ad7aa9ab7d9bcfb0f5b354149da9c014052010 /server/sonar-web/src/main/js/apps/quality-profiles | |
parent | 29b5f4a0ebf686f9dee7f1d6c6eab65fe381654d (diff) | |
download | sonarqube-d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4.tar.gz sonarqube-d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4.zip |
update main dependencies & fix autofixable eslint warnings (#601)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles')
8 files changed, 25 insertions, 22 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx index 2c9ab530964..f03ac029d86 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx @@ -59,7 +59,7 @@ export default function Changelog(props: Props) { const className = 'js-profile-changelog-event ' + (isEvenRow ? 'even' : 'odd'); return ( - <tr key={index} className={className}> + <tr className={className} key={index}> <td className="thin nowrap">{!isBulkChange && <DateTimeFormatter date={event.date} />}</td> <td className="thin nowrap"> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx index f461c668672..bb3fa09aa81 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx @@ -116,10 +116,10 @@ export default class ComparisonContainer extends React.PureComponent<Props, Stat <div className="boxed-group boxed-group-inner js-profile-comparison"> <header> <ComparisonForm - withKey={withKey} + onCompare={this.handleCompare} profile={profile} profiles={profiles} - onCompare={this.handleCompare} + withKey={withKey} /> {this.state.loading && <i className="spinner spacer-left" />} @@ -132,12 +132,12 @@ export default class ComparisonContainer extends React.PureComponent<Props, Stat modified != null && ( <div className="spacer-top"> <ComparisonResults - left={left} - right={right} inLeft={inLeft} inRight={inRight} + left={left} modified={modified} organization={this.props.organization} + right={right} /> </div> )} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx index c2900d499ca..5cbba2b10cc 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx @@ -44,12 +44,12 @@ export default class ComparisonForm extends React.PureComponent<Props> { <div className="display-inline-block"> <label className="spacer-right">{translate('quality_profiles.compare_with')}</label> <Select - value={withKey} - options={options} - placeholder={translate('select_verb')} - clearable={false} className="input-large" + clearable={false} onChange={this.handleChange.bind(this)} + options={options} + placeholder={translate('select_verb')} + value={withKey} /> </div> ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx index fc475311f68..b4938f4cf1b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx @@ -57,7 +57,7 @@ export default class ComparisonResults extends React.PureComponent<Props> { return ( <ul> {Object.keys(params).map(key => ( - <li key={key} className="spacer-top"> + <li className="spacer-top" key={key}> <code> {key} {': '} @@ -88,7 +88,7 @@ export default class ComparisonResults extends React.PureComponent<Props> { <td> </td> </tr> {this.props.inLeft.map(rule => ( - <tr key={`left-${rule.key}`} className="js-comparison-in-left"> + <tr className="js-comparison-in-left" key={`left-${rule.key}`}> <td>{this.renderRule(rule, rule.severity)}</td> <td> </td> </tr> @@ -116,7 +116,7 @@ export default class ComparisonResults extends React.PureComponent<Props> { </td> </tr> {this.props.inRight.map(rule => ( - <tr key={`right-${rule.key}`} className="js-comparison-in-right"> + <tr className="js-comparison-in-right" key={`right-${rule.key}`}> <td> </td> <td>{this.renderRule(rule, rule.severity)}</td> </tr> @@ -132,7 +132,7 @@ export default class ComparisonResults extends React.PureComponent<Props> { return ( <> <tr> - <td colSpan={2} className="text-center"> + <td className="text-center" colSpan={2}> <h6> {translateWithParameters( 'quality_profiles.x_rules_have_different_configuration', @@ -150,7 +150,7 @@ export default class ComparisonResults extends React.PureComponent<Props> { </td> </tr> {this.props.modified.map(rule => ( - <tr key={`modified-${rule.key}`} className="js-comparison-modified"> + <tr className="js-comparison-modified" key={`modified-${rule.key}`}> <td> {this.renderRule(rule, rule.left.severity)} {this.renderParameters(rule.left.params)} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonForm-test.tsx index 9399a905167..74a3797e25a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonForm-test.tsx @@ -32,10 +32,10 @@ it('should render Select with right options', () => { const output = shallow( <ComparisonForm - withKey="another" + onCompare={() => true} profile={profile} profiles={profiles} - onCompare={() => true} + withKey="another" /> ).find('Select'); expect(output.length).toBe(1); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResults-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResults-test.tsx index 02c86c35088..6ae04a58e37 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResults-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResults-test.tsx @@ -26,12 +26,12 @@ import ComparisonEmpty from '../ComparisonEmpty'; it('should render ComparisonEmpty', () => { const output = shallow( <ComparisonResults - left={{ name: 'left' }} - right={{ name: 'right' }} inLeft={[]} inRight={[]} + left={{ name: 'left' }} modified={[]} organization={null} + right={{ name: 'right' }} /> ); expect(output.is(ComparisonEmpty)).toBe(true); @@ -60,12 +60,12 @@ it('should compare', () => { const output = shallow( <ComparisonResults - left={{ name: 'left' }} - right={{ name: 'right' }} inLeft={inLeft} inRight={inRight} + left={{ name: 'left' }} modified={modified} organization={null} + right={{ name: 'right' }} /> ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/AppContainer.tsx index 1da66735a8c..417c54699d6 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/AppContainer.tsx @@ -45,5 +45,8 @@ const mapDispatchToProps = (dispatch: any) => ({ }); export default forSingleOrganization( - connect<StateProps, DispatchProps>(mapStateToProps, mapDispatchToProps)(App) + connect<StateProps, DispatchProps>( + mapStateToProps, + mapDispatchToProps + )(App) ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx index f55b48206df..bbefe239932 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx @@ -30,7 +30,7 @@ export default function ProfileNotFound(props: Props) { return ( <div className="quality-profile-not-found"> <div className="note spacer-bottom"> - <IndexLink to={getProfilesPath(props.organization)} className="text-muted"> + <IndexLink className="text-muted" to={getProfilesPath(props.organization)}> {translate('quality_profiles.page')} </IndexLink> </div> |