From 43a25d93ebdabea52f99b05e15b06250cd8f07d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 16:05:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-0-stable-ee --- app/assets/javascripts/commons/bootstrap.js | 4 ---- app/assets/javascripts/commons/nav/user_merge_requests.js | 12 ++++++++++++ app/assets/javascripts/commons/vue.js | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'app/assets/javascripts/commons') diff --git a/app/assets/javascripts/commons/bootstrap.js b/app/assets/javascripts/commons/bootstrap.js index e5e23f2fb5e..17c9f55a8a0 100644 --- a/app/assets/javascripts/commons/bootstrap.js +++ b/app/assets/javascripts/commons/bootstrap.js @@ -1,10 +1,6 @@ import $ from 'jquery'; // bootstrap jQuery plugins -import 'bootstrap/js/dist/alert'; -import 'bootstrap/js/dist/button'; -import 'bootstrap/js/dist/collapse'; -import 'bootstrap/js/dist/modal'; import 'bootstrap/js/dist/dropdown'; import 'bootstrap/js/dist/tab'; diff --git a/app/assets/javascripts/commons/nav/user_merge_requests.js b/app/assets/javascripts/commons/nav/user_merge_requests.js index b105273ece7..90dca0310f3 100644 --- a/app/assets/javascripts/commons/nav/user_merge_requests.js +++ b/app/assets/javascripts/commons/nav/user_merge_requests.js @@ -30,6 +30,12 @@ function updateMergeRequestCounts(newCount) { * Refresh user counts (and broadcast if open) */ export function refreshUserMergeRequestCounts() { + if (gon?.use_new_navigation) { + // The new sidebar manages _all_ the counts in + // ~/super_sidebar/user_counts_manager.js + document.dispatchEvent(new CustomEvent('userCounts:fetch')); + return Promise.resolve(); + } return getUserCounts() .then(({ data }) => { const assignedMergeRequests = data.assigned_merge_requests; @@ -67,6 +73,12 @@ export function closeUserCountsBroadcast() { * no special functionality lost except cross tab notifications */ export function openUserCountsBroadcast() { + if (gon?.use_new_navigation) { + // The new sidebar broadcasts _all counts_ and updates + // them accordingly. Therefore we do not need this manager + // ~/super_sidebar/user_counts_manager.js + return; + } closeUserCountsBroadcast(); if (window.BroadcastChannel) { diff --git a/app/assets/javascripts/commons/vue.js b/app/assets/javascripts/commons/vue.js index cd24a503631..09d2e065e58 100644 --- a/app/assets/javascripts/commons/vue.js +++ b/app/assets/javascripts/commons/vue.js @@ -9,4 +9,4 @@ if (process.env.NODE_ENV !== 'production') { Vue.use(GlFeatureFlagsPlugin); Vue.use(Translate); -Vue.config.ignoredElements = ['gl-emoji']; +Vue.config.ignoredElements = ['gl-emoji', 'copy-code']; -- cgit v1.2.3