summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-04-07 04:42:16 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-04-07 04:42:16 +0000
commitae91b3219aa0b5de20e3452126384341acef75c6 (patch)
tree938bb77b852fed9ada6eb449783343dd8f7faa44
parent8f372152774119440ba41f2603eac4f475a601f6 (diff)
parent815282da1c1abe1176ca9b8851a614023b44fd12 (diff)
downloadgitlab-ce-ae91b3219aa0b5de20e3452126384341acef75c6.tar.gz
Merge branch '59621-order-labels-alphabetically-in-issue-boards' into 'master'
Resolve "Order labels alphabetically in issue boards" Closes #59621 See merge request gitlab-org/gitlab-ce!26927
-rw-r--r--app/assets/javascripts/boards/components/issue_card_inner.vue6
-rw-r--r--changelogs/unreleased/59621-order-labels-alphabetically-in-issue-boards.yml5
2 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/components/issue_card_inner.vue b/app/assets/javascripts/boards/components/issue_card_inner.vue
index 90ab3a76342..206573dd444 100644
--- a/app/assets/javascripts/boards/components/issue_card_inner.vue
+++ b/app/assets/javascripts/boards/components/issue_card_inner.vue
@@ -1,4 +1,5 @@
<script>
+import _ from 'underscore';
import { GlTooltipDirective } from '@gitlab/ui';
import { sprintf, __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
@@ -92,6 +93,9 @@ export default {
const { referencePath, groupId } = this.issue;
return !groupId ? referencePath.split('#')[0] : null;
},
+ orderedLabels() {
+ return _.sortBy(this.issue.labels, 'title');
+ },
},
methods: {
isIndexLessThanlimit(index) {
@@ -176,7 +180,7 @@ export default {
</div>
<div v-if="showLabelFooter" class="board-card-labels prepend-top-4 d-flex flex-wrap">
<button
- v-for="label in issue.labels"
+ v-for="label in orderedLabels"
v-if="showLabel(label)"
:key="label.id"
v-gl-tooltip
diff --git a/changelogs/unreleased/59621-order-labels-alphabetically-in-issue-boards.yml b/changelogs/unreleased/59621-order-labels-alphabetically-in-issue-boards.yml
new file mode 100644
index 00000000000..8b82d757303
--- /dev/null
+++ b/changelogs/unreleased/59621-order-labels-alphabetically-in-issue-boards.yml
@@ -0,0 +1,5 @@
+---
+title: Order labels alphabetically in issue boards
+merge_request: 26927
+author:
+type: changed