summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorConstance Okoghenun <cokoghenun@gitlab.com>2019-04-12 15:32:24 +0000
committerClement Ho <clemmakesapps@gmail.com>2019-04-12 15:32:24 +0000
commita3966d92cff14f7baf1f4f94902461480c9023de (patch)
tree9e4367320028d52f9450b0f3d5f80e3297a32a2b /app/assets/javascripts/lib
parented7a558c79a883d3d70d81f08db283d97b4bd90d (diff)
downloadgitlab-ce-a3966d92cff14f7baf1f4f94902461480c9023de.tar.gz
CE backport of Add Snowplow tracking to notes
Bacport of Snowplow tracking for - Reply comment button - Start discussion and Comment buttons
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index 3f5fc5dd306..cc1d85fd97d 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -51,6 +51,13 @@ export const dasherize = str => str.replace(/[_\s]+/g, '-');
export const slugifyWithHyphens = str => str.toLowerCase().replace(/\s+/g, '-');
/**
+ * Replaces whitespaces with underscore and converts to lower case
+ * @param {String} str
+ * @returns {String}
+ */
+export const slugifyWithUnderscore = str => str.toLowerCase().replace(/\s+/g, '_');
+
+/**
* Truncates given text
*
* @param {String} string