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

adding input validation to application dates #152

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

niclasheun
Copy link
Contributor

This pull request includes several improvements and new features for the ApplicationConfigDialog component in the application administration section. The most important changes include adding new state variables, using useEffect to reinitialize form values, validating date and time input, and enhancing error handling.

State Management and Initialization:

  • Added new state variables for endDate, startTime, endTime, externalStudentsAllowed, universityLoginAvailable, and dateError.
  • Implemented useEffect to reinitialize form values when the dialog is opened or when initial data changes.

Validation:

  • Added validation to ensure the start date and time come before the end date and time, and set an appropriate error message if the validation fails.

Error Handling:

  • Created a new ApplicationConfigDialogError component to display error messages in a user-friendly manner.
  • Updated the dialog to use the new ApplicationConfigDialogError component for displaying errors.

Code Improvements:

  • Changed some imports to use type imports for better type safety and clarity.
  • Refactored the handleSubmit function to build full Date objects by combining date and time values before submission.

These changes enhance the functionality, maintainability, and user experience of the ApplicationConfigDialog component.

@niclasheun niclasheun self-assigned this Feb 8, 2025
@niclasheun niclasheun linked an issue Feb 8, 2025 that may be closed by this pull request
@niclasheun niclasheun merged commit d18b876 into main Feb 9, 2025
24 checks passed
@niclasheun niclasheun deleted the input-validation-application-config branch February 10, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Input Validation to Application Phase Configuration
1 participant