Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 06:08:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 06:08:49 +0300
commit996c6bf06f602ada62e3f754c121c17051072892 (patch)
treec7568793468de0faef693795e00f34c07da8e793 /app/assets/javascripts
parent0a0e82d1440b06650e5fc524168b1f50a8feec68 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js20
-rw-r--r--app/assets/javascripts/releases/components/release_block_header.vue4
2 files changed, 19 insertions, 5 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index 9ed286826cc..f857e618d89 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -142,11 +142,25 @@ export const stripHtml = (string, replace = '') => {
};
/**
- * Converts snake_case string to camelCase
+ * Converts a snake_cased string to camelCase.
+ * Leading and trailing underscores are ignored.
*
- * @param {*} string
+ * @param {String} string The snake_cased string to convert
+ * @returns {String} A camelCased version of the string
+ *
+ * @example
+ *
+ * // returns "aSnakeCasedString"
+ * convertToCamelCase('a_snake_cased_string')
+ *
+ * // returns "_leadingUnderscore"
+ * convertToCamelCase('_leading_underscore')
+ *
+ * // returns "trailingUnderscore_"
+ * convertToCamelCase('trailing_underscore_')
*/
-export const convertToCamelCase = string => string.replace(/(_\w)/g, s => s[1].toUpperCase());
+export const convertToCamelCase = string =>
+ string.replace(/([a-z0-9])_([a-z0-9])/gi, (match, p1, p2) => `${p1}${p2.toUpperCase()}`);
/**
* Converts camelCase string to snake_case
diff --git a/app/assets/javascripts/releases/components/release_block_header.vue b/app/assets/javascripts/releases/components/release_block_header.vue
index f0d3f3f8c1d..0bc2a5ce2eb 100644
--- a/app/assets/javascripts/releases/components/release_block_header.vue
+++ b/app/assets/javascripts/releases/components/release_block_header.vue
@@ -20,10 +20,10 @@ export default {
},
computed: {
editLink() {
- return this.release.Links?.editUrl;
+ return this.release._links?.editUrl;
},
selfLink() {
- return this.release.Links?.self;
+ return this.release._links?.self;
},
},
};