Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

#730 add user settings #757

Merged
merged 44 commits into from
Jul 27, 2022
Merged

#730 add user settings #757

merged 44 commits into from
Jul 27, 2022

Conversation

jamescd18
Copy link
Member

@jamescd18 jamescd18 commented Jun 30, 2022

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.

  • All commits are tagged with the ticket number
  • No linting errors
  • No newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (if applicable)
  • Remove any not-applicable sections
  • Assign the PR to yourself
  • PR is linked to the ticket
  • No package-lock.json changes (unless dependencies have changed)
  • Request reviewers & ping on Slack

@jamescd18 jamescd18 self-assigned this Jun 30, 2022
@jamescd18 jamescd18 linked an issue Jun 30, 2022 that may be closed by this pull request
Copy link
Contributor

@anthonybernardi anthonybernardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it. so is the plan then to basically make the authenticated user thing part of a context when logged in so it gets stored and stuff so we only need it once?

src/backend/prisma/schema.prisma Outdated Show resolved Hide resolved
@jamescd18
Copy link
Member Author

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 jamescd18 requested a review from anthonybernardi July 4, 2022 16:14
Copy link
Contributor

@anthonybernardi anthonybernardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very cool. Here are some initial notes, haven’t gone fully in depth but I’ve looked at everything so far:

  • Will want to get rid of the top theme picker
  • Thomas emrax’s theme doesn’t load in as light on my local even if it’s set as his default theme
  • 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

src/frontend/app/app-public/app-public.tsx Outdated Show resolved Hide resolved
@jamescd18
Copy link
Member Author

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
Copy link
Contributor

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!

Copy link
Contributor

@anthonybernardi anthonybernardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our auth system is kinda elaborate

src/backend/functions/users.ts Show resolved Hide resolved
Copy link
Contributor

@anthonybernardi anthonybernardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@anthonybernardi anthonybernardi merged commit c834862 into main Jul 27, 2022
@anthonybernardi anthonybernardi deleted the #730-add-user-settings branch July 27, 2022 19:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users - Enable Users to Save Settings
2 participants