Skip to content

Add hours validation and test - #2488

Merged
junjun107 merged 6 commits into
developfrom
379-add-client-validation-for-hours-and-test
Aug 12, 2025
Merged

Add hours validation and test#2488
junjun107 merged 6 commits into
developfrom
379-add-client-validation-for-hours-and-test

Conversation

@junjun107

Copy link
Copy Markdown
Member


image

  • Hours cannot be blank
  • Closing time cannot be before opening time
  • Opening time cannot be same as closing time

Also updated test for longitude and latitude fail cases (long too low, too high, and lat too low, too high)

@junjun107
junjun107 force-pushed the 379-add-client-validation-for-hours-and-test branch from 902f3a2 to 08f75c1 Compare July 1, 2025 03:05
Comment thread client/src/components/Admin/OrganizationEdit.jsx Outdated

@SAUMILDHANKAR SAUMILDHANKAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @junjun107 for the tests. This is my next learning assignment. 👍

Nit picky: For longitude validation, when I type 500 I get longitude must be less than or equal to -117.6462 and then I enter -500 to get longitude must be greater than or equal to -118.9517. It could be just me but if we prompt the user the limits every time maybe that can be easier?

Playwright tests as part of workflow seem to be passing. I will look into if we can run these tests manually as well.

@junjun107

Copy link
Copy Markdown
Member Author

Good point. @SAUMILDHANKAR I think error message with a range is more clear. Like this screenshot below

image

@SAUMILDHANKAR

Copy link
Copy Markdown
Member

Thank you. Looks good to me.

@junjun107

Copy link
Copy Markdown
Member Author

Going to add a warning toast when there is any error on the page when user click on save progress button.

@junjun107

Copy link
Copy Markdown
Member Author

I added a simple toast message when user clicks on Save Progress when there is error messages in the form.
"Please fix the errors in the form before save progress.",
image

@SAUMILDHANKAR

SAUMILDHANKAR commented Jul 21, 2025

Copy link
Copy Markdown
Member

Thanks @junjun107 This was much needed. Some places I have seen that once you click save it takes you to the place on the screen with the first validation error. Will that be helpful? We can discuss in the meeting and I can create an issue for that if we want or maybe there is already an issue for that I will check.

@junjun107

Copy link
Copy Markdown
Member Author

Team Request: Change color of toast to warning

@junjun107

Copy link
Copy Markdown
Member Author

Added info" | "warning" | "success" | "error" type to toast/Alert and matched them with theme color.

export type ToastContextProps = {
  toast: {
    message: string;
    type?: "info" | "warning" | "success" | "error";
  };
  setToast: React.Dispatch<
    React.SetStateAction<{
      message: string;
    }>
  >;
};

Now error toast is in red
image

@hanapotski
hanapotski force-pushed the 379-add-client-validation-for-hours-and-test branch from 916e81a to 96a6cf8 Compare August 12, 2025 02:39
@hanapotski
hanapotski force-pushed the 379-add-client-validation-for-hours-and-test branch from 96a6cf8 to fe3d499 Compare August 12, 2025 02:41
@junjun107
junjun107 merged commit c0a1586 into develop Aug 12, 2025
1 check passed
@junjun107
junjun107 deleted the 379-add-client-validation-for-hours-and-test branch August 12, 2025 02:54
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.

3 participants