Skip to content

Conversation

AbhishekA1509
Copy link
Member

Description

This pull request refactors the cluster configuration form to improve validation, state management, and user experience around application monitoring and cost visibility configuration. The main changes include replacing the Prometheus toggle logic with a more generic application metrics toggle, introducing schema-based validation for cost visibility, and streamlining the handling of configuration states and errors.

Application Monitoring and Cost Visibility Improvements

  • Refactored the Prometheus toggle to use a more generic isAppMetricsEnabled state and toggleAppMetrics handler, updating all related props, logic, and UI components for clarity and consistency. Added logic to disable the application metrics toggle when cost visibility is enabled, with a tooltip explaining the restriction. [1] [2] [3] [4] [5] [6]
  • Updated the payload construction and form validation to use the new isAppMetricsEnabled state, ensuring Prometheus-related fields are only included when appropriate. [1] [2]

Cost Visibility Configuration and Validation

  • Introduced schema-based validation for cost visibility configuration using SCHEMA_07_VALIDATOR, replacing manual JSON parsing. Added costModuleSchema prop and related state handling, and ensured the provider field is not sent to the backend. Improved error handling and user feedback for invalid configurations. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Form Validation and Navigation Enhancements

  • Centralized additional validations (including cost visibility schema checks) and integrated them into tab switching and form submission, preventing navigation or submission when errors are present and providing clear toast messages to the user. [1] [2] [3]

Code Cleanup and Consistency

  • Updated imports and type usage to reflect new state and validation logic, removed unused error state for cost module config, and improved naming for clarity. [1] [2] [3]

Metadata and Prop Passing

  • Ensured costModuleSchema is passed through metadata and props to all relevant components, supporting schema-based validation and configuration. [1] [2]

Let me know if you'd like to dive deeper into any specific change or see how these improvements affect the user experience!

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copy link

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.

1 participant