Skip to content
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: request clusters handler only on Versions tab #2008

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Mar 12, 2025

Closes #1958

Previously versions was requested and mapped to colors in ExtendedCluster component and then passed as props to Versions. The problem of that approach - meta/clusters handler was requested on Overview, Databases and other tabs, where it is not needed. After the changes it will be requested only on Versions tab

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
264 263 0 0 1
Test Changes Summary ⏭️1

⏭️ Skipped Tests (1)

  1. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 83.21 MB | Main: 83.21 MB
Diff: 0.21 KB (-0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov marked this pull request as ready for review March 12, 2025 15:18
@astandrik astandrik requested a review from Copilot March 17, 2025 12:51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the way version color mapping is handled so that the clusters handler is only requested on the Versions tab. It removes the unnecessary versions prop from multiple components, centralizes the logic in the Versions container, and deletes unused hooks and types.

  • Removed the versionToColor prop from Versions and moved its retrieval inside the component using a new hook (useVersionToColorMap).
  • Cleaned up unused types (AdditionalVersionsProps) and the useClusterVersions hook.
  • Updated Cluster and ExtendedCluster components to stop passing outdated version-related props.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/containers/Versions/utils.ts Added useVersionToColorMap and refactored version mapping to be used only when needed.
src/containers/Versions/Versions.tsx Removed the versionToColor prop; now fetches it internally via the new hook.
src/containers/Cluster/Cluster.tsx Updated Versions component invocation to support the new version mapping approach.
src/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.tsx Removed AdditionalVersionsProps usage; cleaned up related imports and logic.
src/types/additionalProps.ts Removed deprecated AdditionalVersionsProps and its related type import.
src/containers/AppWithClusters/useClusterData.ts Removed as it is no longer used.
@artemmufazalov artemmufazalov added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit 7aacdfe Mar 17, 2025
8 checks passed
@artemmufazalov artemmufazalov deleted the 1958-versions branch March 17, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request meta/clusters only on Versions tabs
2 participants