Azordev / did-admin-panel

https://www.did-admin.tk/
Apache License 2.0
0 stars 0 forks source link

fix: fixed some problems in events view #247

Closed heliomar-pena closed 2 years ago

heliomar-pena commented 2 years ago

Description

Fixed the problem in the event view with the date-time input, which is causing the user can't save the input easily. The problem was the ms, since they aren't handled fine by browsers. As this ms isn't needed by the end user I have removed it.

On the way, I changed the datetime-local input for two inputs, one of them for the date and another for the time, this looks so similar to the before option, but I think that gives a better UX to the user since is more intuitive of fill, but in case that we have to use datetime-local input, I can change again for it without problem

@angelik0828 commented to me that the switch for Attendance / Workshop was not working, so I checked it and found that the problem was the way to handle the state (it's a little hard, I really don't like so much how works react use form hook), so I changed the logic to handle the Switch trying to simplify it, at the end, the Handle Submit function check if the checkbox is saying that is Attendance o Workshop, now is working properly

At last, when I was able to send the form, I received an error similar to: `e.preventDefault() is not a function, I checked and the problem was that the callback was receiving bad parameters, the first parameter was just an object with the form values, and the second parameter was the Event, I updated this function and now is working properly, but that have caused problems in the types.

Currently, the problem that have Events view is that when a user edits an event and doesn't provide any image, the last image was lost, @e-azocar maybe you could help with it?, what I think that we could do is validate, if we receive and File Object, then upload the image to AWS, if we receive a String, we use the same String, so avoid delete the image field

fixes #237

Screenshots

lastrecord

Type of change

Please delete options that are not relevant.

How to test it

If applicable, describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  1. Go to deployment link
  2. Log in as admin
  3. Create an event
  4. Edit an event

Checklist:

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
did-admin-panel ✅ Ready (Inspect) Visit Preview Sep 16, 2022 at 3:20AM (UTC)
heliomar-pena commented 2 years ago

@e-azocar can you help me to see why fails the deploy in vercel?

imagen

e-azocar commented 2 years ago

@victor-heliomar image When build fails, try running yarn build

Israel-Laguan commented 2 years ago

Tested and confirmed the image issue

CC: @e-azocar