[Console Monaco] Improve highlighting for status codes in multiple responses#189210
Conversation
|
/ci |
|
/ci |
| DANGER_STATUS_BADGE_CLASSNAME, | ||
| } from './constants'; | ||
|
|
||
| const getStatusCodeClassName = (statusCode: number) => { |
There was a problem hiding this comment.
Using the same logic we used for the Ace badge.
| * The z-index for the autocomplete suggestions popup | ||
| * The styling for the multiple-response status code decorations | ||
| */ | ||
| %monaco__status_badge { |
There was a problem hiding this comment.
Adapted this styling from the one for the Ace badge (on line 37 in this file).
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
src/plugins/console/public/application/containers/editor/monaco/utils/constants.ts
Outdated
Show resolved
Hide resolved
...ns/console/public/application/containers/editor/monaco/utils/status_code_decoration_utils.ts
Outdated
Show resolved
Hide resolved
yuliacech
left a comment
There was a problem hiding this comment.
The status badges look great, thanks a lot for implementing them, @ElenaStoeva!
ryankeairns
left a comment
There was a problem hiding this comment.
LGTM with one small change. Thanks
| font-size: $euiFontSizeS; | ||
| font-weight: $euiFontWeightMedium; | ||
| line-height: $euiLineHeight; | ||
| padding: 2px $euiSizeXS; |
There was a problem hiding this comment.
2px can be replaced with calc($euiSizeXS / 2)
There was a problem hiding this comment.
Thanks for the suggestion! Added with 3f91410.
ryankeairns
left a comment
There was a problem hiding this comment.
Going ahead with approval presuming you'll making that very small change. Thanks!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @ElenaStoeva |
Closes #184010
Summary
This PR adds color badges for the status codes in the output panel when there are multiple responses.
Screen.Recording.2024-07-25.at.15.56.59.mov
How to test:
Send the following requests at once (try arranging them in different orders):
Success badge 🟢 :
GET _searchClient error (warning) badge 🟡 :
GET _testServer error (danger) badge 🔴 :
^ This request should usually succeed and it was fixed in #188552, but these changes aren't in this branch yet so the request still fails. I couldn't find another example that returns a 5** status code.
Note: AFAIK Es currently only uses 2**, 4**, and 5** status codes (200 OK, 201 Created, 202 Accepted, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 429 Too Many Requests, 500 Internal Server Error, 503 Service Unavailable). Practically only the success, warning, and danger badges will be used, but added badges for the rest status codes in case they are added in Es.