diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-03-01 13:23:55 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2017-03-01 13:23:55 +0100 |
commit | f2647505fb3cb4bd76a7bdad538beb8f35baece1 (patch) | |
tree | dcdfc23bafbdeacd8e25c9aecc316ce126896286 /server/sonar-web/src/main | |
parent | c99a322d758137d3bc95df81b1c83a4e336076b0 (diff) | |
download | sonarqube-f2647505fb3cb4bd76a7bdad538beb8f35baece1.tar.gz sonarqube-f2647505fb3cb4bd76a7bdad538beb8f35baece1.zip |
SONAR-8451 fix bad state on measures page
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/app/App.js | 7 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/home/actions.js | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/app/App.js b/server/sonar-web/src/main/js/apps/component-measures/app/App.js index f60a5aa0798..2381ba36011 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/app/App.js +++ b/server/sonar-web/src/main/js/apps/component-measures/app/App.js @@ -21,15 +21,16 @@ import React from 'react'; import Spinner from './../components/Spinner'; export default class App extends React.Component { + state = { componentSet: false }; + componentDidMount () { this.props.setComponent(this.props.component); this.props.fetchMetrics(); + this.setState({ componentSet: true }); } render () { - const { metrics } = this.props; - - if (metrics == null) { + if (this.props.metrics == null || !this.state.componentSet) { return <Spinner/>; } diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/actions.js b/server/sonar-web/src/main/js/apps/component-measures/home/actions.js index b516d2e7bbb..a44cd01f8a9 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/actions.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/actions.js @@ -41,6 +41,8 @@ export function fetchMeasures () { dispatch(startFetching()); const state = getState(); + /* eslint-disable no-console */ + console.log(state); const component = getMeasuresAppComponent(state); const metrics = getMeasuresAppAllMetrics(state); |