Commit Graph

29 Commits

Author SHA1 Message Date
Teriuihi 4f3db5ae8b workspace.xml update 2024-08-10 00:36:00 +02:00
Teriuihi c9fc81cfca Add StaffAppFormData handling in FormQuery
Imported StaffAppFormData and updated deserialization logic to include it as a case in the FormQuery class. This allows the processing of staff application forms when parsing form data from JSON.
2024-08-10 00:35:42 +02:00
Teriuihi 5e564fe9a7 Remove restriction on dot character in Discord name validation
This change allows Discord names to include dots anywhere within the name, increasing flexibility for valid usernames. The previous regex pattern incorrectly restricted dots, affecting valid user entries.
2024-08-10 00:35:29 +02:00
Teriuihi 9e0a33e782 Correct regex pattern for case-insensitive match
Updated the regex pattern in `StaffAppFormData.java` to ensure that the "yes" or "no" answers are case-insensitive. This improves the form validation to accept "Yes", "YES", "No", or "NO" without errors.
2024-08-07 21:34:25 +02:00
Teriuihi 514aaeb367 Refactor packages and add exception handler.
Renamed various classes to follow the "controlers" package structure for better organization and consistency. Added `ControllerExceptionHandler` to manage validation exceptions globally and improve error logging.
2024-08-07 21:34:03 +02:00
Teriuihi caabe7b923 Refactor form submission to use dynamic Discord URLs and emails
Updated form classes to return Optional URLs for Discord bot submissions. Refactored VerifyController to handle these Optionals and improved error handling when sending forms. Added receiver email method in form classes for more flexible form submissions.
2024-08-07 00:36:22 +02:00
Teriuihi f972436717 Add getDiscordBotUrl method to form classes
Implemented getDiscordBotUrl in form classes for dynamic URL handling. Updated VerifyController to use this method for constructing Discord bot URIs. This enhances flexibility and maintainability in form submission handling.
2024-08-07 00:01:15 +02:00
Teriuihi 2ad194fab2 Update Jackson config and refactor JSON handling
Introduced Jackson dependencies to replace Gson for JSON processing. Updated application properties and controllers to handle Jackson-specific exceptions. Refactored form serialization to use Jackson's `ObjectMapper` for better date handling and consistency.
2024-08-06 23:58:15 +02:00
Teriuihi 2c3cb48667 Add REST annotations and refactor properties file handling
Introduced `@RestController` and `@RequestMapping` in `StaffAppController` for standardized API endpoints. Refactored properties file handling in `PropertiesLoader` and `PropertiesWriter` to simplify file creation logic.
2024-08-06 23:17:06 +02:00
Teriuihi 04088c20e5 Update CORS allowed origins configuration
Consolidated the allowed origins into a single `allowedOrigins` call. This ensures both local and production environments are correctly configured for CORS.
2024-08-06 23:16:38 +02:00
Teriuihi 34255c93c8 Add REST annotations to StaffAppController
Introduce `@RestController` and `@RequestMapping` annotations to the `StaffAppController` class. This change standardizes the API endpoint and ensures all methods within this class are mapped correctly under `/api/apply`.
2024-08-06 22:23:04 +02:00
Teriuihi 01deea380a Add Staff Application Form handling
Introduced `StaffAppController` and `StaffAppFormData` to handle staff application form submissions. The controller now stores user data, initiates email verification, and provides appropriate responses based on the verification outcome. Additionally, updated `application.properties` and cleaned up IntelliJ workspace.xml.
2024-08-06 22:21:43 +02:00
Teriuihi d53ba82e3e Refactor HTML generation in ContactFormData
Extract the HTML generation logic to a reusable method in the Form class. This change reduces code duplication and enhances maintainability by centralizing the table generation functionality.
2024-08-06 22:21:30 +02:00
Teriuihi ac5448385d Rename StoreFormQuery package to forms.form
Updated the package name for consistency and better categorization. Adjusted imports in related test files to reflect the new package structure.
2024-08-06 22:21:07 +02:00
Teriuihi d8ab42b09c Update URI to point to Discord bot endpoint
Changed the URI in VerifyController to use the Discord bot's endpoint for form submission. This adjustment is part of the process to route form data correctly through the specified internal service.
2024-08-05 01:08:51 +02:00
Teriuihi 14f02e535f Enhance logging for mail verification details
Updated logging to provide more detailed information about user credentials and email actions. This helps in debugging and monitoring mail verification processes more effectively. Adjusted trace messages to include username and password for better traceability.
2024-08-05 01:03:12 +02:00
Teriuihi cbb5dd99d8 Refactor logging for better granularity
Updated logging levels in multiple classes to differentiate between debug and trace information. Improved log messages to support parameterized logs, ensuring sensitive or variable information is handled appropriately without concatenation.
2024-08-05 00:45:48 +02:00
Teriuihi f68a96c089 Add CORS support for production server
Updated the CORS configuration to include the production server URL. This change ensures that requests from the production environment are properly handled.
2024-08-05 00:23:06 +02:00
Teriuihi 8cb22aae08 Configure system property for conditional test execution
Added a system property 'doNotRunDatabaseTests' in the test configuration to allow conditional skipping of database tests. This helps in running tests selectively during different build scenarios.
2024-08-04 22:54:48 +02:00
Teriuihi 405c2a73bd Fix typo in Gradle build command in Jenkinsfile
Corrected the parameter for skipping database tests from `dontRunDatabaseTests` to `doNotRunDatabaseTests` in the Gradle build step. This ensures the intended tests are skipped during the build process.
2024-08-04 22:53:35 +02:00
Teriuihi cb7bb60178 Disable database tests in Jenkins
Disabled tests that require a database connection to prevent failures in Jenkins where there isn't a database. Updated Jenkinsfile to include a property that skips these tests during the build process.
2024-08-04 22:52:01 +02:00
Teriuihi 4c70082f67 Add Jenkins pipeline for Gradle build and notifications
This commit introduces a new Jenkinsfile configured to build the project using Gradle and archive the resulting artifacts. Additionally, it includes a stage to send build notifications to Discord with details about the build status.
2024-08-04 22:44:13 +02:00
Teriuihi ab9ec4127c Add DB config via command-line arguments
A new setup allows specifying database properties path using command-line arguments during startup. The `DatabaseConnection.initialize()` method signature has been updated to accept a path argument. Methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes, along with tests in the `TestForm` class, were adjusted accordingly.
2024-08-04 22:44:03 +02:00
Teriuihi 49af4a3067 Add database configuration via command-line arguments
A new configuration setup now allows specifying a path for database properties via command-line arguments during application startup. This update also changes the call signature for `DatabaseConnection.initialize()` method to accept a path argument. Similarly, methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes were also updated to use the specified path when working with properties files. The `TestForm` class's tests were updated accordingly to handle these changes.
2024-04-28 21:25:09 +02:00
Teriuihi 2f1d24598b Update Form HTML output and disable validation auto-configuration
The form-to-HTML output process has been switched from a `<div>` approach to using a `StringBuilder` with a table structure in `ContactFormData.java`. Also, the spring validation auto-configuration has been disabled by adding `exclude = ValidationAutoConfiguration.class` in the `@SpringBootApplication` annotation of `Main.java`. Some changes in `.idea/workspace.xml` and `VerifyController.java` were made as well.
2024-04-28 17:58:43 +02:00
Teriuihi 4ec41d8a7e Mark fields as final in VerificationData and ContactFormData
The 'code', 'eMail' fields in the VerificationData class and 'username', 'email', 'question' fields in the ContactFormData class are now marked as 'final'. At the same time, some unused imports from ContactController, ContactFormData, FormQuery, and VerifyController have been removed for code cleanliness.
2024-01-14 11:20:08 +01:00
Teriuihi 917965a33d Add TestForm class and set up related unit tests
The changes add a new TestForm class to implement unit tests for form handling in the application. The included tests verify the storing, retrieving, and verification of forms from a database, as well as form object creation and confirmation of form data. This is a step towards improving the code's reliability and making it easier to catch potential bugs or issues.
2024-01-14 11:09:35 +01:00
Teriuihi 0464281a38 Refactor code to use Form objects instead of JSON strings
Several parts of the code have been altered to use Form objects instead of JSON strings. Changes include updating the FormQueryResult record type to hold an Optional<Form> instead of an Optional<String>, altering methods in the StoreFormQuery class to insert Form data into the database and replacing JSON handling methods in the FormQuery class with Form object oriented methods. A 'form_class' field has also been added to the 'form' table in the database to aid form identification and reconstruction from stored data.
2024-01-14 11:09:22 +01:00
Teriuihi 2b908b4e94 Initial commit for site for forms 2024-01-13 16:24:54 +01:00