Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
342fbbda
Commit
342fbbda
authored
May 03, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consume `toggleSubscription` event directly from Subscriptions component
parent
d2665707
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue
...idebar/components/subscriptions/sidebar_subscriptions.vue
+1
-7
spec/javascripts/sidebar/sidebar_subscriptions_spec.js
spec/javascripts/sidebar/sidebar_subscriptions_spec.js
+1
-2
No files found.
app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue
View file @
342fbbda
<
script
>
import
Store
from
'
../../stores/sidebar_store
'
;
import
eventHub
from
'
../../event_hub
'
;
import
Flash
from
'
../../../flash
'
;
import
{
__
}
from
'
../../../locale
'
;
import
subscriptions
from
'
./subscriptions.vue
'
;
...
...
@@ -20,12 +19,6 @@ export default {
store
:
new
Store
(),
};
},
created
()
{
eventHub
.
$on
(
'
toggleSubscription
'
,
this
.
onToggleSubscription
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
toggleSubscription
'
,
this
.
onToggleSubscription
);
},
methods
:
{
onToggleSubscription
()
{
this
.
mediator
.
toggleSubscription
()
...
...
@@ -42,6 +35,7 @@ export default {
<subscriptions
:loading=
"store.isFetching.subscriptions"
:subscribed=
"store.subscribed"
@
toggleSubscription=
"onToggleSubscription"
/>
</div>
</
template
>
spec/javascripts/sidebar/sidebar_subscriptions_spec.js
View file @
342fbbda
...
...
@@ -3,7 +3,6 @@ import sidebarSubscriptions from '~/sidebar/components/subscriptions/sidebar_sub
import
SidebarMediator
from
'
~/sidebar/sidebar_mediator
'
;
import
SidebarService
from
'
~/sidebar/services/sidebar_service
'
;
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
Mock
from
'
./mock_data
'
;
...
...
@@ -32,7 +31,7 @@ describe('Sidebar Subscriptions', function () {
mediator
,
});
eventHub
.
$emit
(
'
toggleSubscription
'
);
vm
.
onToggleSubscription
(
);
expect
(
mediator
.
toggleSubscription
).
toHaveBeenCalled
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment