From 83dd467a6b49b6048b86b1eb8a9416926a1d1077 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 25 Mar 2016 14:52:09 +0100 Subject: [PATCH] SONAR-7397 The "Change Password" form must be available in the UI only for local accounts --- .../src/main/js/apps/account/components/Security.js | 4 ++-- .../src/main/js/apps/account/containers/SecurityContainer.js | 5 +---- .../src/main/webapp/WEB-INF/app/views/account/index.html.erb | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/account/components/Security.js b/server/sonar-web/src/main/js/apps/account/components/Security.js index 52f0a1a9e74..ec220d082c5 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Security.js +++ b/server/sonar-web/src/main/js/apps/account/components/Security.js @@ -22,7 +22,7 @@ import React from 'react'; import Password from './Password'; import Tokens from './Tokens'; -export default function Security ({ user, canChangePassword }) { +export default function Security ({ user }) { return (
@@ -30,7 +30,7 @@ export default function Security ({ user, canChangePassword }) {
- {canChangePassword && ( + {user.local && (
diff --git a/server/sonar-web/src/main/js/apps/account/containers/SecurityContainer.js b/server/sonar-web/src/main/js/apps/account/containers/SecurityContainer.js index 72bf0c1e4fa..8a800b71fb4 100644 --- a/server/sonar-web/src/main/js/apps/account/containers/SecurityContainer.js +++ b/server/sonar-web/src/main/js/apps/account/containers/SecurityContainer.js @@ -22,10 +22,7 @@ import { connect } from 'react-redux'; import Security from './../components/Security'; function mapStateToProps (state) { - return { - user: state.user, - canChangePassword: window.sonarqube.user.canChangePassword - }; + return { user: state.user }; } export default connect(mapStateToProps)(Security); diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb index edab056abc5..c81109e64f9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb @@ -1,7 +1,6 @@ <% content_for :extra_script do %>