Together-100Devs / Together

Together is a group calendar application using the MERN stack intended to bring discord communities closer!
https://together.cyclic.app/
MIT License
167 stars 112 forks source link

Feature/admin dashboard event visualization 407 #431

Closed cblanken closed 1 year ago

cblanken commented 1 year ago

Description

Display all current events on Admin Dashboard. The AdminDashboard page now loads all current events and displays them in a list. The page initially loads all the current events automatically, but any subsequent refreshes must use the "Refresh Events" button in the top right.

NOTE: All tests passed for the first two commits cdd0cd709e3845aaa2c75b2cf391cb8d099b61f8 and cbfaa9fceae3197504fc3cb791d4d5bb3df4c0f5. However, the Admin dashboard cannot currently be accessed while running the development build due to an old /calendar redirect in client/src/contexts/AuthContext/useProvideAuth.js. The latest commit d6db77b81fcb7002fe28e2e1846341a4d40b7f64 removes this redirect for testing the Admin Dashboard, but some adjustments will need to be made to the relevant failing tests.

I've attached test-events.zip with a json file that can be imported into the events Mongo collection to test the loading animation with a large set of events.

Page while loading

together-admin-dashboard1

Page after load

together-admin-dashboard2

Type of change

Please select everything applicable. Please, do not delete any lines.

Issue

Checklist:

Caleb-Cohen commented 1 year ago

Code looks good. Should we consider additional testing?

For example: insert event into DB, does it visualize?

cblanken commented 1 year ago

Looks good so far, what are your thoughts on deleting the event and checking if it no longer exists?

My thinking is that I should be able to send a DELETE to the /event/:id endpoint and just delete any notes by id. I might add a Cypress command like deleteOwnEvents to make it a bit easier to use.

Then the rendering check can loop through any remaining notes and confirm the note with the target id no longer exists.

I should be able to take a look at it in the next couple days and let you know if I run into any issues with that method.

Caleb-Cohen commented 1 year ago

Looks good so far, what are your thoughts on deleting the event and checking if it no longer exists?

My thinking is that I should be able to send a DELETE to the /event/:id endpoint and just delete any notes by id. I might add a Cypress command like deleteOwnEvents to make it a bit easier to use.

Then the rendering check can loop through any remaining notes and confirm the note with the target id no longer exists.

I should be able to take a look at it in the next couple days and let you know if I run into any issues with that method.

That's how I would approach it!

Caleb-Cohen commented 1 year ago

LGTM Thanks for taking this on!