const failedConditions = qgStatuses?.flatMap((qg) => qg.failedConditions) ?? [];
const newIssues = getLeakValue(findMeasure(measures, MetricKey.new_violations));
- const newIssuesCondition = failedConditions.find((c) => c.metric === MetricKey.new_violations);
+ const newIssuesCondition = conditions.find((c) => c.metric === MetricKey.new_violations);
const issuesConditionFailed = newIssuesCondition?.level === Status.ERROR;
const newAcceptedIssues = getLeakValue(findMeasure(measures, MetricKey.new_accepted_issues));
const newSecurityHotspots = getLeakValue(
}, emptyVariations);
}
+export function getConditionRequiredTranslateId(metric: MetricKey) {
+ if (
+ [MetricKey.security_hotspots_reviewed, MetricKey.new_security_hotspots_reviewed].includes(
+ metric,
+ )
+ ) {
+ return 'overview.quality_gate.required_x_reviewed';
+ }
+
+ return 'overview.quality_gate.required_x';
+}
+
export function getConditionRequiredLabel(
condition: QualityGateStatusConditionEnhanced,
intl: IntlShape,
operator = '=';
}
- const conditionEl = (
- <>
- {operator}{' '}
- {formatMeasure(condition.error, condition.measure.metric.type, {
- decimals: 2,
- omitExtraDecimalZeros: true,
- })}
- </>
- );
+ const conditionEl = formatMeasure(condition.error, condition.measure.metric.type, {
+ decimals: 2,
+ omitExtraDecimalZeros: true,
+ });
return intl.formatMessage(
- { id: 'overview.quality_gate.required_x' },
+ { id: getConditionRequiredTranslateId(condition.metric) },
{
+ operator,
requirement: failed ? <b>{conditionEl}</b> : conditionEl,
},
);
overview.quality_gate.x_estimated_after_merge={value} Estimated after merge
overview.quality_gate.require_fixing={count, plural, one {requires} other {require}} fixing
overview.quality_gate.require_reviewing={count, plural, one {requires} other {require}} reviewing
-overview.quality_gate.required_x=Required {requirement}
+overview.quality_gate.required_x=Required {operator} {requirement}
+overview.quality_gate.required_x_reviewed=Required review: {requirement}
overview.quality_profiles=Quality Profiles used
overview.new_code_period_x=New Code: {0}
overview.max_new_code_period_from_x=Max New Code from: {0}