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
9cffbbf9
Commit
9cffbbf9
authored
Dec 13, 2021
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch MR Widgets to use a structured data output for summaries
parent
b990dc7a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
16 deletions
+33
-16
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
...s/vue_merge_request_widget/components/extensions/base.vue
+21
-1
ee/app/assets/javascripts/vue_merge_request_widget/extensions/browser_performance/index.js
...ge_request_widget/extensions/browser_performance/index.js
+4
-4
ee/app/assets/javascripts/vue_merge_request_widget/extensions/load_performance/index.js
...merge_request_widget/extensions/load_performance/index.js
+4
-4
ee/app/assets/javascripts/vue_merge_request_widget/extensions/status_checks/index.js
...ue_merge_request_widget/extensions/status_checks/index.js
+4
-7
No files found.
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
View file @
9cffbbf9
...
@@ -94,6 +94,20 @@ export default {
...
@@ -94,6 +94,20 @@ export default {
tertiaryActionsButtons
()
{
tertiaryActionsButtons
()
{
return
this
.
tertiaryButtons
?
this
.
tertiaryButtons
()
:
undefined
;
return
this
.
tertiaryButtons
?
this
.
tertiaryButtons
()
:
undefined
;
},
},
hydratedSummary
()
{
const
structuredOutput
=
this
.
summary
(
this
.
collapsedData
);
const
summary
=
{
subject
:
generateText
(
typeof
structuredOutput
===
'
string
'
?
structuredOutput
:
structuredOutput
.
subject
,
),
};
if
(
structuredOutput
.
meta
)
{
summary
.
meta
=
generateText
(
structuredOutput
.
meta
);
}
return
summary
;
},
},
},
watch
:
{
watch
:
{
isCollapsed
(
newVal
)
{
isCollapsed
(
newVal
)
{
...
@@ -182,7 +196,13 @@ export default {
...
@@ -182,7 +196,13 @@ export default {
<div
class=
"gl-flex-grow-1"
>
<div
class=
"gl-flex-grow-1"
>
<template
v-if=
"isLoadingSummary"
>
{{
widgetLoadingText
}}
</
template
>
<template
v-if=
"isLoadingSummary"
>
{{
widgetLoadingText
}}
</
template
>
<
template
v-else-if=
"hasFetchError"
>
{{
widgetErrorText
}}
</
template
>
<
template
v-else-if=
"hasFetchError"
>
{{
widgetErrorText
}}
</
template
>
<div
v-else
v-safe-html=
"generateText(summary(collapsedData))"
></div>
<div
v-else
>
<span
v-safe-html=
"hydratedSummary.subject"
></span>
<
template
v-if=
"hydratedSummary.meta"
>
<br
/>
<span
v-safe-html=
"hydratedSummary.meta"
class=
"gl-font-sm"
></span>
</
template
>
</div>
</div>
</div>
<actions
<actions
:widget=
"$options.label || $options.name"
:widget=
"$options.label || $options.name"
...
...
ee/app/assets/javascripts/vue_merge_request_widget/extensions/browser_performance/index.js
View file @
9cffbbf9
...
@@ -38,10 +38,10 @@ export default {
...
@@ -38,10 +38,10 @@ export default {
},
},
);
);
return
`
${
text
}
return
{
<br>
subject
:
text
,
${
reportNumbersText
}
meta
:
reportNumbersText
,
`
;
}
;
},
},
statusIcon
()
{
statusIcon
()
{
if
(
this
.
collapsedData
.
degraded
.
length
||
this
.
collapsedData
.
same
.
length
)
{
if
(
this
.
collapsedData
.
degraded
.
length
||
this
.
collapsedData
.
same
.
length
)
{
...
...
ee/app/assets/javascripts/vue_merge_request_widget/extensions/load_performance/index.js
View file @
9cffbbf9
...
@@ -35,10 +35,10 @@ export default {
...
@@ -35,10 +35,10 @@ export default {
},
},
);
);
return
`
${
text
}
return
{
<br>
subject
:
text
,
${
reportNumbersText
}
meta
:
reportNumbersText
,
`
;
}
;
},
},
statusIcon
()
{
statusIcon
()
{
if
(
this
.
collapsedData
.
degraded
.
length
||
this
.
collapsedData
.
same
.
length
)
{
if
(
this
.
collapsedData
.
degraded
.
length
||
this
.
collapsedData
.
same
.
length
)
{
...
...
ee/app/assets/javascripts/vue_merge_request_widget/extensions/status_checks/index.js
View file @
9cffbbf9
...
@@ -46,13 +46,10 @@ export default {
...
@@ -46,13 +46,10 @@ export default {
);
);
}
}
return
`
return
{
${
s__
(
'
StatusCheck|Status checks
'
)}
subject
:
s__
(
'
StatusCheck|Status checks
'
),
<br>
meta
:
reports
.
join
(
__
(
'
, and
'
)),
<span class="gl-font-sm">
};
${
reports
.
join
(
__
(
'
, and
'
))}
</span>
`
;
},
},
statusIcon
({
pending
=
[],
failed
=
[]
})
{
statusIcon
({
pending
=
[],
failed
=
[]
})
{
if
(
failed
.
length
>
0
)
{
if
(
failed
.
length
>
0
)
{
...
...
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