diff options
Diffstat (limited to 'app/assets/javascripts/labels')
-rw-r--r-- | app/assets/javascripts/labels/components/delete_label_modal.vue | 13 | ||||
-rw-r--r-- | app/assets/javascripts/labels/create_label_dropdown.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/labels/index.js | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/app/assets/javascripts/labels/components/delete_label_modal.vue b/app/assets/javascripts/labels/components/delete_label_modal.vue index 1ff0938d086..2be404de1e1 100644 --- a/app/assets/javascripts/labels/components/delete_label_modal.vue +++ b/app/assets/javascripts/labels/components/delete_label_modal.vue @@ -56,6 +56,7 @@ export default { </gl-sprintf> </template> <gl-sprintf + v-if="subjectName" :message=" __( `%{strongStart}${labelName}%{strongEnd} will be permanently deleted from ${subjectName}. This cannot be undone.`, @@ -66,6 +67,18 @@ export default { <strong>{{ content }}</strong> </template> </gl-sprintf> + <gl-sprintf + v-else + :message=" + __( + `%{strongStart}${labelName}%{strongEnd} will be permanently deleted. This cannot be undone.`, + ) + " + > + <template #strong="{ content }"> + <strong>{{ content }}</strong> + </template> + </gl-sprintf> <template #modal-footer> <gl-button category="secondary" @click="closeModal">{{ __('Cancel') }}</gl-button> <gl-button diff --git a/app/assets/javascripts/labels/create_label_dropdown.js b/app/assets/javascripts/labels/create_label_dropdown.js index 8c166158a44..033ca9dd3ea 100644 --- a/app/assets/javascripts/labels/create_label_dropdown.js +++ b/app/assets/javascripts/labels/create_label_dropdown.js @@ -16,6 +16,7 @@ export default class CreateLabelDropdown { this.$colorPreview = $('.js-dropdown-label-color-preview', this.$el); this.$addList = $('.js-add-list', this.$el); this.$newLabelError = $('.js-label-error', this.$el); + this.$newLabelErrorContent = $('.gl-alert-content', this.$newLabelError); this.$newLabelCreateButton = $('.js-new-label-btn', this.$el); this.$colorSuggestions = $('.suggest-colors-dropdown a', this.$el); @@ -119,7 +120,8 @@ export default class CreateLabelDropdown { .join('<br/>'); } - this.$newLabelError.html(errors).show(); + this.$newLabelErrorContent.html(errors); + this.$newLabelError.show(); } else { const addNewList = this.$addList.is(':checked'); this.$dropdownBack.trigger('click'); diff --git a/app/assets/javascripts/labels/index.js b/app/assets/javascripts/labels/index.js index 22a9c0a89c0..e87ad8d9a06 100644 --- a/app/assets/javascripts/labels/index.js +++ b/app/assets/javascripts/labels/index.js @@ -26,7 +26,7 @@ export function initLabels() { if ($('.prioritized-labels').length) { new LabelManager(); // eslint-disable-line no-new } - $('.label-subscription').each((i, el) => { + $('.js-label-subscription').each((i, el) => { const $el = $(el); if ($el.find('.dropdown-group-label').length) { |