-
Notifications
You must be signed in to change notification settings - Fork 17
feat: show streaming query stats in Info tab #3060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.tsx
Outdated
Show resolved
Hide resolved
src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.tsx
Outdated
Show resolved
Hide resolved
src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.tsx
Outdated
Show resolved
Hide resolved
src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/en.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
src/containers/Tenant/Query/Issues/Issues.tsx, line 143-154 (link)logic: bug comparing index to severity value
mostSevereIssuecontains the minimum severity number (e.g., 1 for S_ERROR), not an index. comparingindex === mostSevereIssuewill never work correctly - if the most severe issue has severity 1, only the item at index 1 would expand, not the actual most severe issue.need to track the index of the most severe issue during the reduce operation instead of just the severity value.
7 files reviewed, 1 comment
| @@ -190,7 +190,6 @@ | |||
| "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", | |||
| "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", | |||
| "dev": true, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update npm to version 11 and rollback changes in package.lock
|
|
||
| return content; | ||
| const onOpenModal = (issues?: IssueMessage[]) => { | ||
| NiceModal.show(CONFIRMATION_DIALOG, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice this first time, sorry, but we shouldn't use ConfirmationDialog here, cause it's not about confirmations.
| @@ -0,0 +1,5 @@ | |||
| .kv-streaming-query-info { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's apply this style to all query text in Diagnostics -> Info tab.
| FAILED: 'danger', | ||
| }; | ||
|
|
||
| function renderStateLabel(state?: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you use render function here, not a component?
| let errorData: ErrorResponse | string | undefined; | ||
| if (typeof errorRaw === 'string') { | ||
| try { | ||
| errorData = JSON.parse(errorRaw) as ErrorResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after parsing, let's check that parsed error is of type ErrorResponse (it seems type guard is needed)
| errorData = errorRaw; | ||
| } | ||
| } else if (errorRaw) { | ||
| errorData = errorRaw as ErrorResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Let's try not to use type casts, if it is possible.
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "fallback_no-data": "No data for entity:", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use rules of naming https://nda.ya.ru/t/mrGB97gd7MqSJh
| expanded, | ||
| onClick, | ||
| }: ErrorPreviewItemProps) { | ||
| let buttonLabel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
const buttonLabel = expanded ? i18n('action.hide-details') : i18n('action.show-details')
| return ( | ||
| <div className={blockWrapper('error-message')}> | ||
| {hideSeverity ? null : ( | ||
| <React.Fragment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Fragment is not needed here if we add gap for error-message css-class?
| export function ResultIssues({ | ||
| data, | ||
| hideSeverity, | ||
| detailsMode = ISSUES_VIEW_MODE.INLINE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would not add this property. Instead, Iβd recommend splitting the component into two separate components. As it stands, the current implementation violates the single responsibility principle, which makes the code harder to read and maintain.
cabf034 to
ad41dd7
Compare
Stand: https://nda.ya.ru/t/MBz7A5F67MiSzf
Example with empty error field: https://nda.ya.ru/t/ySdr2jMd7MiSXF
CI Results
Test Status: β PASSED
π Full Report
Test Changes Summary ποΈ189
ποΈ Deleted Tests (189)
Bundle Size:β οΈ
Current: 0.00 KB | Main: 0.00 KB
Diff: 0.00 KB (N/A)
βΉοΈ CI Information