diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js index 3ac0da688cc..e197e6f0f83 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js @@ -41,11 +41,17 @@ export default class QualityGatesApp extends Component { } fetchQualityGates() { - Promise.all([fetchQualityGatesAppDetails(), fetchQualityGatesAPI()]).then(responses => { - const [details, qualityGates] = responses; - const { updateStore } = this.props; - + Promise.all([ + fetchQualityGatesAppDetails(), + fetchQualityGatesAPI() + ]).then(([details, qualityGates]) => { + const { organization, updateStore } = this.props; updateStore({ ...details, qualityGates }); + if (qualityGates && qualityGates.length === 1 && !details.edit) { + this.context.router.replace( + getQualityGateUrl(qualityGates[0].id, organization && organization.key) + ); + } }); } @@ -62,7 +68,7 @@ export default class QualityGatesApp extends Component { const defaultTitle = translate('quality_gates.page'); const top = organization ? 95 : 30; return ( - <div className="layout-page"> + <div id="quality-gates-page" className="layout-page"> <Helmet defaultTitle={defaultTitle} titleTemplate={'%s - ' + defaultTitle} /> <div className="layout-page-side-outer"> |