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
eb8769b2
Commit
eb8769b2
authored
Apr 01, 2021
by
Olena Horal-Koretska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettify JSON of sample alert payload
parent
a08b9cf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
...ripts/alerts_settings/components/alerts_settings_form.vue
+6
-1
changelogs/unreleased/325824-prettify-sample-json.yml
changelogs/unreleased/325824-prettify-sample-json.yml
+5
-0
No files found.
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
View file @
eb8769b2
...
...
@@ -255,7 +255,7 @@ export default {
if
(
this
.
showMappingBuilder
)
{
this
.
resetPayloadAndMappingConfirmed
=
false
;
this
.
parsedPayload
=
payloadAlertFields
;
this
.
samplePayload
.
json
=
this
.
isValidNonEmptyJSON
(
payloadExample
)
?
payloadExample
:
null
;
this
.
samplePayload
.
json
=
this
.
getPrettifiedPayload
(
payloadExample
)
;
this
.
updateMapping
(
this
.
getCleanMapping
(
payloadAttributeMappings
));
}
this
.
$el
.
scrollIntoView
({
block
:
'
center
'
});
...
...
@@ -288,6 +288,11 @@ export default {
}
return
false
;
},
getPrettifiedPayload
(
payload
)
{
return
this
.
isValidNonEmptyJSON
(
payload
)
?
JSON
.
stringify
(
JSON
.
parse
(
payload
),
null
,
'
\t
'
)
:
null
;
},
triggerValidation
()
{
if
(
this
.
isHttp
)
{
this
.
validationState
.
apiUrl
=
true
;
...
...
changelogs/unreleased/325824-prettify-sample-json.yml
0 → 100644
View file @
eb8769b2
---
title
:
Prettify JSON of sample alert payload
merge_request
:
58433
author
:
type
:
added
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