aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projectQualityProfiles
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-08-29 11:38:53 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-09-13 13:53:58 +0200
commit793e86fce66f356099792b7231c9a1d949ff875e (patch)
tree8bd08099539c3cb1ff159823ee1d1f74a5f2c979 /server/sonar-web/src/main/js/apps/projectQualityProfiles
parent736e89cc1629e1e52db00f67e4650f1b88695de9 (diff)
downloadsonarqube-793e86fce66f356099792b7231c9a1d949ff875e.tar.gz
sonarqube-793e86fce66f356099792b7231c9a1d949ff875e.zip
update prettier
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectQualityProfiles')
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx13
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx22
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/Table.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/App-test.tsx5
5 files changed, 22 insertions, 38 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
index ccc85320a62..25c725019b1 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
@@ -124,15 +124,18 @@ export default class QualityProfiles extends React.PureComponent<Props, State> {
<Header />
- {loading
- ? <i className="spinner" />
- : allProfiles &&
- profiles &&
+ {loading ? (
+ <i className="spinner" />
+ ) : (
+ allProfiles &&
+ profiles && (
<Table
allProfiles={allProfiles}
profiles={profiles}
onChangeProfile={this.handleChangeProfile}
- />}
+ />
+ )
+ )}
</div>
);
}
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx
index a758189099d..83e62baefd6 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx
@@ -23,9 +23,7 @@ import { translate } from '../../helpers/l10n';
export default function Header() {
return (
<header className="page-header">
- <h1 className="page-title">
- {translate('project_quality_profiles.page')}
- </h1>
+ <h1 className="page-title">{translate('project_quality_profiles.page')}</h1>
<div className="page-description">
{translate('project_quality_profiles.page.description')}
</div>
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
index 0679b4463b4..ad8340c2c20 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
@@ -63,20 +63,14 @@ export default class ProfileRow extends React.PureComponent<Props, State> {
if (profileOption.isDefault) {
return (
<span>
- <strong>
- {translate('default')}
- </strong>
+ <strong>{translate('default')}</strong>
{': '}
{profileOption.label}
</span>
);
}
- return (
- <span>
- {profileOption.label}
- </span>
- );
+ return <span>{profileOption.label}</span>;
};
renderProfileSelect() {
@@ -107,15 +101,9 @@ export default class ProfileRow extends React.PureComponent<Props, State> {
return (
<tr data-key={profile.language}>
- <td className="thin nowrap">
- {profile.languageName}
- </td>
- <td className="thin nowrap">
- {this.renderProfileSelect()}
- </td>
- <td>
- {this.state.loading && <i className="spinner" />}
- </td>
+ <td className="thin nowrap">{profile.languageName}</td>
+ <td className="thin nowrap">{this.renderProfileSelect()}</td>
+ <td>{this.state.loading && <i className="spinner" />}</td>
</tr>
);
}
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Table.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Table.tsx
index 43fca05f7ae..88f51601856 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Table.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Table.tsx
@@ -34,32 +34,26 @@ export default function Table(props: Props) {
const orderedProfiles = orderBy(props.profiles, 'languageName');
// set key to language to avoid destroying of component
- const profileRows = orderedProfiles.map(profile =>
+ const profileRows = orderedProfiles.map(profile => (
<ProfileRow
key={profile.language}
profile={profile}
possibleProfiles={profilesByLanguage[profile.language]}
onChangeProfile={props.onChangeProfile}
/>
- );
+ ));
return (
<table className="data zebra">
<thead>
<tr>
- <th className="thin nowrap">
- {translate('language')}
- </th>
- <th className="thin nowrap">
- {translate('quality_profile')}
- </th>
+ <th className="thin nowrap">{translate('language')}</th>
+ <th className="thin nowrap">{translate('quality_profile')}</th>
{/* keep one empty cell for the spinner */}
<th>&nbsp;</th>
</tr>
</thead>
- <tbody>
- {profileRows}
- </tbody>
+ <tbody>{profileRows}</tbody>
</table>
);
}
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/App-test.tsx
index ab1f2ec7071..4a68195eba5 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/App-test.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/App-test.tsx
@@ -39,8 +39,9 @@ const associateProject = require('../../../api/quality-profiles').associateProje
any
>;
-const dissociateProject = require('../../../api/quality-profiles')
- .dissociateProject as jest.Mock<any>;
+const dissociateProject = require('../../../api/quality-profiles').dissociateProject as jest.Mock<
+ any
+>;
const searchQualityProfiles = require('../../../api/quality-profiles')
.searchQualityProfiles as jest.Mock<any>;