Commit Graph

20 Commits

Author SHA1 Message Date
Teriuihi 8fda5d9fb9 Initial appeal commit 2024-10-06 00:27:29 +02:00
Teriuihi ee54e91051 Add event application form
Implemented a new event application form with validations and necessary fields such as username, email, and event experience. Incorporated the form into the home page with a navigation link and updated form interfaces and data configurations.
2024-09-20 18:01:38 +02:00
Teriuihi ceaca60ece Add additional_info field to form requirements
Include extra guidance for the user to specify their timezone. This aims to reduce ambiguity and ensure better form submissions. The change is minimal but improves overall user experience.
2024-08-11 18:41:56 +02:00
Teriuihi cf7bdeb481 Enforce integer validation on age and average time fields
Added integer validation messages to the age and avg_time fields to ensure users enter whole numbers. This enhances the form's data integrity by preventing input errors.
2024-08-10 04:35:54 +02:00
Teriuihi afb833bd19 Add useCallback to optimize handleCheckForm
Refactored handleCheckForm using useCallback to prevent unnecessary re-renders. This ensures the function is only re-created when formData.backendFormName changes, improving performance. Updated useEffect dependencies to include handleCheckForm for proper effect cleanup.
2024-08-10 03:27:28 +02:00
Teriuihi 6215944972 Fix missing promise handling in formActiveRedirect
Added a then() clause to handle the resolved promise after calling handleCheckForm in the useEffect. This ensures any asynchronous operations complete as expected and avoids potential unhandled promise rejections.
2024-08-10 03:24:46 +02:00
Teriuihi 98b86363f5 Add npm install fallback and remove unused variable
Added a fallback npm install command in the Jenkinsfile to handle legacy peer dependencies. Also removed an unused variable from genericForm.tsx to improve code clarity and performance.
2024-08-10 03:19:26 +02:00
Teriuihi 75559af7c8 Add form active status check and redirection
Introduced `FormActiveRedirect` component to check if forms are active before rendering. Updated form data to include `backendFormName` and adjusted routes in `App.tsx` to use the new component. This ensures that inactive forms redirect users with a relevant message.
2024-08-10 03:10:25 +02:00
Teriuihi 21e23b98ad Remove unused Field import from GenericForm
This commit eliminates the unused Field import from Formik in the genericForm.tsx file. Removing unused imports helps maintain cleaner and more efficient code.
2024-08-10 00:27:24 +02:00
Teriuihi d005b72634 Add react-select component and integrate into FormHTML
Added `react-select` library dependency to `package.json` and lock file. Created a new `FormHTML` component in `formHTML.tsx` to handle form field rendering, including support for `select` fields using `react-select` for multi-select functionality.
2024-08-10 00:25:44 +02:00
Peter 51642612ec More style changes 2024-08-09 23:16:41 +02:00
Teriuihi cde2a01dd9 Refactor form to use useFormik and FormikProvider
Replaced Formik component with useFormik hook and FormikProvider. This change simplifies the form implementation and separates the form's logic and presentation. The form now benefits from more direct access to formik methods and state.
2024-08-08 21:37:09 +02:00
Peter 4dda70effc Styling for forms 2024-08-08 21:32:37 +02:00
Teriuihi 94c336fb74 Add dropdown and additional info fields to form steps
Updated form interfaces to include optional dropdown and additional info properties. Adjusted form rendering logic to handle these new fields, providing clearer instructions and choices for users. Refined validation messages for consistency and clarity.
2024-08-08 20:33:15 +02:00
Teriuihi 973b6b5e7d Add titles to form data and display them dynamically
Incorporated 'title' property into form data objects for dynamic rendering in the GenericForm component. This enhancement facilitates the use of specific titles for different forms, improving readability and user experience.
2024-08-07 00:41:11 +02:00
Teriuihi f52201b683 Rename variables for clarity and adjust download filename and contents
Renamed the parameter 'e' to 'formikValues' for better clarity in the handleSubmit function. Now load formikValues into the file that get's uploaded so it has the up to date form data. Changed the downloaded JSON filename from 'form_data.json' to 'your_form_data.json' to be more user-friendly.
2024-08-06 23:21:53 +02:00
Teriuihi 9a281ed76c Update backend URLs to use environment variables
Replaced hardcoded backend URLs with environment variables in contact, apply, and verify_email components. Added .env.development and .env.production files to define the base URLs for different environments. This improves flexibility and allows easier configuration changes.
2024-08-06 23:17:37 +02:00
Teriuihi 997baae4d3 Fix JSON serialization in error handling
Replaced steps variable with userInput for JSON serialization in error handling. This ensures that the correct data is saved as a JSON blob when a network error occurs.
2024-08-06 22:28:41 +02:00
Teriuihi 857d61e09d Add staff application form
Introduced a new form for staff applications based on the old staff application form.
2024-08-06 22:23:35 +02:00
Teriuihi d2f15d2627 Refactor forms to use a generic form component
Replaced the contact form with a generic form component to support multiple form configurations. Moved validation schema and form data to a new structure, allowing dynamic form rendering. Updated the App component to utilize this generic approach for handling different forms.
2024-08-06 21:07:20 +02:00