Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User store extended settings store #828

Merged
merged 20 commits into from
Jan 21, 2025
Merged

Conversation

devmount
Copy link
Collaborator

Description of the Change

This change

  • Extends the subscriber model by all currently existing general settings (language, timezone, color scheme and time mode)
  • Extends the user store to handle those settings and the UI to save the settings on change to the db
  • Cleans up a lot of todos and deprecated code
  • Extends user store tests for all general settings

Benefits

Settings are now saved and restored consistently over multiple devices.

Applicable Issues

Closes #804

@devmount devmount self-assigned this Jan 20, 2025
Copy link
Collaborator Author

@devmount devmount left a comment

Choose a reason for hiding this comment

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

Some notes on the changes.

backend/src/appointment/database/schemas.py Outdated Show resolved Hide resolved
frontend/index.html Show resolved Hide resolved
frontend/src/App.vue Show resolved Hide resolved
frontend/src/App.vue Show resolved Hide resolved
frontend/src/App.vue Show resolved Hide resolved
frontend/src/components/FTUE/Finish.vue Show resolved Hide resolved
frontend/src/models.ts Show resolved Hide resolved
frontend/src/stores/user-store.ts Outdated Show resolved Hide resolved
Copy link
Member

@MelissaAutumn MelissaAutumn left a comment

Choose a reason for hiding this comment

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

Looks good, just some small nits about colour which I realize is a bit silly. So no worries on changing that.

backend/src/appointment/database/models.py Outdated Show resolved Hide resolved
backend/src/appointment/database/models.py Outdated Show resolved Hide resolved
backend/src/appointment/database/schemas.py Outdated Show resolved Hide resolved
backend/src/appointment/database/schemas.py Outdated Show resolved Hide resolved
backend/src/appointment/routes/api.py Outdated Show resolved Hide resolved
backend/src/appointment/routes/auth.py Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
// Init user config if not already available
if (!data.value?.settings) {
const dj = inject(dayjsKey);
const detectedTimeFormat = Number(dj('2022-05-24 20:00:00').format('LT').split(':')[0]) > 12 ? 24 : 12;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The hourCycle property turned out to not being meant to work for detection. It is just a property already coded in the locale, e.g. the "h23" in "fr-FR-u-hc-h23". The function actually providing time format information for locales is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles but thats not yet working in Firefox, unfortunately.

devmount and others added 2 commits January 21, 2025 16:58
…15d01919b8_add_config_fields_to_subscribers_table.py

Co-authored-by: Mel <[email protected]>
@MelissaAutumn
Copy link
Member

Looks like backend tests are broken right now

@devmount
Copy link
Collaborator Author

Yes, I'm on it

@devmount devmount merged commit dc7376a into main Jan 21, 2025
4 checks passed
@devmount devmount deleted the enhancements/804-settings-store branch January 21, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save user language setting to db
2 participants