Northeastern-Electric-Racing / PM-Dashboard-v2

Northeastern Electric Racing Project Management Dashboard - version 2
https://nerpm.netlify.app
GNU Affero General Public License v3.0
15 stars 2 forks source link

#730 add user settings #757

Closed jamescd18 closed 2 years ago

jamescd18 commented 2 years ago

Changes

Added user settings to the database model and prisma and seed data.

Okay so basically my plan here was to separate out and have the login endpoint be what first returns the user settings, since this would avoid an extra call to the server and allow us to set up the app with the user's preferred settings as soon as they log in.

This also goes along with my plan to change around the user endpoints to remove sending unnecessary info to the front-end whenever possible. Having a singular unified User interface makes that somewhat difficult, so this take a first step to try and have a separate interface for authenticated user and see how things go.

Screenshots

Screen Shot 2022-07-02 at 3 42 11 AM Screen Shot 2022-07-02 at 3 42 28 AM Screen Shot 2022-07-02 at 3 42 52 AM

instant change post-change

Screen Shot 2022-07-02 at 3 43 17 AM

preserved on reload, theme is loaded on login

Screen Shot 2022-07-02 at 3 43 41 AM

Checklist

It can be helpful to check the Checks and Files changed tabs. Please review the contributor guide and reach out to your squad if anything is unclear. Please request reviewers and ping on slack only after you've gone through this whole checklist.

jamescd18 commented 2 years ago

Yeah basically. I guess it kinda depends on how we expand user settings and what we store in there. We would separately enable editing of user settings via the settings page.

jamescd18 commented 2 years ago

Will want to get rid of the top theme picker

I figured we could keep it. did you think it's better removed? cuz if we remove it then there's technically no way to change your current theme without changing your default theme, right? Is this what you'd want?

Thomas emrax’s theme doesn’t load in as light on my local even if it’s set as his default theme

hmmm, any ideas why?

I think that all users will naturally have no settings because it’s optional and then all the endpoints will not work because they assume it already exists, when they should probably create a default settings if it doesnt exist

I was figuring we would fix this by manually generating settings for everyone when we deploy this, which I think is no biggie given the manual script

anthonybernardi commented 2 years ago

ok so I see why it doesn't work on dev signing and im pretttty sure this will work on prod. The one commit I made was just so that it uses the chosen theme instead of the default theme value in the hook

looks good to me!