-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: enhance query detail page with cluster support and improve UI components #431
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis PR enhances the query handling functionality by adding cluster support and improves UI components through code refactoring. The changes introduce the ability to query across different clusters while maintaining a cleaner, more modular component structure. Sequence diagram for fetching query details with cluster supportsequenceDiagram
participant User
participant QueryDetail
participant DropdownCluster
participant QueryDetailCard
participant ClickHouse
User->>QueryDetail: Request query details
QueryDetail->>DropdownCluster: Initialize cluster dropdown
DropdownCluster->>ClickHouse: Fetch cluster data
ClickHouse-->>DropdownCluster: Return cluster data
QueryDetail->>QueryDetailCard: Initialize query detail card
QueryDetailCard->>ClickHouse: Fetch query data
ClickHouse-->>QueryDetailCard: Return query data
QueryDetailCard-->>User: Display query details
Class diagram for QueryDetail and related componentsclassDiagram
class QueryDetail {
+QueryDetail(queryConfig, params, searchParams)
}
class QueryDetailCard {
+QueryDetailCard(queryConfig, params, searchParams)
}
class QueryDetailBadge {
+QueryDetailBadge(queryConfig, params, searchParams)
}
class DropdownCluster {
+DropdownCluster(params, searchParams, className)
}
QueryDetail --> QueryDetailCard
QueryDetail --> QueryDetailBadge
QueryDetail --> DropdownCluster
QueryDetailCard --> ErrorAlert
QueryDetailCard --> TruncatedList
QueryDetailCard --> TruncatedParagraph
QueryDetailCard --> Accordion
QueryDetailCard --> fetchData
QueryDetailBadge --> Badge
QueryDetailBadge --> fetchData
DropdownCluster --> ErrorAlert
DropdownCluster --> Button
DropdownCluster --> DropdownMenu
DropdownCluster --> fetchData
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @duyet - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
import { type RowData } from './config' | ||
import { PageProps } from './types' | ||
|
||
export async function QueryDetailBadge({ |
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.
suggestion (performance): Consider lifting data fetching to parent component to avoid duplicate queries
This component and QueryDetailCard are fetching the same data. Consider fetching once in a parent component and passing the data down to both children to improve performance.
export function QueryDetailBadge({
queryConfig,
params,
queryData,
}: {
queryConfig: RowData
params: PageProps
queryData: any
}) {
const config = clientConfig | ||
? clientConfig | ||
: getClickHouseConfigs()[hostId || getHostId()] |
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.
suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary
)
const config = clientConfig | |
? clientConfig | |
: getClickHouseConfigs()[hostId || getHostId()] | |
const config = clientConfig || getClickHouseConfigs()[hostId || getHostId()] | |
Explanation
It is possible to simplify certain ternary statements into either use of an||
or !
.This makes the code easier to read, since there is no conditional logic.
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #431 +/- ##
==========================================
- Coverage 78.34% 77.16% -1.19%
==========================================
Files 5 5
Lines 157 162 +5
Branches 58 60 +2
==========================================
+ Hits 123 125 +2
- Misses 31 34 +3
Partials 3 3 ☔ View full report in Codecov by Sentry. |
Bundle ReportChanges will increase total bundle size by 4.8kB (0.07%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
Summary by Sourcery
Enhance query handling by adding support for executing queries across clusters and refactor UI components to improve the user interface and code maintainability.
New Features:
Enhancements: