diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/project-admin/quality-profiles')
3 files changed, 13 insertions, 25 deletions
diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Header.js b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Header.js index 2e7f7dca3ed..0ecebfdd8cb 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Header.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Header.js @@ -20,17 +20,15 @@ import React from 'react'; import { translate } from '../../../helpers/l10n'; -export default class Header extends React.Component { - render() { - return ( - <header className="page-header"> - <h1 className="page-title"> - {translate('project_quality_profiles.page')} - </h1> - <div className="page-description"> - {translate('project_quality_profiles.page.description')} - </div> - </header> - ); - } +export default function Header() { + return ( + <header className="page-header"> + <h1 className="page-title"> + {translate('project_quality_profiles.page')} + </h1> + <div className="page-description"> + {translate('project_quality_profiles.page.description')} + </div> + </header> + ); } diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js index aaeab20a652..a0f3c132f30 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; -import shallowCompare from 'react-addons-shallow-compare'; import Select from 'react-select'; import { translate } from '../../../helpers/l10n'; -export default class ProfileRow extends React.Component { +export default class ProfileRow extends React.PureComponent { static propTypes = { profile: React.PropTypes.object.isRequired, possibleProfiles: React.PropTypes.array.isRequired, @@ -33,10 +32,6 @@ export default class ProfileRow extends React.Component { loading: false }; - shouldComponentUpdate(nextProps, nextState) { - return shallowCompare(this, nextProps, nextState); - } - componentWillUpdate(nextProps) { if (nextProps.profile !== this.props.profile) { this.setState({ loading: false }); diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js index 10251c140c2..3bb5c8ab603 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js @@ -18,22 +18,17 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; -import shallowCompare from 'react-addons-shallow-compare'; import { groupBy, orderBy } from 'lodash'; import ProfileRow from './ProfileRow'; import { translate } from '../../../helpers/l10n'; -export default class Table extends React.Component { +export default class Table extends React.PureComponent { static propTypes = { allProfiles: React.PropTypes.array.isRequired, profiles: React.PropTypes.array.isRequired, onChangeProfile: React.PropTypes.func.isRequired }; - shouldComponentUpdate(nextProps, nextState) { - return shallowCompare(this, nextProps, nextState); - } - renderHeader() { // keep one empty cell for the spinner return ( |