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
f71bd4e2
Commit
f71bd4e2
authored
Oct 08, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed loading text in MR extensions
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/342645
parent
026d483d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
17 deletions
+56
-17
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
...s/vue_merge_request_widget/components/extensions/base.vue
+11
-14
app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js
...s/vue_merge_request_widget/components/extensions/index.js
+1
-0
app/assets/javascripts/vue_merge_request_widget/extensions/issues.js
...javascripts/vue_merge_request_widget/extensions/issues.js
+5
-2
ee/app/assets/javascripts/vue_merge_request_widget/extensions/browser_performance/index.js
...ge_request_widget/extensions/browser_performance/index.js
+4
-0
ee/app/assets/javascripts/vue_merge_request_widget/extensions/load_performance/index.js
...merge_request_widget/extensions/load_performance/index.js
+4
-1
ee/spec/frontend/vue_mr_widget/extensions/browser_performance/index_spec.js
...ue_mr_widget/extensions/browser_performance/index_spec.js
+11
-0
ee/spec/frontend/vue_mr_widget/extensions/load_performance/index_spec.js
...d/vue_mr_widget/extensions/load_performance/index_spec.js
+11
-0
locale/gitlab.pot
locale/gitlab.pot
+9
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
View file @
f71bd4e2
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
GlSafeHtmlDirective
,
GlSafeHtmlDirective
,
GlTooltipDirective
,
GlTooltipDirective
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
import
{
sprintf
,
s__
,
__
}
from
'
~/locale
'
;
import
SmartVirtualList
from
'
~/vue_shared/components/smart_virtual_list.vue
'
;
import
SmartVirtualList
from
'
~/vue_shared/components/smart_virtual_list.vue
'
;
import
{
EXTENSION_ICON_CLASS
}
from
'
../../constants
'
;
import
{
EXTENSION_ICON_CLASS
}
from
'
../../constants
'
;
import
StatusIcon
from
'
./status_icon.vue
'
;
import
StatusIcon
from
'
./status_icon.vue
'
;
...
@@ -42,6 +42,12 @@ export default {
...
@@ -42,6 +42,12 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
widgetLabel
()
{
return
this
.
$options
.
i18n
?.
label
||
this
.
$options
.
name
;
},
widgetLoadingText
()
{
return
this
.
$options
.
i18n
?.
loading
||
__
(
'
Loading...
'
);
},
isLoadingSummary
()
{
isLoadingSummary
()
{
return
this
.
loadingState
===
LOADING_STATES
.
collapsedLoading
;
return
this
.
loadingState
===
LOADING_STATES
.
collapsedLoading
;
},
},
...
@@ -60,7 +66,7 @@ export default {
...
@@ -60,7 +66,7 @@ export default {
this
.
isCollapsed
this
.
isCollapsed
?
s__
(
'
mrWidget|Show %{widget} details
'
)
?
s__
(
'
mrWidget|Show %{widget} details
'
)
:
s__
(
'
mrWidget|Hide %{widget} details
'
),
:
s__
(
'
mrWidget|Hide %{widget} details
'
),
{
widget
:
this
.
$options
.
label
||
this
.
$options
.
name
},
{
widget
:
this
.
widgetLabel
},
);
);
},
},
statusIconName
()
{
statusIconName
()
{
...
@@ -119,24 +125,15 @@ export default {
...
@@ -119,24 +125,15 @@ export default {
<
template
>
<
template
>
<section
class=
"media-section"
data-testid=
"widget-extension"
>
<section
class=
"media-section"
data-testid=
"widget-extension"
>
<div
class=
"media gl-p-5"
>
<div
class=
"media gl-p-5"
>
<status-icon
<status-icon
:name=
"widgetLabel"
:is-loading=
"isLoadingSummary"
:icon-name=
"statusIconName"
/>
:name=
"$options.label || $options.name"
:is-loading=
"isLoadingSummary"
:icon-name=
"statusIconName"
/>
<div
<div
class=
"media-body gl-display-flex gl-align-self-center gl-align-items-center gl-flex-direction-row!"
class=
"media-body gl-display-flex gl-align-self-center gl-align-items-center gl-flex-direction-row!"
>
>
<div
class=
"gl-flex-grow-1"
>
<div
class=
"gl-flex-grow-1"
>
<template
v-if=
"isLoadingSummary"
>
<template
v-if=
"isLoadingSummary"
>
{{
widgetLoadingText
}}
</
template
>
{{
__
(
'
Loading...
'
)
}}
</
template
>
<div
v-else
v-safe-html=
"summary(collapsedData)"
></div>
<div
v-else
v-safe-html=
"summary(collapsedData)"
></div>
</div>
</div>
<actions
<actions
:widget=
"widgetLabel"
:tertiary-buttons=
"tertiaryActionsButtons"
/>
:widget=
"$options.label || $options.name"
:tertiary-buttons=
"tertiaryActionsButtons"
/>
<div
<div
class=
"gl-float-right gl-align-self-center gl-border-l-1 gl-border-l-solid gl-border-gray-100 gl-ml-3 gl-pl-3"
class=
"gl-float-right gl-align-self-center gl-border-l-1 gl-border-l-solid gl-border-gray-100 gl-ml-3 gl-pl-3"
>
>
...
...
app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js
View file @
f71bd4e2
...
@@ -11,6 +11,7 @@ export const registerExtension = (extension) => {
...
@@ -11,6 +11,7 @@ export const registerExtension = (extension) => {
extends
:
ExtensionBase
,
extends
:
ExtensionBase
,
name
:
extension
.
name
,
name
:
extension
.
name
,
props
:
extension
.
props
,
props
:
extension
.
props
,
i18n
:
extension
.
i18n
,
computed
:
{
computed
:
{
...
Object
.
keys
(
extension
.
computed
).
reduce
(
...
Object
.
keys
(
extension
.
computed
).
reduce
(
(
acc
,
computedKey
)
=>
({
(
acc
,
computedKey
)
=>
({
...
...
app/assets/javascripts/vue_merge_request_widget/extensions/issues.js
View file @
f71bd4e2
...
@@ -6,8 +6,11 @@ import issuesQuery from './issues.query.graphql';
...
@@ -6,8 +6,11 @@ import issuesQuery from './issues.query.graphql';
export
default
{
export
default
{
// Give the extension a name
// Give the extension a name
// Make it easier to track in Vue dev tools
// Make it easier to track in Vue dev tools
name
:
'
Issues
'
,
name
:
'
WidgetIssues
'
,
label
:
'
Issues
'
,
i18n
:
{
label
:
'
Issues
'
,
loading
:
'
Loading issues...
'
,
},
// Add an array of props
// Add an array of props
// These then get mapped to values stored in the MR Widget store
// These then get mapped to values stored in the MR Widget store
props
:
[
'
targetProjectFullPath
'
,
'
conflictsDocsPath
'
],
props
:
[
'
targetProjectFullPath
'
,
'
conflictsDocsPath
'
],
...
...
ee/app/assets/javascripts/vue_merge_request_widget/extensions/browser_performance/index.js
View file @
f71bd4e2
...
@@ -6,6 +6,10 @@ import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
...
@@ -6,6 +6,10 @@ import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
export
default
{
export
default
{
name
:
'
WidgetBrowserPerformance
'
,
name
:
'
WidgetBrowserPerformance
'
,
props
:
[
'
browserPerformance
'
],
props
:
[
'
browserPerformance
'
],
i18n
:
{
label
:
s__
(
'
ciReport|Browser Performance
'
),
loading
:
s__
(
'
ciReport|Browser performance test metrics results are being parsed
'
),
},
computed
:
{
computed
:
{
summary
()
{
summary
()
{
const
{
improved
,
degraded
,
same
}
=
this
.
collapsedData
;
const
{
improved
,
degraded
,
same
}
=
this
.
collapsedData
;
...
...
ee/app/assets/javascripts/vue_merge_request_widget/extensions/load_performance/index.js
View file @
f71bd4e2
...
@@ -5,7 +5,10 @@ import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
...
@@ -5,7 +5,10 @@ import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
export
default
{
export
default
{
name
:
'
WidgetLoadPerformance
'
,
name
:
'
WidgetLoadPerformance
'
,
label
:
s__
(
'
ciReport|Load Performance
'
),
i18n
:
{
label
:
s__
(
'
ciReport|Load Performance
'
),
loading
:
s__
(
'
ciReport|Load performance test metrics results are being parsed
'
),
},
props
:
[
'
loadPerformance
'
],
props
:
[
'
loadPerformance
'
],
computed
:
{
computed
:
{
summary
()
{
summary
()
{
...
...
ee/spec/frontend/vue_mr_widget/extensions/browser_performance/index_spec.js
View file @
f71bd4e2
...
@@ -40,6 +40,17 @@ describe('Browser performance extension', () => {
...
@@ -40,6 +40,17 @@ describe('Browser performance extension', () => {
});
});
describe
(
'
summary
'
,
()
=>
{
describe
(
'
summary
'
,
()
=>
{
it
(
'
should render loading text
'
,
async
()
=>
{
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
head_path
).
reply
(
200
,
headBrowserPerformance
);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
base_path
).
reply
(
200
,
baseBrowserPerformance
);
registerExtension
(
browserPerformanceExtension
);
await
nextTick
();
expect
(
wrapper
.
text
()).
toContain
(
'
Browser performance test metrics results are being parsed
'
);
});
it
(
'
should render info
'
,
async
()
=>
{
it
(
'
should render info
'
,
async
()
=>
{
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
head_path
).
reply
(
200
,
headBrowserPerformance
);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
head_path
).
reply
(
200
,
headBrowserPerformance
);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
base_path
).
reply
(
200
,
baseBrowserPerformance
);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
base_path
).
reply
(
200
,
baseBrowserPerformance
);
...
...
ee/spec/frontend/vue_mr_widget/extensions/load_performance/index_spec.js
View file @
f71bd4e2
...
@@ -40,6 +40,17 @@ describe('Load performance extension', () => {
...
@@ -40,6 +40,17 @@ describe('Load performance extension', () => {
});
});
describe
(
'
summary
'
,
()
=>
{
describe
(
'
summary
'
,
()
=>
{
it
(
'
should render loading text
'
,
async
()
=>
{
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
headLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
baseLoadPerformance
);
registerExtension
(
loadPerformanceExtension
);
await
nextTick
();
expect
(
wrapper
.
text
()).
toContain
(
'
Load performance test metrics results are being parsed
'
);
});
it
(
'
should render info about all issues
'
,
async
()
=>
{
it
(
'
should render info about all issues
'
,
async
()
=>
{
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
headLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
headLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
baseLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
baseLoadPerformance
);
...
...
locale/gitlab.pot
View file @
f71bd4e2
...
@@ -39784,6 +39784,12 @@ msgstr ""
...
@@ -39784,6 +39784,12 @@ msgstr ""
msgid "ciReport|Base pipeline codequality artifact not found"
msgid "ciReport|Base pipeline codequality artifact not found"
msgstr ""
msgstr ""
msgid "ciReport|Browser Performance"
msgstr ""
msgid "ciReport|Browser performance test metrics results are being parsed"
msgstr ""
msgid "ciReport|Browser performance test metrics: "
msgid "ciReport|Browser performance test metrics: "
msgstr ""
msgstr ""
...
@@ -39875,6 +39881,9 @@ msgid_plural "ciReport|Load performance test metrics detected %{strongStart}%{ch
...
@@ -39875,6 +39881,9 @@ msgid_plural "ciReport|Load performance test metrics detected %{strongStart}%{ch
msgstr[0] ""
msgstr[0] ""
msgstr[1] ""
msgstr[1] ""
msgid "ciReport|Load performance test metrics results are being parsed"
msgstr ""
msgid "ciReport|Load performance test metrics: "
msgid "ciReport|Load performance test metrics: "
msgstr ""
msgstr ""
...
...
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