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
fd47fa51
Commit
fd47fa51
authored
May 04, 2018
by
Kushal Pandya
Committed by
Mario de la Ossa
May 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change `subscription` store property to `subscribed`
parent
9c1e042d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
...sets/javascripts/epics/sidebar/components/sidebar_app.vue
+6
-6
ee/app/assets/javascripts/epics/sidebar/services/sidebar_service.js
...ets/javascripts/epics/sidebar/services/sidebar_service.js
+1
-1
ee/app/assets/javascripts/epics/sidebar/stores/sidebar_store.js
.../assets/javascripts/epics/sidebar/stores/sidebar_store.js
+1
-5
spec/javascripts/epics/sidebar/stores/sidebar_store_spec.js
spec/javascripts/epics/sidebar/stores/sidebar_store_spec.js
+9
-0
No files found.
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
View file @
fd47fa51
...
...
@@ -177,13 +177,13 @@
this
.
toggleSidebar
();
}
},
handleToggleSubscri
ption
()
{
this
.
service
.
toggleSubscri
ption
()
handleToggleSubscri
bed
()
{
this
.
service
.
toggleSubscri
bed
()
.
then
(()
=>
{
this
.
store
.
setSubscri
ption
(
!
this
.
store
.
subscription
);
this
.
store
.
setSubscri
bed
(
!
this
.
store
.
subscribed
);
})
.
catch
(()
=>
{
if
(
this
.
store
.
subscri
ption
)
{
if
(
this
.
store
.
subscri
bed
)
{
Flash
(
__
(
'
An error occurred while unsubscribing to notifications.
'
));
}
else
{
Flash
(
__
(
'
An error occurred while subscribing to notifications.
'
));
...
...
@@ -260,8 +260,8 @@
/>
<sidebar-subscriptions
:loading=
"savingSubscription"
:subscribed=
"store.subscri
ption
"
@
toggleSubscription=
"handleToggleSubscri
ption
"
:subscribed=
"store.subscri
bed
"
@
toggleSubscription=
"handleToggleSubscri
bed
"
@
toggleCollapse=
"toggleSidebar"
/>
</div>
...
...
ee/app/assets/javascripts/epics/sidebar/services/sidebar_service.js
View file @
fd47fa51
...
...
@@ -14,7 +14,7 @@ export default class SidebarService {
return
axios
.
put
(
this
.
endpoint
,
{
end_date
:
endDate
});
}
toggleSubscri
ption
()
{
toggleSubscri
bed
()
{
return
axios
.
post
(
this
.
subscriptionEndpoint
);
}
}
ee/app/assets/javascripts/epics/sidebar/stores/sidebar_store.js
View file @
fd47fa51
...
...
@@ -15,11 +15,7 @@ export default class SidebarStore {
return
this
.
endDate
?
parsePikadayDate
(
this
.
endDate
)
:
null
;
}
get
subscription
()
{
return
this
.
subscribed
;
}
setSubscription
(
subscribed
)
{
setSubscribed
(
subscribed
)
{
this
.
subscribed
=
subscribed
;
}
}
spec/javascripts/epics/sidebar/stores/sidebar_store_spec.js
View file @
fd47fa51
...
...
@@ -54,4 +54,13 @@ describe('Sidebar Store', () => {
expect
(
date
.
getFullYear
()).
toEqual
(
2017
);
});
});
describe
(
'
setSubscribed
'
,
()
=>
{
it
(
'
should set store.subscribed value
'
,
()
=>
{
const
store
=
new
SidebarStore
({
subscribed
:
true
});
store
.
setSubscribed
(
false
);
expect
(
store
.
subscribed
).
toEqual
(
false
);
});
});
});
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