aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/account
diff options
context:
space:
mode:
authorGrégoire Aubert <gregaubert@users.noreply.github.com>2017-03-31 16:50:34 +0200
committerGitHub <noreply@github.com>2017-03-31 16:50:34 +0200
commit77b57db4289a9ce9b9465ab608ed5aa49023be78 (patch)
tree45842770ea5a23076c9b2a9b85df207619eebdc8 /server/sonar-web/src/main/js/apps/account
parent0abc21b94ebf3ec8cedaecfe3b8eeb957832309d (diff)
downloadsonarqube-77b57db4289a9ce9b9465ab608ed5aa49023be78.tar.gz
sonarqube-77b57db4289a9ce9b9465ab608ed5aa49023be78.zip
Add format rule : order react component lifecycle methods (#1882)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/account')
-rw-r--r--server/sonar-web/src/main/js/apps/account/components/Tokens.js12
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/Projects.js17
-rw-r--r--server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.js21
3 files changed, 25 insertions, 25 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/components/Tokens.js b/server/sonar-web/src/main/js/apps/account/components/Tokens.js
index 284f0fd9f9d..a919b09b646 100644
--- a/server/sonar-web/src/main/js/apps/account/components/Tokens.js
+++ b/server/sonar-web/src/main/js/apps/account/components/Tokens.js
@@ -30,6 +30,12 @@ export default class Tokens extends Component {
this.destroyView();
}
+ destroyView() {
+ if (this.destroyView) {
+ this.tokensView.destroy();
+ }
+ }
+
renderView() {
const account = new Backbone.Model({
id: this.props.user.login
@@ -41,12 +47,6 @@ export default class Tokens extends Component {
}).render();
}
- destroyView() {
- if (this.destroyView) {
- this.tokensView.destroy();
- }
- }
-
render() {
return <div ref="container" />;
}
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Projects.js b/server/sonar-web/src/main/js/apps/account/notifications/Projects.js
index 89c32e17079..e378b4a0a95 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/Projects.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/Projects.js
@@ -62,14 +62,6 @@ class Projects extends React.Component {
}
}
- renderOption = option => {
- return (
- <span>
- <Organization organizationKey={option.organization} link={false} />
- <strong>{option.label}</strong>
- </span>
- );
- };
loadOptions = (query, cb) => {
if (query.length < 2) {
cb(null, { options: [] });
@@ -103,6 +95,15 @@ class Projects extends React.Component {
});
};
+ renderOption = option => {
+ return (
+ <span>
+ <Organization organizationKey={option.organization} link={false} />
+ <strong>{option.label}</strong>
+ </span>
+ );
+ };
+
render() {
const allProjects = [...this.props.projects, ...this.state.addedProjects];
diff --git a/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.js b/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.js
index fc0fca467d9..04b822d40b2 100644
--- a/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.js
+++ b/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.js
@@ -38,24 +38,23 @@ type State = {
class CreateOrganizationForm extends React.Component {
mounted: boolean;
-
+ state: State;
props: {
createOrganization: () => Promise<*>,
router: { push: (string) => void }
};
- state: State = {
- loading: false,
- avatar: '',
- avatarImage: '',
- description: '',
- key: '',
- name: '',
- url: ''
- };
-
constructor(props) {
super(props);
+ this.state = {
+ loading: false,
+ avatar: '',
+ avatarImage: '',
+ description: '',
+ key: '',
+ name: '',
+ url: ''
+ };
this.changeAvatarImage = debounce(this.changeAvatarImage, 500);
}