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
b08c58e1
Commit
b08c58e1
authored
Mar 07, 2022
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove warning icon in request selector
This indicator can be misleading when the results for AJAX requests are lazy-loaded.
parent
2eb549c1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
82 deletions
+2
-82
app/assets/javascripts/performance_bar/components/request_selector.vue
...vascripts/performance_bar/components/request_selector.vue
+0
-38
app/assets/javascripts/performance_bar/stores/performance_bar_store.js
...vascripts/performance_bar/stores/performance_bar_store.js
+0
-2
doc/administration/monitoring/performance/img/performance_bar_request_selector_warning.png
...formance/img/performance_bar_request_selector_warning.png
+0
-0
doc/administration/monitoring/performance/performance_bar.md
doc/administration/monitoring/performance/performance_bar.md
+2
-6
locale/gitlab.pot
locale/gitlab.pot
+0
-5
spec/frontend/performance_bar/components/request_selector_spec.js
...ntend/performance_bar/components/request_selector_spec.js
+0
-31
No files found.
app/assets/javascripts/performance_bar/components/request_selector.vue
View file @
b08c58e1
<
script
>
import
{
GlPopover
,
GlSafeHtmlDirective
}
from
'
@gitlab/ui
'
;
import
{
glEmojiTag
}
from
'
~/emoji
'
;
import
{
n__
}
from
'
~/locale
'
;
export
default
{
components
:
{
GlPopover
,
},
directives
:
{
SafeHtml
:
GlSafeHtmlDirective
,
},
props
:
{
currentRequest
:
{
type
:
Object
,
...
...
@@ -25,27 +15,11 @@ export default {
currentRequestId
:
this
.
currentRequest
.
id
,
};
},
computed
:
{
requestsWithWarnings
()
{
return
this
.
requests
.
filter
((
request
)
=>
request
.
hasWarnings
);
},
warningMessage
()
{
return
n__
(
'
%d request with warnings
'
,
'
%d requests with warnings
'
,
this
.
requestsWithWarnings
.
length
,
);
},
},
watch
:
{
currentRequestId
(
newRequestId
)
{
this
.
$emit
(
'
change-current-request
'
,
newRequestId
);
},
},
methods
:
{
glEmojiTag
,
},
safeHtmlConfig
:
{
ADD_TAGS
:
[
'
gl-emoji
'
]
},
};
</
script
>
<
template
>
...
...
@@ -58,19 +32,7 @@ export default {
data-qa-selector=
"request_dropdown_option"
>
{{
request
.
truncatedUrl
}}
<span
v-if=
"request.hasWarnings"
>
(!)
</span>
</option>
</select>
<span
v-if=
"requestsWithWarnings.length"
class=
"gl-cursor-default"
>
<span
id=
"performance-bar-request-selector-warning"
v-safe-html:
[$
options.safeHtmlConfig]=
"glEmojiTag('warning')"
></span>
<gl-popover
placement=
"bottom"
target=
"performance-bar-request-selector-warning"
:content=
"warningMessage"
/>
</span>
</div>
</
template
>
app/assets/javascripts/performance_bar/stores/performance_bar_store.js
View file @
b08c58e1
...
...
@@ -12,7 +12,6 @@ export default class PerformanceBarStore {
url
:
requestUrl
,
truncatedUrl
:
shortUrl
,
details
:
{},
hasWarnings
:
false
,
});
}
...
...
@@ -27,7 +26,6 @@ export default class PerformanceBarStore {
const
request
=
this
.
findRequest
(
requestId
);
request
.
details
=
requestDetails
.
data
;
request
.
hasWarnings
=
requestDetails
.
has_warnings
;
return
request
;
}
...
...
doc/administration/monitoring/performance/img/performance_bar_request_selector_warning.png
deleted
100644 → 0
View file @
2eb549c1
9.94 KB
doc/administration/monitoring/performance/performance_bar.md
View file @
b08c58e1
...
...
@@ -95,18 +95,14 @@ For non-administrators to display the performance bar, it must be
## Request warnings
> [Warning icon in the request selector removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82187) in GitLab 14.9.
Requests that exceed predefined limits display a warning
**{warning}**
icon and
explanation next to the metric. In this example, the Gitaly call duration
exceeded the threshold.
![
Gitaly call duration exceeded threshold
](
img/performance_bar_gitaly_threshold.png
)
If any requests on the current page generated warnings, the warning icon displays
next to the
**Requests**
selector menu. In this selector menu, an exclamation
`(!)`
appears next to requests with warnings.
![
Request selector showing two requests with warnings
](
img/performance_bar_request_selector_warning.png
)
## Enable the performance bar for non-administrators
The performance bar is disabled by default for non-administrators. To enable it
...
...
locale/gitlab.pot
View file @
b08c58e1
...
...
@@ -371,11 +371,6 @@ msgid_plural "%d projects selected"
msgstr[0] ""
msgstr[1] ""
msgid "%d request with warnings"
msgid_plural "%d requests with warnings"
msgstr[0] ""
msgstr[1] ""
msgid "%d second"
msgid_plural "%d seconds"
msgstr[0] ""
...
...
spec/frontend/performance_bar/components/request_selector_spec.js
deleted
100644 → 0
View file @
2eb549c1
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
RequestSelector
from
'
~/performance_bar/components/request_selector.vue
'
;
describe
(
'
request selector
'
,
()
=>
{
const
requests
=
[
{
id
:
'
warningReq
'
,
url
:
'
https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/1/discussions.json
'
,
truncatedUrl
:
'
discussions.json
'
,
hasWarnings
:
true
,
},
];
const
wrapper
=
shallowMount
(
RequestSelector
,
{
propsData
:
{
requests
,
currentRequest
:
requests
[
0
],
},
});
it
(
'
has a warning icon if any requests have warnings
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
span > gl-emoji
'
).
element
.
dataset
.
name
).
toEqual
(
'
warning
'
);
});
it
(
'
adds a warning glyph to requests with warnings
'
,
()
=>
{
const
requestValue
=
wrapper
.
find
(
'
[value="warningReq"]
'
).
text
();
expect
(
requestValue
).
toContain
(
'
discussions.json
'
);
expect
(
requestValue
).
toContain
(
'
(!)
'
);
});
});
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