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
2eb3dd38
Commit
2eb3dd38
authored
Mar 11, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return incidents as array inside object
parent
5ea90fa9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
ee/app/serializers/status_page/incident_serializer.rb
ee/app/serializers/status_page/incident_serializer.rb
+1
-1
ee/spec/fixtures/api/schemas/status_page/incident_list.json
ee/spec/fixtures/api/schemas/status_page/incident_list.json
+8
-2
ee/spec/serializers/status_page/incident_serializer_spec.rb
ee/spec/serializers/status_page/incident_serializer_spec.rb
+1
-1
No files found.
ee/app/serializers/status_page/incident_serializer.rb
View file @
2eb3dd38
...
...
@@ -5,7 +5,7 @@ module StatusPage
entity
IncidentEntity
def
represent_list
(
resource
)
represent
(
resource
,
except:
[
:comments
])
{
incidents:
represent
(
resource
,
except:
[
:comments
])
}
end
def
represent_details
(
resource
,
user_notes
)
...
...
ee/spec/fixtures/api/schemas/status_page/incident_list.json
View file @
2eb3dd38
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"basic_incident.json"
},
"type"
:
"object"
,
"required"
:
[
"incidents"
],
"properties"
:
{
"incidents"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"basic_incident.json"
}
}
},
"additionalProperties"
:
false
}
ee/spec/serializers/status_page/incident_serializer_spec.rb
View file @
2eb3dd38
...
...
@@ -14,7 +14,7 @@ describe StatusPage::IncidentSerializer do
describe
'.represent_list'
do
let
(
:resource
)
{
[
issue
]
}
let
(
:json_entity
)
do
subject
.
represent_list
(
resource
).
map
(
&
:with_indifferent_access
)
subject
.
represent_list
(
resource
).
with_indifferent_access
end
it_behaves_like
'valid JSON schema'
,
schema:
'status_page/incident_list'
...
...
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