diff options
3 files changed, 17 insertions, 13 deletions
diff --git a/app/assets/javascripts/init_issuable_sidebar.js b/app/assets/javascripts/init_issuable_sidebar.js index 1191e0b895e..ada693afc46 100644 --- a/app/assets/javascripts/init_issuable_sidebar.js +++ b/app/assets/javascripts/init_issuable_sidebar.js @@ -14,7 +14,6 @@ export default () => { }); new LabelsSelect(); new IssuableContext(sidebarOptions.currentUser); - gl.Subscription.bindAll('.subscription'); new DueDateSelectors(); window.sidebar = new Sidebar(); }; diff --git a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue index 4ad3d469f25..2282f5cc934 100644 --- a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue +++ b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue @@ -1,16 +1,17 @@ <script> -import Store from '../../stores/sidebar_store'; -import Mediator from '../../sidebar_mediator'; import eventHub from '../../event_hub'; import Flash from '../../../flash'; import subscriptions from './subscriptions.vue'; export default { - data() { - return { - mediator: new Mediator(), - store: new Store(), - }; + props: { + mediator: { + required: true, + type: Object, + validator(mediatorObject) { + return mediatorObject.toggleSubscription && mediatorObject.store; + }, + }, }, components: { @@ -39,7 +40,7 @@ export default { <template> <div class="block subscriptions"> <subscriptions - :loading="store.isFetching.subscriptions" - :subscribed="store.subscribed" /> + :loading="mediator.store.isFetching.subscriptions" + :subscribed="mediator.store.subscribed" /> </div> </template> diff --git a/app/assets/javascripts/sidebar/sidebar_bundle.js b/app/assets/javascripts/sidebar/sidebar_bundle.js index 2650bb725d4..a76dc53a17b 100644 --- a/app/assets/javascripts/sidebar/sidebar_bundle.js +++ b/app/assets/javascripts/sidebar/sidebar_bundle.js @@ -66,7 +66,7 @@ function mountParticipantsComponent() { }); } -function mountSubscriptionsComponent() { +function mountSubscriptionsComponent(mediator) { const el = document.querySelector('.js-sidebar-subscriptions-entry-point'); if (!el) return; @@ -77,7 +77,11 @@ function mountSubscriptionsComponent() { components: { sidebarSubscriptions, }, - render: createElement => createElement('sidebar-subscriptions', {}), + render: createElement => createElement('sidebar-subscriptions', { + props: { + mediator, + }, + }), }); } @@ -96,7 +100,7 @@ function domContentLoaded() { mountConfidentialComponent(mediator); mountLockComponent(mediator); mountParticipantsComponent(); - mountSubscriptionsComponent(); + mountSubscriptionsComponent(mediator); new SidebarMoveIssue( mediator, |