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
530d0fda
Commit
530d0fda
authored
Jan 27, 2017
by
Richard Macklin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checkbox in UI to opt into receiving notifications about your activity
parent
3e81bc7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
app/assets/javascripts/profile/profile.js.es6
app/assets/javascripts/profile/profile.js.es6
+1
-0
app/views/profiles/notifications/show.html.haml
app/views/profiles/notifications/show.html.haml
+5
-0
spec/features/profiles/user_changes_notified_of_own_activity_spec.rb
...es/profiles/user_changes_notified_of_own_activity_spec.rb
+32
-0
No files found.
app/assets/javascripts/profile/profile.js.es6
View file @
530d0fda
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
bindEvents() {
bindEvents() {
$('.js-preferences-form').on('change.preference', 'input[type=radio]', this.submitForm);
$('.js-preferences-form').on('change.preference', 'input[type=radio]', this.submitForm);
$('#user_notification_email').on('change', this.submitForm);
$('#user_notification_email').on('change', this.submitForm);
$('#user_notified_of_own_activity').on('change', this.submitForm);
$('.update-username').on('ajax:before', this.beforeUpdateUsername);
$('.update-username').on('ajax:before', this.beforeUpdateUsername);
$('.update-username').on('ajax:complete', this.afterUpdateUsername);
$('.update-username').on('ajax:complete', this.afterUpdateUsername);
$('.update-notifications').on('ajax:success', this.onUpdateNotifs);
$('.update-notifications').on('ajax:success', this.onUpdateNotifs);
...
...
app/views/profiles/notifications/show.html.haml
View file @
530d0fda
...
@@ -34,6 +34,11 @@
...
@@ -34,6 +34,11 @@
.clearfix
.clearfix
=
form_for
@user
,
url:
profile_notifications_path
,
method: :put
do
|
f
|
%label
{
for:
'user_notified_of_own_activity'
}
=
f
.
check_box
:notified_of_own_activity
%span
Receive notifications about your own activity
%hr
%hr
%h5
%h5
Groups (
#{
@group_notifications
.
count
}
)
Groups (
#{
@group_notifications
.
count
}
)
...
...
spec/features/profiles/user_changes_notified_of_own_activity_spec.rb
0 → 100644
View file @
530d0fda
require
'spec_helper'
feature
'Profile > Notifications > User changes notified_of_own_activity setting'
,
feature:
true
,
js:
true
do
let
(
:user
)
{
create
(
:user
)
}
before
do
login_as
(
user
)
end
scenario
'User opts into receiving notifications about their own activity'
do
visit
profile_notifications_path
expect
(
page
).
not_to
have_checked_field
(
'user[notified_of_own_activity]'
)
page
.
find
(
'#user_notified_of_own_activity'
).
set
(
true
)
expect
(
page
).
to
have_content
(
'Notification settings saved'
)
expect
(
page
).
to
have_checked_field
(
'user[notified_of_own_activity]'
)
end
scenario
'User opts out of receiving notifications about their own activity'
do
user
.
update!
(
notified_of_own_activity:
true
)
visit
profile_notifications_path
expect
(
page
).
to
have_checked_field
(
'user[notified_of_own_activity]'
)
page
.
find
(
'#user_notified_of_own_activity'
).
set
(
false
)
expect
(
page
).
to
have_content
(
'Notification settings saved'
)
expect
(
page
).
not_to
have_checked_field
(
'user[notified_of_own_activity]'
)
end
end
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