diff options
Diffstat (limited to 'app/assets/javascripts')
4 files changed, 20 insertions, 11 deletions
diff --git a/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue b/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue index 1dcdb65d5c7..cc4b2dacab3 100644 --- a/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue +++ b/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue @@ -1,6 +1,7 @@ <script> import Icon from '~/vue_shared/components/icon.vue'; import { n__, __, sprintf } from '~/locale'; +import { getParameterByName, parseBoolean } from '~/lib/utils/common_utils'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; export default { @@ -94,6 +95,9 @@ export default { } return version.versionIndex === -1; }, + isHead() { + return parseBoolean(getParameterByName('diff_head')); + }, isLatest(version) { return ( this.mergeRequestVersion && version.version_index === this.targetVersions[0].version_index @@ -121,7 +125,8 @@ export default { <div> <strong> {{ versionName(version) }} - <template v-if="isBase(version)">{{ + <template v-if="isHead()">{{ s__('DiffsCompareBaseBranch|(HEAD)') }}</template> + <template v-else-if="isBase(version)">{{ s__('DiffsCompareBaseBranch|(base)') }}</template> </strong> diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js index ffcb0f24cc6..c901971be50 100644 --- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js +++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js @@ -134,6 +134,10 @@ export default () => { axios .get(dataset.testReportsCountEndpoint) .then(({ data }) => { + if (!data.total_count) { + return; + } + document.querySelector('.js-test-report-badge-counter').innerHTML = data.total_count; }) .catch(() => {}); diff --git a/app/assets/javascripts/profile/account/components/update_username.vue b/app/assets/javascripts/profile/account/components/update_username.vue index 72867ecd709..fa09e063552 100644 --- a/app/assets/javascripts/profile/account/components/update_username.vue +++ b/app/assets/javascripts/profile/account/components/update_username.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import axios from '~/lib/utils/axios_utils'; import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue'; import { s__, sprintf } from '~/locale'; @@ -43,10 +43,10 @@ You are going to change the username %{currentUsernameBold} to %{newUsernameBold Profile and projects will be redirected to the %{newUsername} namespace but this redirect will expire once the %{currentUsername} namespace is registered by another user or group. Please update your Git repository remotes as soon as possible.`), { - currentUsernameBold: `<strong>${_.escape(this.username)}</strong>`, - newUsernameBold: `<strong>${_.escape(this.newUsername)}</strong>`, - currentUsername: _.escape(this.username), - newUsername: _.escape(this.newUsername), + currentUsernameBold: `<strong>${esc(this.username)}</strong>`, + newUsernameBold: `<strong>${esc(this.newUsername)}</strong>`, + currentUsername: esc(this.username), + newUsername: esc(this.newUsername), }, false, ); diff --git a/app/assets/javascripts/profile/gl_crop.js b/app/assets/javascripts/profile/gl_crop.js index 880e1a88975..55bc9fb8955 100644 --- a/app/assets/javascripts/profile/gl_crop.js +++ b/app/assets/javascripts/profile/gl_crop.js @@ -2,7 +2,7 @@ import $ from 'jquery'; import 'cropper'; -import _ from 'underscore'; +import { isString } from 'lodash'; (() => { // Matches everything but the file name @@ -29,7 +29,7 @@ import _ from 'underscore'; this.onModalShow = this.onModalShow.bind(this); this.onPickImageClick = this.onPickImageClick.bind(this); this.fileInput = $(input); - this.modalCropImg = _.isString(this.modalCropImg) ? $(this.modalCropImg) : this.modalCropImg; + this.modalCropImg = isString(this.modalCropImg) ? $(this.modalCropImg) : this.modalCropImg; this.fileInput .attr('name', `${this.fileInput.attr('name')}-trigger`) .attr('id', `${this.fileInput.attr('id')}-trigger`); @@ -47,9 +47,9 @@ import _ from 'underscore'; this.filename = this.getElement(filename); this.previewImage = this.getElement(previewImage); this.pickImageEl = this.getElement(pickImageEl); - this.modalCrop = _.isString(modalCrop) ? $(modalCrop) : modalCrop; - this.uploadImageBtn = _.isString(uploadImageBtn) ? $(uploadImageBtn) : uploadImageBtn; - this.modalCropImg = _.isString(modalCropImg) ? $(modalCropImg) : modalCropImg; + this.modalCrop = isString(modalCrop) ? $(modalCrop) : modalCrop; + this.uploadImageBtn = isString(uploadImageBtn) ? $(uploadImageBtn) : uploadImageBtn; + this.modalCropImg = isString(modalCropImg) ? $(modalCropImg) : modalCropImg; this.cropActionsBtn = this.modalCrop.find('[data-method]'); this.bindEvents(); } |