From f26d933e1ecbd9ca104a6e1e0eb251462056aca8 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 12 Dec 2017 10:58:10 +0100 Subject: update react to 16.2.0, use react fragments --- .../main/js/apps/users/components/UserActions.tsx | 54 ++++++++-------------- .../__snapshots__/UserActions-test.tsx.snap | 37 +++++++-------- 2 files changed, 38 insertions(+), 53 deletions(-) (limited to 'server/sonar-web/src/main/js/apps/users') diff --git a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx index 9c5f64fccea..4d3302709f0 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx @@ -49,7 +49,7 @@ export default class UserActions extends React.PureComponent { renderActions = () => { const { user } = this.props; return ( - + {translate('update_details')} @@ -75,39 +75,23 @@ export default class UserActions extends React.PureComponent { const { openForm } = this.state; const { isCurrentUser, onUpdateUsers, user } = this.props; - if (openForm === 'deactivate') { - return [ - this.renderActions(), - - ]; - } - if (openForm === 'password') { - return [ - this.renderActions(), - - ]; - } - if (openForm === 'update') { - return [ - this.renderActions(), - - ]; - } - return this.renderActions(); + return ( + + {this.renderActions()} + {openForm === 'deactivate' && ( + + )} + {openForm === 'password' && ( + + )} + {openForm === 'update' && ( + + )} + + ); } } diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserActions-test.tsx.snap b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserActions-test.tsx.snap index 6328daaf8e0..0fd31e7f6ae 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserActions-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserActions-test.tsx.snap @@ -1,23 +1,24 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should render correctly 1`] = ` - - + - update_details - - - - users.deactivate - - + + update_details + + + + users.deactivate + + + `; -- cgit v1.2.3