type Condition = {
comparator: string,
errorThreshold?: string,
- metricKey: string,
+ metric: string,
onLeak: boolean,
status: string,
value: string,
props: Props;
renderCondition = (condition: Condition) => {
- const metric = this.props.metrics[condition.metricKey];
+ const metric = this.props.metrics[condition.metric];
const metricName = getLocalizedMetricName(metric);
const threshold = condition.errorThreshold || condition.warningThreshold;
- const isDiff = isDiffMetric(condition.metricKey);
+ const isDiff = isDiffMetric(condition.metric);
return (
- <li key={condition.metricKey}>
+ <li key={condition.metric}>
<span className="text-limited">
<strong>{formatMeasure(condition.value, metric.type)}</strong> {metricName}
{!isDiff && condition.onLeak && ' ' + translate('quality_gates.conditions.leak')}
conditions: [
{
status: 'ERROR',
- metricKey: 'new_coverage',
+ metric: 'new_coverage',
comparator: 'LT',
onLeak: true,
errorThreshold: '85',
},
{
status: 'WARN',
- metricKey: 'bugs',
+ metric: 'bugs',
comparator: 'GT',
onLeak: false,
warningThreshold: '0',
},
{
status: 'ERROR',
- metricKey: 'bugs',
+ metric: 'bugs',
comparator: 'GT',
onLeak: true,
warningThreshold: '0',
},
{
status: 'OK',
- metricKey: 'skipped_tests',
+ metric: 'skipped_tests',
comparator: 'GT',
onLeak: false,
warningThreshold: '0',