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

Use localStorage to cache logged-in user #124

Merged
merged 4 commits into from
Sep 18, 2023

Conversation

radishmouse
Copy link
Contributor

@radishmouse radishmouse commented Jul 31, 2023

This change closes #118:

  • stores the logged-in user's information in localStorage
  • retrieves user info from localStorage
  • checks for cached user info instead of accessing backend when switching between views

localStorage.removeItem(STORAGE_KEY);
}

export function updateUserInStorage(obj) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vue complains if you try to assign to a prop.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, normally you would emit an event to the prop holding component which then updates the prop. But for now this should be fine.

@@ -63,6 +64,7 @@ const logout = () => {
returnTo: window.location.origin,
},
});
removeUserFromStorage();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removes the stored user when logging out

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just thinking: Should the user be removed from storage before doing the actual logout? To be sure that the stored session is definitely invalidated in case the auth.logout fails?

export const userStore = ref(userObj);

// Store in localStorage on update
watch(userStore, (newUser) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is triggered by App.vue when we first log in.
We may decide later on to make the user a provide() value, in which case it could also be triggered from the Account settings view

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, makes sense, I would like this 👍🏻

function copyRefValuesToObj(aRef, obj) {
keys.forEach((k) => {
try {
obj[k] = aRef[k] ?? aRef.value[k];
Copy link
Contributor Author

@radishmouse radishmouse Jul 31, 2023

Choose a reason for hiding this comment

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

I'm not sure if there's a better way to do this... I had to wrap it in a try/catch when accessing the timzeone field (and possibly other fields that don't already exist).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, feels like there is an easier way, but I don't currently don't see it either 😅

frontend/src/stores/user-store.js Show resolved Hide resolved
frontend/src/App.vue Show resolved Hide resolved
@@ -63,6 +64,7 @@ const logout = () => {
returnTo: window.location.origin,
},
});
removeUserFromStorage();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just thinking: Should the user be removed from storage before doing the actual logout? To be sure that the stored session is definitely invalidated in case the auth.logout fails?

function copyRefValuesToObj(aRef, obj) {
keys.forEach((k) => {
try {
obj[k] = aRef[k] ?? aRef.value[k];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, feels like there is an easier way, but I don't currently don't see it either 😅

export const userStore = ref(userObj);

// Store in localStorage on update
watch(userStore, (newUser) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, makes sense, I would like this 👍🏻

localStorage.removeItem(STORAGE_KEY);
}

export function updateUserInStorage(obj) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, normally you would emit an event to the prop holding component which then updates the prop. But for now this should be fine.

@radishmouse radishmouse merged commit 52639a9 into main Sep 18, 2023
@radishmouse radishmouse deleted the features/118-fe-user-sessions branch September 18, 2023 15:17
devmount added a commit that referenced this pull request Sep 27, 2023
* Booking page and general availability (#104)

* 🔨 enable booking page for general availability

* ❌ revert debugging changes

* Replace router.fullPath with window.location.href, as signed urls require a complete url.

* ➕ add route checks

* Fix docker dev server with the new sentry webpack stuff.

* Features/98 ga data structure (#108)

* Add models and schemas for Schedule and Availability

* Fix missing/incorrect back_populates= for Appointment and Schedule

* Add migration file for schedule and availability tables

* Respond to PR feedback

* Fix migration issue

Happened because two migrations were auto generated in parallel.

* Bugs/caldav connector clean up (#112)

* 🔨 fix value check on updating calendars

* 🔨 remove deprecated provider code

* 👕 fix linter issues

* Fix call on appointment id before NoneType check (#113)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* Schedule API endpoints (#114)

* ➕ add schedule API endpoints

* Get current backend tests (#122)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* 🔨 migrate data structure to current mockup

* ➕ endpoint for schedule creation

* ➕ add schedule test

* ❌ remove appointment type

* 🔨 improve model types and link verification

* ➕ time slots calculation from schedule config

* ➕ time slots comparison with remote events of assigned calendar

* ➕ compare schedule to all connected calendars

* ➕ check calendar connections first

* ➕ add test for invalid availability link

* ➕ check if actual booking slots exist

* Use localStorage to cache logged-in user (#124)

* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Update frontend/src/views/ProfileView.vue

Co-authored-by: Andreas <mail@devmount.de>

---------

Co-authored-by: Andreas <mail@devmount.de>

* Features/97 Schedules settings page (#128)

* Draft of GA Settings page (#126)

* Basic layout without form

* Finish styling header for general availability

* Finish fake step 1

* Add placeholders for forms, adds buttons

* Add placeholders for date and time inputs

* Add placeholder for step 3

* Change form inputs to correct types

* Additional styling on GA creation view

* Makes booking settings reactive, styles slot length

* Make sections toggle-able

* Set start/end time v-model refs

* Enable date picker for start/end date; add control to remove end date

* Sets default days; shows action buttons

* ➕ implement schedules page frontend

* ➕ implement schedule live preview

* 🔨 fix schedule preview on calendar navigation

* 🔨 fix calendar view tab navigation

* 🔨 fix names and calendar title in preview tooltip

* 🔨 handle unset schedule end date

* ➕ connect schedule page to actual schedule API endpoints

* ➕ add active flag for schedules

* ➕ extend toggle component

* ➕ add disabled state for tab bar

* ➕ implement schedule activation toggle

* 🔨 convert schedule times to utc

* 🔨 fix misaligned starting date for scheduled time slots

* 🔨 make list of weekdays aware to locale start day of week

* 🔨 fix calendar for different start of weeks

* 🔨 reload on locale change to update dayjs instance

* ➕ add option for event popup on right side

* ➕ add month navigation for booking page

* ➕ endpoint for availability booking

* 🔨 fix timezone back calculation on schedule config

* 🔨 fix remote event datetime format

* 🔨 show confirmation modal only on first schedule save

* ➕ implement ICS serving endpoint for schedule availabilities

---------

Co-authored-by: Melissa Autumn <melissa@thunderbird.net>
Co-authored-by: Chris Aquino <chris@thunderbird.net>
devmount added a commit that referenced this pull request Oct 4, 2023
* Schedule API endpoints (#114)

* ➕ add schedule API endpoints

* Get current backend tests (#122)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* 🔨 migrate data structure to current mockup

* ➕ endpoint for schedule creation

* ➕ add schedule test

* ❌ remove appointment type

* 🔨 improve model types and link verification

* ➕ time slots calculation from schedule config

* ➕ time slots comparison with remote events of assigned calendar

* ➕ compare schedule to all connected calendars

* ➕ check calendar connections first

* ➕ add test for invalid availability link

* ➕ check if actual booking slots exist

* Use localStorage to cache logged-in user (#124)

* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Update frontend/src/views/ProfileView.vue

Co-authored-by: Andreas <mail@devmount.de>

---------

Co-authored-by: Andreas <mail@devmount.de>

* Features/97 Schedules settings page (#128)

* Draft of GA Settings page (#126)

* Basic layout without form

* Finish styling header for general availability

* Finish fake step 1

* Add placeholders for forms, adds buttons

* Add placeholders for date and time inputs

* Add placeholder for step 3

* Change form inputs to correct types

* Additional styling on GA creation view

* Makes booking settings reactive, styles slot length

* Make sections toggle-able

* Set start/end time v-model refs

* Enable date picker for start/end date; add control to remove end date

* Sets default days; shows action buttons

* ➕ implement schedules page frontend

* ➕ implement schedule live preview

* 🔨 fix schedule preview on calendar navigation

* 🔨 fix calendar view tab navigation

* 🔨 fix names and calendar title in preview tooltip

* 🔨 handle unset schedule end date

* ➕ connect schedule page to actual schedule API endpoints

* ➕ add active flag for schedules

* ➕ extend toggle component

* ➕ add disabled state for tab bar

* ➕ implement schedule activation toggle

* 🔨 convert schedule times to utc

* 🔨 fix misaligned starting date for scheduled time slots

* 🔨 make list of weekdays aware to locale start day of week

* 🔨 fix calendar for different start of weeks

* 🔨 reload on locale change to update dayjs instance

* ➕ add option for event popup on right side

* ➕ add month navigation for booking page

* ➕ endpoint for availability booking

* 🔨 fix timezone back calculation on schedule config

* 🔨 fix remote event datetime format

* 🔨 show confirmation modal only on first schedule save

* ➕ implement ICS serving endpoint for schedule availabilities

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>

* Change how the backend and database migrations are structured (Fixes #119)
- BREAKING: Added `appointment` module folder in `src`.
- BREAKING: alembic.ini should now be placed in the backend root folder. You will need to grab a fresh copy as there's been additional changes.

- Added a super simple cli interface handled by main.py
- Adjusted main.py to bootstrap either a fast api server or a cli interface.
- Added a `update-db` command that is installed when pip install this module.
- The `update-db` command will initialize a fresh database or run migrations, resolving most of our database woes.
- New folder structure more closely matches the deployed folder structure for easier deployments.
- Local docker now only mounts the `src` folder
- Commented out some non-existent columns/constraints in a recent migration
- Added missing trailing slash to the frontend for `schedule/`
- Added sentry support to migrations
- Adjusted code-referenced folder locations as required

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>
devmount added a commit that referenced this pull request Oct 4, 2023
* Update to current state (#135)

* Schedule API endpoints (#114)

* ➕ add schedule API endpoints

* Get current backend tests (#122)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* 🔨 migrate data structure to current mockup

* ➕ endpoint for schedule creation

* ➕ add schedule test

* ❌ remove appointment type

* 🔨 improve model types and link verification

* ➕ time slots calculation from schedule config

* ➕ time slots comparison with remote events of assigned calendar

* ➕ compare schedule to all connected calendars

* ➕ check calendar connections first

* ➕ add test for invalid availability link

* ➕ check if actual booking slots exist

* Use localStorage to cache logged-in user (#124)

* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Update frontend/src/views/ProfileView.vue

Co-authored-by: Andreas <mail@devmount.de>

---------

Co-authored-by: Andreas <mail@devmount.de>

* Features/97 Schedules settings page (#128)

* Draft of GA Settings page (#126)

* Basic layout without form

* Finish styling header for general availability

* Finish fake step 1

* Add placeholders for forms, adds buttons

* Add placeholders for date and time inputs

* Add placeholder for step 3

* Change form inputs to correct types

* Additional styling on GA creation view

* Makes booking settings reactive, styles slot length

* Make sections toggle-able

* Set start/end time v-model refs

* Enable date picker for start/end date; add control to remove end date

* Sets default days; shows action buttons

* ➕ implement schedules page frontend

* ➕ implement schedule live preview

* 🔨 fix schedule preview on calendar navigation

* 🔨 fix calendar view tab navigation

* 🔨 fix names and calendar title in preview tooltip

* 🔨 handle unset schedule end date

* ➕ connect schedule page to actual schedule API endpoints

* ➕ add active flag for schedules

* ➕ extend toggle component

* ➕ add disabled state for tab bar

* ➕ implement schedule activation toggle

* 🔨 convert schedule times to utc

* 🔨 fix misaligned starting date for scheduled time slots

* 🔨 make list of weekdays aware to locale start day of week

* 🔨 fix calendar for different start of weeks

* 🔨 reload on locale change to update dayjs instance

* ➕ add option for event popup on right side

* ➕ add month navigation for booking page

* ➕ endpoint for availability booking

* 🔨 fix timezone back calculation on schedule config

* 🔨 fix remote event datetime format

* 🔨 show confirmation modal only on first schedule save

* ➕ implement ICS serving endpoint for schedule availabilities

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>

* Change how the backend and database migrations are structured (Fixes #119)
- BREAKING: Added `appointment` module folder in `src`.
- BREAKING: alembic.ini should now be placed in the backend root folder. You will need to grab a fresh copy as there's been additional changes.

- Added a super simple cli interface handled by main.py
- Adjusted main.py to bootstrap either a fast api server or a cli interface.
- Added a `update-db` command that is installed when pip install this module.
- The `update-db` command will initialize a fresh database or run migrations, resolving most of our database woes.
- New folder structure more closely matches the deployed folder structure for easier deployments.
- Local docker now only mounts the `src` folder
- Commented out some non-existent columns/constraints in a recent migration
- Added missing trailing slash to the frontend for `schedule/`
- Added sentry support to migrations
- Adjusted code-referenced folder locations as required

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>

* ➕ fill in booking modal with logged in users data

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>
devmount added a commit that referenced this pull request Oct 4, 2023
* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Per docs, register Router before Auth0 SDK

* Render based on stored user, not only on public vs private route

* Update frontend/src/App.vue

Co-authored-by: Andreas <mail@devmount.de>

* Add comment about registering router before Auth0 SDK

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

* Features/99 booking experience for logged in users (#136)

* Update to current state (#135)

* Schedule API endpoints (#114)

* ➕ add schedule API endpoints

* Get current backend tests (#122)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* 🔨 migrate data structure to current mockup

* ➕ endpoint for schedule creation

* ➕ add schedule test

* ❌ remove appointment type

* 🔨 improve model types and link verification

* ➕ time slots calculation from schedule config

* ➕ time slots comparison with remote events of assigned calendar

* ➕ compare schedule to all connected calendars

* ➕ check calendar connections first

* ➕ add test for invalid availability link

* ➕ check if actual booking slots exist

* Use localStorage to cache logged-in user (#124)

* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Update frontend/src/views/ProfileView.vue

Co-authored-by: Andreas <mail@devmount.de>

---------

Co-authored-by: Andreas <mail@devmount.de>

* Features/97 Schedules settings page (#128)

* Draft of GA Settings page (#126)

* Basic layout without form

* Finish styling header for general availability

* Finish fake step 1

* Add placeholders for forms, adds buttons

* Add placeholders for date and time inputs

* Add placeholder for step 3

* Change form inputs to correct types

* Additional styling on GA creation view

* Makes booking settings reactive, styles slot length

* Make sections toggle-able

* Set start/end time v-model refs

* Enable date picker for start/end date; add control to remove end date

* Sets default days; shows action buttons

* ➕ implement schedules page frontend

* ➕ implement schedule live preview

* 🔨 fix schedule preview on calendar navigation

* 🔨 fix calendar view tab navigation

* 🔨 fix names and calendar title in preview tooltip

* 🔨 handle unset schedule end date

* ➕ connect schedule page to actual schedule API endpoints

* ➕ add active flag for schedules

* ➕ extend toggle component

* ➕ add disabled state for tab bar

* ➕ implement schedule activation toggle

* 🔨 convert schedule times to utc

* 🔨 fix misaligned starting date for scheduled time slots

* 🔨 make list of weekdays aware to locale start day of week

* 🔨 fix calendar for different start of weeks

* 🔨 reload on locale change to update dayjs instance

* ➕ add option for event popup on right side

* ➕ add month navigation for booking page

* ➕ endpoint for availability booking

* 🔨 fix timezone back calculation on schedule config

* 🔨 fix remote event datetime format

* 🔨 show confirmation modal only on first schedule save

* ➕ implement ICS serving endpoint for schedule availabilities

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>

* Change how the backend and database migrations are structured (Fixes #119)
- BREAKING: Added `appointment` module folder in `src`.
- BREAKING: alembic.ini should now be placed in the backend root folder. You will need to grab a fresh copy as there's been additional changes.

- Added a super simple cli interface handled by main.py
- Adjusted main.py to bootstrap either a fast api server or a cli interface.
- Added a `update-db` command that is installed when pip install this module.
- The `update-db` command will initialize a fresh database or run migrations, resolving most of our database woes.
- New folder structure more closely matches the deployed folder structure for easier deployments.
- Local docker now only mounts the `src` folder
- Commented out some non-existent columns/constraints in a recent migration
- Added missing trailing slash to the frontend for `schedule/`
- Added sentry support to migrations
- Adjusted code-referenced folder locations as required

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>

* ➕ fill in booking modal with logged in users data

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>

* Add day view event popups (#137)

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>
devmount added a commit that referenced this pull request Oct 5, 2023
* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Per docs, register Router before Auth0 SDK

* Render based on stored user, not only on public vs private route

* Update frontend/src/App.vue

Co-authored-by: Andreas <mail@devmount.de>

* Add comment about registering router before Auth0 SDK

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

* Features/99 booking experience for logged in users (#136)

* Update to current state (#135)

* Schedule API endpoints (#114)

* ➕ add schedule API endpoints

* Get current backend tests (#122)

* General documentation (#116)

* ➕ add general documentation

* ➕ add general documentation

* 📜 update component chart

* Backend testing (#117)

* 🔨 updated pytests

* ➕ extend health and authentication tests

* ➕ add authentication for test user

* 📜 document testing in readme

* ➕ add subscriber related tests

* 👕 fix linter issues

* 🔨 prevent connecting calendars manually

* 🔨 check tier limit on connecting calendars

* ➕ add calendar related tests

* 🔨 only allow appointment creations on connected calendars

* 🔨 cascade delete attendees on slot deletion

* ➕ add appointment related tests

* 📜 add hint for smtp server for testing

* ➕ prepare google calendar tests

* ➕ add google test env vars

* 🔨 migrate data structure to current mockup

* ➕ endpoint for schedule creation

* ➕ add schedule test

* ❌ remove appointment type

* 🔨 improve model types and link verification

* ➕ time slots calculation from schedule config

* ➕ time slots comparison with remote events of assigned calendar

* ➕ compare schedule to all connected calendars

* ➕ check calendar connections first

* ➕ add test for invalid availability link

* ➕ check if actual booking slots exist

* Use localStorage to cache logged-in user (#124)

* Use localStorage to cache logged-in user

* Rename import to use existing variable name

* Update frontend/src/views/ProfileView.vue

Co-authored-by: Andreas <mail@devmount.de>

---------

Co-authored-by: Andreas <mail@devmount.de>

* Features/97 Schedules settings page (#128)

* Draft of GA Settings page (#126)

* Basic layout without form

* Finish styling header for general availability

* Finish fake step 1

* Add placeholders for forms, adds buttons

* Add placeholders for date and time inputs

* Add placeholder for step 3

* Change form inputs to correct types

* Additional styling on GA creation view

* Makes booking settings reactive, styles slot length

* Make sections toggle-able

* Set start/end time v-model refs

* Enable date picker for start/end date; add control to remove end date

* Sets default days; shows action buttons

* ➕ implement schedules page frontend

* ➕ implement schedule live preview

* 🔨 fix schedule preview on calendar navigation

* 🔨 fix calendar view tab navigation

* 🔨 fix names and calendar title in preview tooltip

* 🔨 handle unset schedule end date

* ➕ connect schedule page to actual schedule API endpoints

* ➕ add active flag for schedules

* ➕ extend toggle component

* ➕ add disabled state for tab bar

* ➕ implement schedule activation toggle

* 🔨 convert schedule times to utc

* 🔨 fix misaligned starting date for scheduled time slots

* 🔨 make list of weekdays aware to locale start day of week

* 🔨 fix calendar for different start of weeks

* 🔨 reload on locale change to update dayjs instance

* ➕ add option for event popup on right side

* ➕ add month navigation for booking page

* ➕ endpoint for availability booking

* 🔨 fix timezone back calculation on schedule config

* 🔨 fix remote event datetime format

* 🔨 show confirmation modal only on first schedule save

* ➕ implement ICS serving endpoint for schedule availabilities

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>

* Change how the backend and database migrations are structured (Fixes #119)
- BREAKING: Added `appointment` module folder in `src`.
- BREAKING: alembic.ini should now be placed in the backend root folder. You will need to grab a fresh copy as there's been additional changes.

- Added a super simple cli interface handled by main.py
- Adjusted main.py to bootstrap either a fast api server or a cli interface.
- Added a `update-db` command that is installed when pip install this module.
- The `update-db` command will initialize a fresh database or run migrations, resolving most of our database woes.
- New folder structure more closely matches the deployed folder structure for easier deployments.
- Local docker now only mounts the `src` folder
- Commented out some non-existent columns/constraints in a recent migration
- Added missing trailing slash to the frontend for `schedule/`
- Added sentry support to migrations
- Adjusted code-referenced folder locations as required

* Documentation and editorconfig (#134)

* 📜 update readme with latest restructuring

* ➕ provide editorconfig

* ❌ remove unused migration code

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>

* ➕ fill in booking modal with logged in users data

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>

* Add day view event popups (#137)

* Features/92 Pinia state management (#139)

* 📦 upgrade packages, add pinia

* ➕ implement user store with pinia

* 🔨 revamp page container markup

---------

Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Melissa Autumn <melissa@thunderbird.net>
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.

Support user sessions instead of checking login on every page
2 participants