Commit 5cad4bd7 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ph/42724/removeAsyncMRWidgetFlag' into 'master'

Remove async merge request widget feature flag

Closes #42724

See merge request gitlab-org/gitlab!23594
parents ae2a6b64 2cee77dc
......@@ -4,6 +4,7 @@ import { mapActions, mapState, mapGetters } from 'vuex';
import store from 'ee_else_ce/mr_notes/stores';
import notesApp from '../notes/components/notes_app.vue';
import discussionKeyboardNavigator from '../notes/components/discussion_keyboard_navigator.vue';
import initWidget from '../vue_merge_request_widget';
export default () => {
// eslint-disable-next-line no-new
......@@ -32,11 +33,22 @@ export default () => {
...mapState({
activeTab: state => state.page.activeTab,
}),
isShowTabActive() {
return this.activeTab === 'show';
},
},
watch: {
discussionTabCounter() {
this.updateDiscussionTabCounter();
},
isShowTabActive: {
handler(newVal) {
if (newVal) {
initWidget();
}
},
immediate: true,
},
},
created() {
this.setActiveTab(window.mrTabs.getCurrentAction());
......@@ -69,7 +81,7 @@ export default () => {
noteableData: this.noteableData,
notesData: this.notesData,
userData: this.currentUserData,
shouldShow: this.activeTab === 'show',
shouldShow: this.isShowTabActive,
helpPagePath: this.helpPagePath,
},
}),
......
......@@ -7,7 +7,6 @@ import initPipelines from '~/commit/pipelines/pipelines_bundle';
import initVueIssuableSidebarApp from '~/issuable_sidebar/sidebar_bundle';
import initSourcegraph from '~/sourcegraph';
import initPopover from '~/mr_tabs_popover';
import initWidget from '../../../vue_merge_request_widget';
export default function() {
new ZenMode(); // eslint-disable-line no-new
......@@ -20,7 +19,6 @@ export default function() {
new ShortcutsIssuable(true); // eslint-disable-line no-new
handleLocationHash();
howToMerge();
initWidget();
initSourcegraph();
const tabHighlightEl = document.querySelector('.js-tabs-feature-highlight');
......
......@@ -5,6 +5,8 @@ import Translate from '../vue_shared/translate';
Vue.use(Translate);
export default () => {
if (gl.mrWidget) return;
gl.mrWidgetData.gitlabLogo = gon.gitlab_logo;
const vm = new Vue(MrWidgetOptions);
......
......@@ -135,15 +135,11 @@ export default {
},
},
mounted() {
if (gon && gon.features && gon.features.asyncMrWidget) {
MRWidgetService.fetchInitialData()
.then(({ data }) => this.initWidget(data))
.catch(() =>
createFlash(__('Unable to load the merge request widget. Try reloading the page.')),
);
} else {
this.initWidget();
}
MRWidgetService.fetchInitialData()
.then(({ data }) => this.initWidget(data))
.catch(() =>
createFlash(__('Unable to load the merge request widget. Try reloading the page.')),
);
},
beforeDestroy() {
eventHub.$off('mr.discussion.updated', this.checkStatus);
......
......@@ -25,7 +25,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action do
push_frontend_feature_flag(:vue_issuable_sidebar, @project.group)
push_frontend_feature_flag(:async_mr_widget, @project)
end
around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
......
......@@ -67,14 +67,6 @@ class MergeRequestWidgetEntity < Grape::Entity
end
end
def as_json(options = {})
return super(options) if Feature.enabled?(:async_mr_widget)
super(options)
.merge(MergeRequestPollCachedWidgetEntity.new(object, **@options.opts_hash).as_json(options))
.merge(MergeRequestPollWidgetEntity.new(object, **@options.opts_hash).as_json(options))
end
private
delegate :current_user, to: :request
......
---
title: Fetch merge request widget data asynchronous
merge_request: 23594
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment