'click .js-all': 'onAllClick',
'click .js-last-week': 'onLastWeekClick',
'click .js-last-month': 'onLastMonthClick',
- 'click .js-last-year': 'onLastYearClick'
+ 'click .js-last-year': 'onLastYearClick',
+ 'click .js-leak': 'onLeakClick'
});
},
createdAfter: null,
createdBefore: null,
createdAt: null,
+ sinceLeakPeriod: null,
createdInLast: null
});
},
createdAfter: periodStart,
createdBefore: periodEnd,
createdAt: null,
+ sinceLeakPeriod: null,
createdInLast: null
});
},
createdAfter: null,
createdBefore: null,
createdAt: null,
+ sinceLeakPeriod: null,
createdInLast: period
});
},
return this.selectPeriod('1y');
},
+ onLeakClick (e) {
+ e.preventDefault();
+ this.options.app.state.updateFilter({
+ createdAfter: null,
+ createdBefore: null,
+ createdAt: null,
+ createdInLast: null,
+ sinceLeakPeriod: 'true'
+ });
+ },
+
serializeData () {
+ const hasLeak = this.options.app.state.get('contextComponentQualifier') === 'TRK';
+
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
+ hasLeak,
periodStart: this.options.app.state.get('query').createdAfter,
periodEnd: this.options.app.state.get('query').createdBefore,
createdAt: this.options.app.state.get('query').createdAt,
+ sinceLeakPeriod: this.options.app.state.get('query').sinceLeakPeriod,
createdInLast: this.options.app.state.get('query').createdInLast
});
}
'assigned': 'assignees',
'createdBefore': 'createdAt',
'createdAfter': 'createdAt',
+ 'sinceLeakPeriod': 'createdAt',
'createdInLast': 'createdAt'
}
},
<div class="spacer-top">
<span class="spacer-right">{{t "issues.facet.createdAt.or"}}</span>
<a class="js-all spacer-right" href="#">{{t "issues.facet.createdAt.all"}}</a>
- <a class="js-last-week spacer-right {{#eq createdInLast "1w"}}active-link{{/eq}}" href="#">{{t "issues.facet.createdAt.last_week"}}</a>
- <a class="js-last-month spacer-right {{#eq createdInLast "1m"}}active-link{{/eq}}" href="#">{{t "issues.facet.createdAt.last_month"}}</a>
- <a class="js-last-year {{#eq createdInLast "1y"}}active-link{{/eq}}" href="#">{{t "issues.facet.createdAt.last_year"}}</a>
+ {{#if hasLeak}}
+ <a class="js-leak spacer-right {{#eq sinceLeakPeriod "true"}}active-link{{/eq}}" href="#">Leak Period</a>
+ {{else}}
+ <a class="js-last-week spacer-right {{#eq createdInLast "1w"}}active-link{{/eq}}" href="#">
+ {{t "issues.facet.createdAt.last_week"}}
+ </a>
+ <a class="js-last-month spacer-right {{#eq createdInLast "1m"}}active-link{{/eq}}" href="#">
+ {{t "issues.facet.createdAt.last_month"}}
+ </a>
+ <a class="js-last-year {{#eq createdInLast "1y"}}active-link{{/eq}}" href="#">
+ {{t "issues.facet.createdAt.last_year"}}
+ </a>
+ {{/if}}
</div>
</div>
{{/if}}
const { snapshotDate } = this.props.component;
const formattedSnapshotDate = moment(snapshotDate).format('LLL');
- const createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ');
const newDebt = this.props.leak['new_technical_debt'] || 0;
const newCodeSmells = this.props.leak['new_code_smells'] || 0;
return <DomainLeak>
<MeasuresList>
<Measure label={getMetricName('new_effort')}>
- <IssuesLink
- component={this.props.component.key}
- params={{ resolved: 'false', createdAfter, types: 'CODE_SMELL', facetMode: 'debt' }}>
+ <DrilldownLink component={this.props.component.key} metric="new_technical_debt">
<span
title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
data-toggle="tooltip">
{formatMeasure(newDebt, 'SHORT_WORK_DUR')}
</span>
- </IssuesLink>
+ </DrilldownLink>
</Measure>
<Measure label={getMetricName('new_code_smells')}>
<IssuesLink
component={this.props.component.key}
- params={{ resolved: 'false', types: 'CODE_SMELL', createdAfter }}>
+ params={{ resolved: 'false', types: 'CODE_SMELL', sinceLeakPeriod: 'true' }}>
<span
title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
data-toggle="tooltip">
className="overview-domain-measure-value"
title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
data-toggle="tooltip">
- <IssuesLink
- component={this.props.component.key}
- params={{ resolved: 'false', types: 'CODE_SMELL', facetMode: 'debt' }}>
+ <DrilldownLink component={this.props.component.key} metric="sqale_index">
{formatMeasure(debt, 'SHORT_WORK_DUR')}
- </IssuesLink>
+ </DrilldownLink>
</div>
<div className="overview-domain-measure-label">{getMetricName('effort')}</div>
</div>
const { snapshotDate } = this.props.component;
const formattedSnapshotDate = moment(snapshotDate).format('LLL');
- const createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ');
const newBugs = this.props.leak['new_bugs'] || 0;
const newVulnerabilities = this.props.leak['new_vulnerabilities'] || 0;
<Measure label={getMetricName('new_bugs')}>
<IssuesLink
component={this.props.component.key}
- params={{ resolved: 'false', types: 'BUG', createdAfter }}>
+ params={{ resolved: 'false', types: 'BUG', sinceLeakPeriod: 'true' }}>
<span
title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
data-toggle="tooltip">
<Measure label={getMetricName('new_vulnerabilities')}>
<IssuesLink
component={this.props.component.key}
- params={{ resolved: 'false', types: 'VULNERABILITY', createdAfter }}>
+ params={{ resolved: 'false', types: 'VULNERABILITY', sinceLeakPeriod: 'true' }}>
<span
title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
data-toggle="tooltip">