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

Initilalize the validation value of the 'plan name' field to default instead of error #1421

Conversation

sgratch
Copy link
Collaborator

@sgratch sgratch commented Dec 26, 2024

Reference: https://issues.redhat.com/browse/MTV-1651

To avoid displaying an error on initialization for the 'plan name' empty field, when entering the wizard's step 2, leave the initialized validation value for this field as 'default.

Screncast before fix

Screencast.from.2024-12-27.01-36-08.webm

Screncast after fix

Screencast.from.2024-12-27.01-44-19.webm

…o default instead of error

Reference: https://issues.redhat.com/browse/MTV-1651

To avoid displaying an error on initialization for the 'plan name'empty field,
when entering the wizard's step 2, leave the initialized
validation value for this field as 'default.

Signed-off-by: Sharon Gratch <[email protected]>
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.21%. Comparing base (13484d0) to head (990f13e).
Report is 170 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1421      +/-   ##
==========================================
- Coverage   36.81%   36.21%   -0.60%     
==========================================
  Files         158      159       +1     
  Lines        2548     2579      +31     
  Branches      599      615      +16     
==========================================
- Hits          938      934       -4     
- Misses       1428     1463      +35     
  Partials      182      182              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sgratch sgratch requested a review from yaacov December 27, 2024 00:56
@sgratch sgratch added the bug Categorizes issue or PR as related to a bug. label Dec 30, 2024
@sgratch sgratch added this to the 2.8.0 milestone Dec 30, 2024
Copy link
Collaborator

@avivtur avivtur left a comment

Choose a reason for hiding this comment

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

Hi @sgratch
left one nitpick suggestion for you, and I have a question
I saw in the description the screen recordings, both in before and after when clicking next in the wizard you had to scroll up to view the field? is that because you're zoomed in or we have a focus issue here?

Comment on lines +93 to +94
Object.values(state?.validation || []).some((validation) => validation === 'error') ||
state?.validation?.planName === 'default'
Copy link
Collaborator

Choose a reason for hiding this comment

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

looking at this file, I see a lot of hard-coded values repeating, a nice nitpick would be starting to use constants in a separated constants.ts file as you did for title, it would help clean this file a bit

Copy link
Collaborator Author

@sgratch sgratch Jan 2, 2025

Choose a reason for hiding this comment

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

@avivtur Yes, this was a code convention used up till now - using hard-coded string values in most cases.

We can definitely refactor it as was done already in other places in code, but this will require refactoring the Validation type to use enum. Since this Validation type has many references, I prefer taking it out to a follow up PR. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the refactoring task ticket: https://issues.redhat.com/browse/MTV-1728

Copy link
Collaborator

Choose a reason for hiding this comment

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

A seprated PR is always a good idea :)

@sgratch
Copy link
Collaborator Author

sgratch commented Jan 2, 2025

I saw in the description the screen recordings, both in before and after when clicking next in the wizard you had to scroll up to view the field? is that because you're zoomed in or we have a focus issue here?

@avivtur This is a bug and thanks for raising it.
We are currently using the deprecated Wizard component and I didn't find a solution for that issue with it.
But based on what I checked, the PF5 Wizard component handles this bug already and we anyway need to migrate our code to use it , so:

  1. I'll migrate our code to use the PF5 Wizard as part of 🐾 Update to PF5 - part IV #1100 in a follow up PR.
  2. I'll open an issue bug for this so that it'll be tracked - https://issues.redhat.com/browse/MTV-1863

@avivtur
Copy link
Collaborator

avivtur commented Jan 2, 2025

/lgtm
as per suggestion will be expanded in a separated PR and ticket.

@sgratch sgratch merged commit f79044c into kubev2v:main Jan 2, 2025
11 checks passed
@sgratch sgratch deleted the set-plan-name-field-init-validation-value-to-default branch January 2, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants