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

fix: Handle invalid input in TimeFieldMinMax, resolve missing CSS reference, and remove classnames #110

Closed
wants to merge 4 commits into from

Conversation

laurenic0l
Copy link
Contributor

@laurenic0l laurenic0l commented Nov 29, 2024

  • Added input validation for TimeField to handle invalid time entries
  • Updated onModify logic to validate and parse user input before setting the value.
  • Disabled the confirm button for invalid inputs
  • Removed missing CSS file reference (timeFieldMinMaxView.css)

closes #106 and closes #105

- Added input validation for TimeField to handle invalid time entries
- Updated `onModify` logic to validate and parse user input before
setting the value.
- Disabled the confirm button for invalid inputs
- Removed missing CSS file reference (`timeFieldMinMaxView.css`)
@laurenic0l laurenic0l changed the title fix: Handle invalid input in TimeField and resolve missing CSS reference fix: Handle invalid input in TimeFieldMinMax, resolve missing CSS reference, and remove classnames Nov 29, 2024
}
App.console().log(meeting.getValue() + "");
});
.onModify(e -> {
Copy link
Member

Choose a reason for hiding this comment

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

Use onValueChange and the get the value from the event's payload

confirm.setEnabled(true);
} catch (Exception ex) {
confirm.setEnabled(false);
App.console().log("Invalid time input: " + e.getText());
Copy link
Member

Choose a reason for hiding this comment

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

no browser console logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@@ -14,7 +13,6 @@

import java.time.LocalTime;

@InlineStyleSheet("context://css/fields/timefield/timeFieldMinMaxView.css")
@Route
@FrameTitle("Time Field Min/Max")
public class TimeFieldMinMaxView extends Composite<FlexLayout> {
Copy link
Member

Choose a reason for hiding this comment

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

Do something useful with the confirm button. A toast ?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented a toast to confirm the action

- Added validation to ensure the Confirm button is only enabled for
valid, non-empty time inputs.
- Updated toast message to confirm the action
@laurenic0l laurenic0l requested a review from hyyan December 2, 2024 15:50
- Updated the `TimeFieldMinMaxView` class to use `onValueChange` instead
of `onModify`.
Copy link

sonarcloud bot commented Dec 2, 2024

@hyyan
Copy link
Member

hyyan commented Dec 3, 2024

@hyyan hyyan closed this Dec 3, 2024
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.

Errors in TimeFieldMinMax Sample Remove Class Name Reference in TimeFieldView Sample
2 participants