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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
36d48120
Commit
36d48120
authored
Jun 22, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Plain Diff
merge master into issue_3359_3
parents
2674b548
92e18354
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
29 deletions
+29
-29
CHANGELOG
CHANGELOG
+1
-1
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+1
-0
app/assets/stylesheets/framework/blocks.scss
app/assets/stylesheets/framework/blocks.scss
+1
-1
app/assets/stylesheets/pages/groups.scss
app/assets/stylesheets/pages/groups.scss
+1
-5
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+4
-4
app/controllers/notification_settings_controller.rb
app/controllers/notification_settings_controller.rb
+6
-8
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+1
-1
app/views/groups/show.html.haml
app/views/groups/show.html.haml
+6
-3
doc/workflow/notifications.md
doc/workflow/notifications.md
+2
-0
spec/controllers/notification_settings_controller_spec.rb
spec/controllers/notification_settings_controller_spec.rb
+6
-6
No files found.
CHANGELOG
View file @
36d48120
Please view this file on the master branch, on stable branches it's out of date.
v 8.10(unreleased)
v 8.10
.0
(unreleased)
- Add notifications dropdown for groups
v 8.9.0 (unreleased)
...
...
app/assets/javascripts/dispatcher.js.coffee
View file @
36d48120
...
...
@@ -85,6 +85,7 @@ class Dispatcher
when
'groups:show'
shortcut_handler
=
new
ShortcutsNavigation
()
new
NotificationsForm
()
new
NotificationsDropdown
()
when
'groups:group_members:index'
new
GroupMembers
()
new
UsersSelect
()
...
...
app/assets/stylesheets/framework/blocks.scss
View file @
36d48120
...
...
@@ -137,7 +137,7 @@
margin
:
0
;
font-size
:
24px
;
font-weight
:
normal
;
margin-bottom
:
5
px
;
margin-bottom
:
10
px
;
color
:
#4c4e54
;
font-size
:
23px
;
line-height
:
1
.1
;
...
...
app/assets/stylesheets/pages/groups.scss
View file @
36d48120
...
...
@@ -48,11 +48,7 @@
.access-request-button
{
@include
btn-gray
;
position
:
absolute
;
right
:
16px
;
bottom
:
32px
;
padding
:
3px
10px
;
margin-right
:
10px
;
text-transform
:
none
;
background-color
:
$background-color
;
}
}
app/controllers/groups_controller.rb
View file @
36d48120
...
...
@@ -74,6 +74,10 @@ class GroupsController < Groups::ApplicationController
def
edit
end
def
projects
@projects
=
@group
.
projects
.
page
(
params
[
:page
])
end
def
update
if
Groups
::
UpdateService
.
new
(
@group
,
current_user
,
group_params
).
execute
redirect_to
edit_group_path
(
@group
),
notice:
"Group '
#{
@group
.
name
}
' was successfully updated."
...
...
@@ -100,10 +104,6 @@ class GroupsController < Groups::ApplicationController
@shared_projects
=
GroupProjectsFinder
.
new
(
group
,
only_shared:
true
).
execute
(
current_user
)
end
def
projects
@projects
=
@group
.
projects
.
page
(
params
[
:page
])
end
def
authorize_create_group!
unless
can?
(
current_user
,
:create_group
,
nil
)
return
render_404
...
...
app/controllers/notification_settings_controller.rb
View file @
36d48120
...
...
@@ -2,8 +2,6 @@ class NotificationSettingsController < ApplicationController
before_action
:authenticate_user!
def
create
resource
=
find_resource
return
render_404
unless
can_read?
(
resource
)
@notification_setting
=
current_user
.
notification_settings_for
(
resource
)
...
...
@@ -21,12 +19,12 @@ class NotificationSettingsController < ApplicationController
private
def
find_
resource
resource
=
if
params
[
:project
].
present?
Project
.
find
(
params
[
:project
][
:
id
])
elsif
params
[
:namespace
].
present?
Group
.
find
(
params
[
:namespace
][
:
id
])
def
resource
@resource
||
=
if
params
[
:project
_id
].
present?
Project
.
find
(
params
[
:project
_
id
])
elsif
params
[
:namespace
_id
].
present?
Group
.
find
(
params
[
:namespace
_
id
])
end
end
...
...
app/helpers/notifications_helper.rb
View file @
36d48120
...
...
@@ -72,6 +72,6 @@ module NotificationsHelper
# Create hidden field to send notification setting source to controller
def
hidden_setting_source_input
(
notification_setting
)
return
unless
notification_setting
.
source_type
hidden_field_tag
"
#{
notification_setting
.
source_type
.
downcase
}
[id]
"
,
notification_setting
.
source_id
hidden_field_tag
"
#{
notification_setting
.
source_type
.
downcase
}
_id
"
,
notification_setting
.
source_id
end
end
app/views/groups/show.html.haml
View file @
36d48120
...
...
@@ -15,14 +15,17 @@
%span
.visibility-icon.has-tooltip
{
data:
{
container:
'body'
},
title:
visibility_icon_description
(
@group
)
}
=
visibility_level_icon
(
@group
.
visibility_level
,
fw:
false
)
=
render
'notifications/buttons/notifications'
,
notification_setting:
@notification_setting
%span
.hidden-xs
=
render
'shared/notifications/button'
,
notification_setting:
@notification_setting
-
if
current_user
.pull-right
=
render
'shared/members/access_request_buttons'
,
source:
@group
-
if
@group
.
description
.
present?
.cover-desc.description
=
markdown
(
@group
.
description
,
pipeline: :description
)
-
if
current_user
=
render
'shared/members/access_request_buttons'
,
source:
@group
%div
{
class:
container_class
}
.top-area
...
...
doc/workflow/notifications.md
View file @
36d48120
...
...
@@ -37,12 +37,14 @@ This means that you can set a different level of notifications per group while s
to have a finer level setting per project.
Organization like this is suitable for users that belong to different groups but don't have the
same need for being notified for every group they are member of.
These settings can be configured on group page or user profile notifications dropdown.
#### Project Settings
Project Settings are at the top level and any setting placed at this level will take precedence of any
other setting.
This is suitable for users that have different needs for notifications per project basis.
These settings can be configured on project page or user profile notifications dropdown.
## Notification events
...
...
spec/controllers/notification_settings_controller_spec.rb
View file @
36d48120
...
...
@@ -13,7 +13,7 @@ describe NotificationSettingsController do
context
'when not authorized'
do
it
'redirects to sign in page'
do
post
:create
,
project
:
{
id:
project
.
id
}
,
project
_id:
project
.
id
,
notification_setting:
{
level: :participating
}
expect
(
response
).
to
redirect_to
(
new_user_session_path
)
...
...
@@ -40,7 +40,7 @@ describe NotificationSettingsController do
it
'creates notification setting'
do
post
:create
,
project
:
{
id:
project
.
id
}
,
project
_id:
project
.
id
,
notification_setting:
{
level: :participating
}
expect
(
response
.
status
).
to
eq
200
...
...
@@ -53,7 +53,7 @@ describe NotificationSettingsController do
context
'with custom settings'
do
it
'creates notification setting'
do
post
:create
,
project
:
{
id:
project
.
id
}
,
project
_id:
project
.
id
,
notification_setting:
{
level: :custom
}.
merge
(
custom_events
)
expect
(
response
.
status
).
to
eq
200
...
...
@@ -68,7 +68,7 @@ describe NotificationSettingsController do
it
'creates notification setting'
do
post
:create
,
namespace
:
{
id:
group
.
id
}
,
namespace
_id:
group
.
id
,
notification_setting:
{
level: :watch
}
expect
(
response
.
status
).
to
eq
200
...
...
@@ -81,7 +81,7 @@ describe NotificationSettingsController do
context
'with custom settings'
do
it
'creates notification setting'
do
post
:create
,
namespace
:
{
id:
group
.
id
}
,
namespace
_id:
group
.
id
,
notification_setting:
{
level: :custom
}.
merge
(
custom_events
)
expect
(
response
.
status
).
to
eq
200
...
...
@@ -98,7 +98,7 @@ describe NotificationSettingsController do
it
'returns 404'
do
post
:create
,
project
:
{
id:
private_project
.
id
}
,
project
_id:
private_project
.
id
,
notification_setting:
{
level: :participating
}
expect
(
response
.
status
).
to
eq
(
404
)
...
...
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