ucsb-cs156-s24 / proj-courses-s24-4pm-2

https://ucsb-cs156-s24.github.io/proj-courses-s24-4pm-2/
0 stars 0 forks source link

Kelly - Updating Default Quarter to be End Quarter #22

Closed kmflippo closed 1 month ago

kmflippo commented 1 month ago

Updating default quarter to be endquarter on all quarter dropdowns.

If there is no localstorage, the page should open with the quarter at the end of the quarter array as the default quarter.

To test this PR on a Mac and on chrome, open the dokku deployment, log in, click F12, go to Application, then right click the dokku deployment site name and clear local storage. Re put in the link in the browser again and click enter (don't reload).

https://support.conquer.io/hc/en-us/articles/5821475923988-How-to-clear-local-storage-in-Chrome

Bug: W21 is the earliest quarter so it should not be first

image

Correct behavior: M25 is my env variable for end quarter so this should be the default

image

Other correct behavior: if I select another quarter (like W22) and reload the page, the quarter I previously selected has gone into local storage and the quarter dropdown will still display W22.

https://proj-courses-kmflippo-dev.dokku-02.cs.ucsb.edu/

Another note: I noticed that before this change whenever I would open the prod deployment for the first time, the default quarter would be W22 instead of whatever the earliest quarter was, despite having correct code to display the earliest quarter. I looked, and it is because the default environment variables are W22 for start quarter, and S22 for end quarter. Whenever the website opens, it tries to get the environment variables, hits the default ones instead (maybe it is too quick or something) and then localstorage ends up picking the default start quarter variable. With my change, since the default end quarter variable is S22, S22 always appears instead of W22 upon opening the webpage for the first time. This makes sense because I made changes to pick end quarter as default quarter. I think this is something we can make a card for later.

Closes #23

pconrad commented 1 month ago

Remember that bit in the Listening to Developers paper about how sometimes the spec keeps changing?

I promise you: we don't do this on purpose. It just happens naturally, and then you get to learn how real development works. We are going to change the spec on you for PR22. The good news is that I think it's a pretty small change, and it should be easy to adjust your PR.

The reason is that I had not communicated my intent clearly to Anika, who wrote up the issues on my behalf. So if there's any "blame" to be assigned, assign it to me not her.

So instead of https://github.com/ucsb-cs156-s24/proj-courses-s24-4pm-2/issues/9 we'd like you to implement https://github.com/ucsb-cs156-s24/proj-courses-s24-4pm-2/issues/23

It's very similar!