fix(probe): initialize comparator type ref from loaded probe data#5502
Open
pcandido wants to merge 12 commits into
Open
fix(probe): initialize comparator type ref from loaded probe data#5502pcandido wants to merge 12 commits into
pcandido wants to merge 12 commits into
Conversation
…edit Signed-off-by: Paulo Cândido <paulo.candido@ifood.com.br>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an issue where editing existing CMD/Prometheus probes would reset the comparator data type to int instead of preserving the saved type, and adds missing TypeScript module declarations for SCSS imports to prevent TS2307 during typechecking.
Changes:
- Initialize CMD and Prometheus comparator type refs from loaded probe data (
props.formData) instead of hardcodingint. - Add ambient TypeScript declarations for
*.module.scssand*.scssimports inglobal.d.ts.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| chaoscenter/web/src/views/AddProbeModalWizard/AddProbeModalWizard.tsx | Initializes comparator type refs from existing probe data to preserve edit-state comparator behavior. |
| chaoscenter/web/src/global.d.ts | Adds missing SCSS module/type declarations to fix TypeScript import errors during typechecking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
@pcandido could you please review the comments from co-pilot |
Contributor
|
@pcandido could you please share a video or a screenshot of the working fix here? |
Contributor
Author
|
Here we go Before fix (v3.29.0): before_compressed.mp4After fix: after_compressed.mp4 |
SarthakJain26
approved these changes
Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
closes #5500
When editing an existing CMD or Prometheus probe, the comparator type (int, float, string) was always reset to int regardless of the previously saved value. This happened because cmdComparatorType and promComparatorType refs were hardcoded to 'int' instead of being initialized from the loaded probe data.
This fix initializes those refs from props.formData, so the correct comparator type is preserved when editing a probe.
Types of changes
What types of changes does your code introduce to Litmus? Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
Special notes for your reviewer:
The global.d.ts change fixes a pre-existing gap: there were no type declarations for .scss / .module.scss imports. This caused tsc to emit TS2307 on YAMLBuilder.tsx whenever it was pulled in as a transitive dependency during typecheck:staged. The error is unrelated to the probe fix itself but blocks the pre-commit hook without this declaration.