summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/components/description.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/issue_show/components/description.vue')
-rw-r--r--app/assets/javascripts/issue_show/components/description.vue30
1 files changed, 17 insertions, 13 deletions
diff --git a/app/assets/javascripts/issue_show/components/description.vue b/app/assets/javascripts/issue_show/components/description.vue
index 5ae617356e0..43db66c8e08 100644
--- a/app/assets/javascripts/issue_show/components/description.vue
+++ b/app/assets/javascripts/issue_show/components/description.vue
@@ -37,23 +37,12 @@
});
},
taskStatus() {
- const taskRegexMatches = this.taskStatus.match(/(\d+) of (\d+)/);
- const $issuableHeader = $('.issuable-meta');
- const $tasks = $('#task_status', $issuableHeader);
- const $tasksShort = $('#task_status_short', $issuableHeader);
-
- if (taskRegexMatches) {
- $tasks.text(this.taskStatus);
- $tasksShort.text(`${taskRegexMatches[1]}/${taskRegexMatches[2]} task${taskRegexMatches[2] > 1 ? 's' : ''}`);
- } else {
- $tasks.text('');
- $tasksShort.text('');
- }
+ this.updateTaskStatusText();
},
},
methods: {
renderGFM() {
- $(this.$refs['gfm-entry-content']).renderGFM();
+ $(this.$refs['gfm-content']).renderGFM();
if (this.canUpdate) {
// eslint-disable-next-line no-new
@@ -64,9 +53,24 @@
});
}
},
+ updateTaskStatusText() {
+ const taskRegexMatches = this.taskStatus.match(/(\d+) of ((?!0)\d+)/);
+ const $issuableHeader = $('.issuable-meta');
+ const $tasks = $('#task_status', $issuableHeader);
+ const $tasksShort = $('#task_status_short', $issuableHeader);
+
+ if (taskRegexMatches) {
+ $tasks.text(this.taskStatus);
+ $tasksShort.text(`${taskRegexMatches[1]}/${taskRegexMatches[2]} task${taskRegexMatches[2] > 1 ? 's' : ''}`);
+ } else {
+ $tasks.text('');
+ $tasksShort.text('');
+ }
+ },
},
mounted() {
this.renderGFM();
+ this.updateTaskStatusText();
},
};
</script>