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
a1f74822
Commit
a1f74822
authored
Apr 08, 2021
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OncallScheduleEntity with data to members
- Preload associations
parent
4c99bf93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
0 deletions
+18
-0
ee/app/models/ee/members_preloader.rb
ee/app/models/ee/members_preloader.rb
+1
-0
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+4
-0
ee/app/models/incident_management/oncall_schedule.rb
ee/app/models/incident_management/oncall_schedule.rb
+4
-0
ee/app/serializers/ee/member_user_entity.rb
ee/app/serializers/ee/member_user_entity.rb
+1
-0
ee/app/serializers/incident_management/oncall_schedule_entity.rb
...serializers/incident_management/oncall_schedule_entity.rb
+8
-0
No files found.
ee/app/models/ee/members_preloader.rb
View file @
a1f74822
...
...
@@ -9,6 +9,7 @@ module EE
super
ActiveRecord
::
Associations
::
Preloader
.
new
.
preload
(
members
.
map
(
&
:user
),
group_saml_identities: :saml_provider
)
ActiveRecord
::
Associations
::
Preloader
.
new
.
preload
(
members
.
map
(
&
:user
),
oncall_participants:
{
rotation: :schedule
})
end
end
end
ee/app/models/ee/user.rb
View file @
a1f74822
...
...
@@ -73,6 +73,10 @@ module EE
has_many
:user_permission_export_uploads
has_many
:oncall_participants
,
class_name:
'IncidentManagement::OncallParticipant'
,
inverse_of: :user
has_many
:oncall_rotations
,
class_name:
'IncidentManagement::OncallRotation'
,
through: :oncall_participants
,
source: :rotation
has_many
:oncall_schedules
,
class_name:
'IncidentManagement::OncallSchedule'
,
through: :oncall_rotations
,
source: :schedule
scope
:not_managed
,
->
(
group:
nil
)
{
scope
=
where
(
managing_group_id:
nil
)
scope
=
scope
.
or
(
where
.
not
(
managing_group_id:
group
.
id
))
if
group
...
...
ee/app/models/incident_management/oncall_schedule.rb
View file @
a1f74822
...
...
@@ -22,6 +22,10 @@ module IncidentManagement
scope
:for_iid
,
->
(
iid
)
{
where
(
iid:
iid
)
}
def
project_name
project
.
name
end
private
def
timezones
...
...
ee/app/serializers/ee/member_user_entity.rb
View file @
a1f74822
...
...
@@ -7,6 +7,7 @@ module EE
prepended
do
unexpose
:gitlab_employee
unexpose
:email
expose
:oncall_schedules
,
with:
::
IncidentManagement
::
OncallScheduleEntity
end
end
end
ee/app/serializers/incident_management/oncall_schedule_entity.rb
0 → 100644
View file @
a1f74822
# frozen_string_literal: true
module
IncidentManagement
class
OncallScheduleEntity
<
Grape
::
Entity
expose
:name
expose
:project_name
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