diff options
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/App.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/app/components/App.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/app/components/App.tsx b/server/sonar-web/src/main/js/app/components/App.tsx index 400ab16b2ae..46cd8a6f620 100644 --- a/server/sonar-web/src/main/js/app/components/App.tsx +++ b/server/sonar-web/src/main/js/app/components/App.tsx @@ -34,18 +34,20 @@ interface Props { interface State { branchesEnabled: boolean; loading: boolean; + onSonarCloud: boolean; } class App extends React.PureComponent<Props, State> { mounted: boolean; - state: State = { branchesEnabled: false, loading: true }; + state: State = { branchesEnabled: false, loading: true, onSonarCloud: false }; static childContextTypes = { - branchesEnabled: PropTypes.bool.isRequired + branchesEnabled: PropTypes.bool.isRequired, + onSonarCloud: PropTypes.bool }; getChildContext() { - return { branchesEnabled: this.state.branchesEnabled }; + return { branchesEnabled: this.state.branchesEnabled, onSonarCloud: this.state.onSonarCloud }; } componentDidMount() { @@ -64,7 +66,10 @@ class App extends React.PureComponent<Props, State> { fetchAppState = () => { return this.props.fetchAppState().then(appState => { if (this.mounted) { - this.setState({ branchesEnabled: appState.branchesEnabled }); + const onSonarCloud = + appState.settings != undefined && + appState.settings['sonar.lf.sonarqube.com.enabled'] === 'true'; + this.setState({ branchesEnabled: appState.branchesEnabled, onSonarCloud }); } }); }; |