diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-12-19 14:30:50 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2020-02-10 20:46:15 +0100 |
commit | 04237dba5156dca631d687c4ce6b88de60eef14b (patch) | |
tree | 341d448c92c36bdb5cba8580637078ad18122e35 /server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx | |
parent | 16ef824afc30f2d8e9578abe8ba7422a69de28e2 (diff) | |
download | sonarqube-04237dba5156dca631d687c4ce6b88de60eef14b.tar.gz sonarqube-04237dba5156dca631d687c4ce6b88de60eef14b.zip |
Use new ComponentQualifier enum
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx index 6ad66b9295d..0baa63ff420 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx @@ -44,6 +44,7 @@ import { } from '../../../helpers/qualityGates'; import { ApplicationPeriod } from '../../../types/application'; import { BranchLike } from '../../../types/branch-like'; +import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { GraphType, MeasureHistory } from '../../../types/project-activity'; import { QualityGateStatus, QualityGateStatusCondition } from '../../../types/quality-gates'; @@ -106,7 +107,7 @@ export default class BranchOverview extends React.PureComponent<Props, State> { } loadStatus = () => { - if (this.props.component.qualifier === 'APP') { + if (this.props.component.qualifier === ComponentQualifier.Application) { this.loadApplicationStatus(); } else { this.loadProjectStatus(); @@ -342,7 +343,11 @@ export default class BranchOverview extends React.PureComponent<Props, State> { let current = component.breadcrumbs.length - 1; while ( current > 0 && - !['TRK', 'VW', 'APP'].includes(component.breadcrumbs[current].qualifier) + !([ + ComponentQualifier.Project, + ComponentQualifier.Portfolio, + ComponentQualifier.Application + ] as string[]).includes(component.breadcrumbs[current].qualifier) ) { current--; } @@ -380,7 +385,8 @@ export default class BranchOverview extends React.PureComponent<Props, State> { qgStatuses } = this.state; - const leakPeriod = component.qualifier === 'APP' ? appLeak : getLeakPeriod(periods); + const leakPeriod = + component.qualifier === ComponentQualifier.Application ? appLeak : getLeakPeriod(periods); const projectIsEmpty = loadingStatus === false && |