summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/common_utils.js
diff options
context:
space:
mode:
authorRajat Jain <rjain@gitlab.com>2019-04-15 09:58:30 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-04-15 09:58:30 +0000
commitb5ab1d91e377787e0711effebce073af76becc56 (patch)
tree3282fbee428f5948302eb622466f5527b01c9117 /app/assets/javascripts/lib/utils/common_utils.js
parentd83eb63beef28a6229b4bf851ee34c51938e29c7 (diff)
downloadgitlab-ce-b5ab1d91e377787e0711effebce073af76becc56.tar.gz
Display scoped labels in Issue Boards
This change brings new Scoped labels to Issue board as well. With the last change, this was missed.
Diffstat (limited to 'app/assets/javascripts/lib/utils/common_utils.js')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index 2906604da57..b236daff1e0 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -724,6 +724,18 @@ export const NavigationType = {
*/
export const isEE = () => window.gon && window.gon.ee;
+/**
+ * Checks if the given Label has a special syntax `::` in
+ * it's title.
+ *
+ * Expected Label to be an Object with `title` as a key:
+ * { title: 'LabelTitle', ...otherProperties };
+ *
+ * @param {Object} label
+ * @returns Boolean
+ */
+export const isScopedLabel = ({ title = '' }) => title.indexOf('::') !== -1;
+
window.gl = window.gl || {};
window.gl.utils = {
...(window.gl.utils || {}),