sanger96 / Happenings_Team-5_UTD_Senior_Design_Project

UTD Senior Design Project; Group Members: Gaurav Sanger, Jonathan Lam, Robert Dohm, Landin Kasti, Charles Eaton
3 stars 0 forks source link

[Front-end] Event Creation Form #93

Closed sanger96 closed 3 months ago

sanger96 commented 3 months ago

All code is in app, needs testing to see if it works.

sanger96 commented 3 months ago

persisting error;

: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value : com.services.api.entity.Location.name] with root cause

org.hibernate.PropertyValueException: not-null property references a null or transient value : com.services.api.entity.Location.name

From what I have seen online this may be an issue with location.name technically being null when creating the eventFromForm. This doesn't make sense as the same values in postman seem to succeed.

LKASTI commented 3 months ago

Needs API call

jonathan-jlam commented 3 months ago

Very close to resolving this issue so that event creation works within the app.

jonathan-jlam commented 3 months ago

Event Creation form in-app is now functional. I spent some time troubleshooting and error and debugging and here are the findings.

The reason why Postman was able to post events to the database using /createFromForm is because we utilized the "form-data" sending type in Postman. However, the application is currently configured to send JSON requests only. Well then, why doesn't the backend method work anyway with JSON? Looking at the image below...

image

... you can see that /createFromForm is missing a @RequestBody. I was able to reproduce the error encountered by Gaurav in Postman, and found that ALL values were being passed to the database as null -- not just the location name (location name just so happened to be the first error thrown which would crash everything).

From my research, the easiest way to correct this issue is to re-implement the EventDTO.java class which Landin had created a while back. I have done so, and the new method works as intended.

image

image

image

The remaining things I want to accomplish for the event creation page: ~1. Changing the entering of the date to be more user-friendly. (Not 2024-04-10T01:00:00)~ Edit: Done

  1. Adding a place where we can link a club ID to an event? We can demo and say that a club leader would know their club's ID and can thus link it? maybe ~3. Navigating to some other page (either the newly created event, or the event list) upon successful creation of a new event~ Edit: Done - Goes to individual page created for that event
jonathan-jlam commented 3 months ago

UI/UX changes to Event Creation Form: Date and Time selection are now about as user-friendly as I can possible get them.

General form layout currently: image

You can now type in the date in the format of "MMM dd, YYYY" or use the selector widget. image

Same for time except the form is "HH:MM (AM | PM)" where the first H is optional if the hour is single digit. Selector can also be used. image

Still needs a few changes outlined in yesterday's comment above. Still functional with the database. Merged into main.