diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2019-11-27 22:16:40 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-09 20:46:17 +0100 |
commit | 064e1d872f584f4568a12fa0f31e6a4f975a7437 (patch) | |
tree | 2dba1212e3aff2309b4d016c75ae5d9809bf423c /server/sonar-web/src/main/js/apps/component-measures/utils.ts | |
parent | 7197bceddc7c51d51cd46e22b68cdc71d277aa65 (diff) | |
download | sonarqube-064e1d872f584f4568a12fa0f31e6a4f975a7437.tar.gz sonarqube-064e1d872f584f4568a12fa0f31e6a4f975a7437.zip |
SONAR-12679 Drop short & long living branch concept
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component-measures/utils.ts')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/utils.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.ts b/server/sonar-web/src/main/js/apps/component-measures/utils.ts index 1195b0a9681..e6263ad863a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/utils.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/utils.ts @@ -21,13 +21,9 @@ import { groupBy, memoize, sortBy, toPairs } from 'lodash'; import { getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n'; import { cleanQuery, parseAsString, serializeString } from 'sonar-ui-common/helpers/query'; import { enhanceMeasure } from '../../components/measure/utils'; -import { - isLongLivingBranch, - isMainBranch, - isPullRequest, - isShortLivingBranch -} from '../../helpers/branches'; +import { isBranch, isPullRequest } from '../../helpers/branch-like'; import { getDisplayMetrics, isDiffMetric } from '../../helpers/measures'; +import { BranchLike } from '../../types/branch-like'; import { bubbles } from './config/bubbles'; import { domains } from './config/domains'; @@ -149,14 +145,14 @@ export function hasFacetStat(metric: string): boolean { return metric !== 'alert_status'; } -export function hasFullMeasures(branch?: T.BranchLike) { - return !branch || isLongLivingBranch(branch) || isMainBranch(branch); +export function hasFullMeasures(branch?: BranchLike) { + return !branch || isBranch(branch); } -export function getMeasuresPageMetricKeys(metrics: T.Dict<T.Metric>, branch?: T.BranchLike) { +export function getMeasuresPageMetricKeys(metrics: T.Dict<T.Metric>, branch?: BranchLike) { const metricKeys = getDisplayMetrics(Object.values(metrics)).map(metric => metric.key); - if (isPullRequest(branch) || isShortLivingBranch(branch)) { + if (isPullRequest(branch)) { return metricKeys.filter(key => isDiffMetric(key)); } else { return metricKeys; |