diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-08-23 12:54:35 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-09-19 10:51:41 +0200 |
commit | 26e6aab3da5364bcb31fa8b23766610464a8781c (patch) | |
tree | 9902b310d48b56faed784e8a9a1a17e8ad2af782 /server/sonar-vsts | |
parent | bc4d2e6948669842ff325c789f570a4f46f0af41 (diff) | |
download | sonarqube-26e6aab3da5364bcb31fa8b23766610464a8781c.tar.gz sonarqube-26e6aab3da5364bcb31fa8b23766610464a8781c.zip |
SONAR-11159 SONAR-11160 Add new coverage and overall coverage next to branch status
Diffstat (limited to 'server/sonar-vsts')
-rw-r--r-- | server/sonar-vsts/src/main/js/components/QGWidget.tsx | 7 | ||||
-rw-r--r-- | server/sonar-vsts/src/main/js/components/Widget.tsx | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/server/sonar-vsts/src/main/js/components/QGWidget.tsx b/server/sonar-vsts/src/main/js/components/QGWidget.tsx index e4ecb754992..330ead0ec99 100644 --- a/server/sonar-vsts/src/main/js/components/QGWidget.tsx +++ b/server/sonar-vsts/src/main/js/components/QGWidget.tsx @@ -21,14 +21,14 @@ import * as React from 'react'; import * as classNames from 'classnames'; import SonarCloudIcon from './SonarCloudIcon'; import Tooltip from '../../../../../sonar-web/src/main/js/components/controls/Tooltip'; -import { MeasureComponent } from '../../../../../sonar-web/src/main/js/api/measures'; import { getPathUrlAsString, getProjectUrl } from '../../../../../sonar-web/src/main/js/helpers/urls'; +import { ComponentMeasure } from '../../../../../sonar-web/src/main/js/app/types'; interface Props { - component: MeasureComponent; + component: ComponentMeasure; } const QG_LEVELS: { [level: string]: string } = { @@ -39,7 +39,8 @@ const QG_LEVELS: { [level: string]: string } = { }; export default function QGWidget({ component }: Props) { - const qgMeasure = component && component.measures.find(m => m.metric === 'alert_status'); + const qgMeasure = + component && component.measures && component.measures.find(m => m.metric === 'alert_status'); if (!qgMeasure || !qgMeasure.value) { return <p>Project Quality Gate not computed.</p>; diff --git a/server/sonar-vsts/src/main/js/components/Widget.tsx b/server/sonar-vsts/src/main/js/components/Widget.tsx index 03655b0ccf5..049d8c45f9d 100644 --- a/server/sonar-vsts/src/main/js/components/Widget.tsx +++ b/server/sonar-vsts/src/main/js/components/Widget.tsx @@ -20,11 +20,8 @@ import * as React from 'react'; import QGWidget from './QGWidget'; import LoginForm from './LoginForm'; -import { - getMeasuresAndMeta, - MeasureComponent -} from '../../../../../sonar-web/src/main/js/api/measures'; -import { Metric } from '../../../../../sonar-web/src/main/js/app/types'; +import { getMeasuresAndMeta } from '../../../../../sonar-web/src/main/js/api/measures'; +import { Metric, ComponentMeasure } from '../../../../../sonar-web/src/main/js/app/types'; import { Settings } from '../utils'; interface Props { @@ -32,7 +29,7 @@ interface Props { } interface State { - component?: MeasureComponent; + component?: ComponentMeasure; loading: boolean; metrics?: Metric[]; unauthorized: boolean; |