const textBuilder = results => { const { failed, resolved, total } = results; const failedString = failed ? n__('%d failed test result', '%d failed test results', failed) : null; const resolvedString = resolved ? n__('%d fixed test result', '%d fixed test results', resolved) : null; const totalString = total ? n__('out of %d total test', 'out of %d total tests', total) : null; let resultsString = s__('Reports|no changed test results'); if (failed) { if (resolved) { resultsString = sprintf(s__('Reports|%{failedString} and %{resolvedString}'), { failedString, resolvedString, }); } else { resultsString = failedString; } } else if (resolved) { resultsString = resolvedString; } return `${resultsString} ${totalString}`; };
ContributorsStatGraph.prototype.format_author_commit_info = function(author) { var commits; commits = $('<span/>', { "class": 'graph-author-commits-count' }); commits.text(n__('%d commit', '%d commits', author.commits)); return $('<span/>').append(commits); };
populateActiveMetrics(metrics) { let totalMonitoredMetrics = 0; let totalMissingEnvVarMetrics = 0; let totalExporters = 0; metrics.forEach((metric) => { if (metric.active_metrics > 0) { totalExporters += 1; this.$monitoredMetricsList.append(`<li>${_.escape(metric.group)}<span class="badge">${_.escape(metric.active_metrics)}</span></li>`); totalMonitoredMetrics += metric.active_metrics; if (metric.metrics_missing_requirements > 0) { this.$missingEnvVarMetricsList.append(`<li>${_.escape(metric.group)}</li>`); totalMissingEnvVarMetrics += 1; } } }); if (totalMonitoredMetrics === 0) { const emptyCommonMetricsText = sprintf(s__('PrometheusService|<p class="text-tertiary">No <a href="%{docsUrl}">common metrics</a> were found</p>'), { docsUrl: this.helpMetricsPath, }, false); this.$monitoredMetricsEmpty.empty(); this.$monitoredMetricsEmpty.append(emptyCommonMetricsText); this.showMonitoringMetricsPanelState(PANEL_STATE.EMPTY); } else { const metricsCountText = sprintf(s__('PrometheusService|%{exporters} with %{metrics} were found'), { exporters: n__('%d exporter', '%d exporters', totalExporters), metrics: n__('%d metric', '%d metrics', totalMonitoredMetrics), }); this.$monitoredMetricsCount.text(metricsCountText); this.showMonitoringMetricsPanelState(PANEL_STATE.LIST); if (totalMissingEnvVarMetrics > 0) { this.$missingEnvVarPanel.removeClass('hidden'); this.$missingEnvVarMetricCount.text(totalMissingEnvVarMetrics); } } }
}, boardId: { type: String, required: true, }, }, data() { return { detailIssue: boardsStore.detail, filter: boardsStore.filter, }; }, computed: { counterTooltip() { const { issuesSize } = this.list; return `${n__('%d issue', '%d issues', issuesSize)}`; }, isNewIssueShown() { return ( this.list.type === 'backlog' || (!this.disabled && this.list.type !== 'closed' && this.list.type !== 'blank') ); }, }, watch: { filter: { handler() { this.list.page = 1; this.list.getIssues(true).catch(() => { // TODO: handle request error });
notesSubset() { let notes = []; if (this.discussion) { notes = Object.keys(this.discussion.notes) .slice(0, this.shownAvatars) .map(noteId => this.discussion.notes[noteId]); } return notes; }, extraNotesTitle() { if (this.discussion) { const extra = this.discussion.notesCount() - this.shownAvatars; return n__('%d more comment', '%d more comments', extra); } return ''; }, discussion() { return this.storeState[this.discussionId]; }, notesCount() { if (this.discussion) { return this.discussion.notesCount(); } return 0; }, moreText() {