-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add AppointmentStore and CalendarStore. - CalendarStore will only pull if the `isInit` value is false. - CalendarStore cache is busted on user action. - AppointmentStore will always pull if requested (Due to some impl concerns.) * Hook up external connections store, and move the isLoaded check to inside the stores. * We don't need to retrieve appointments or calendars on the account settings page. * Provide calendar title and colour for `/me/appointments` * Remove the initial calendar/appointment load, and the calendar merge with appointments. We don't need to merge the calendar data anymore since we do on the backend, and we now call the db refresh function on all pages that may require appointments. This prevents doubling requests if you start on the Calendars page for example.
- Loading branch information
1 parent
f7f7931
commit 5b905f9
Showing
16 changed files
with
263 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
<calendar-management | ||
:title="t('heading.calendarsUnconnected')" | ||
:type="calendarManagementType.connect" | ||
:calendars="calendars" | ||
:calendars="calendarStore.unconnectedCalendars" | ||
:loading="loading" | ||
@sync="syncCalendars" | ||
@modify="connectCalendar" | ||
|
@@ -18,7 +18,7 @@ | |
<calendar-management | ||
:title="t('heading.calendarsConnected')" | ||
:type="calendarManagementType.edit" | ||
:calendars="calendars" | ||
:calendars="calendarStore.connectedCalendars" | ||
:loading="loading" | ||
@remove="deleteCalendar" | ||
@modify="editCalendar" | ||
|
@@ -199,7 +199,9 @@ | |
<script setup> | ||
import { calendarManagementType } from '@/definitions'; | ||
import { IconArrowRight } from '@tabler/icons-vue'; | ||
import { ref, reactive, inject, onMounted, computed } from 'vue'; | ||
import { | ||
ref, reactive, inject, onMounted, computed, | ||
} from 'vue'; | ||
import { useI18n } from 'vue-i18n'; | ||
import { useRoute, useRouter } from 'vue-router'; | ||
import AlertBox from '@/elements/AlertBox'; | ||
|
@@ -208,12 +210,14 @@ import GoogleSignInBtn from '@/assets/img/google/1x/btn_google_signin_light_norm | |
import GoogleSignInBtn2x from '@/assets/img/google/2x/[email protected]'; | ||
import PrimaryButton from '@/elements/PrimaryButton'; | ||
import SecondaryButton from '@/elements/SecondaryButton'; | ||
import ConfirmationModal from "@/components/ConfirmationModal.vue"; | ||
import ConfirmationModal from '@/components/ConfirmationModal.vue'; | ||
import { useCalendarStore } from '@/stores/calendar-store'; | ||
// component constants | ||
const { t } = useI18n({ useScope: 'global' }); | ||
const call = inject('call'); | ||
const refresh = inject('refresh'); | ||
const calendarStore = useCalendarStore(); | ||
const calendarConnectError = ref(''); | ||
|
@@ -223,11 +227,6 @@ const deleteCalendarModalTarget = ref(null); | |
// Temp until we get a store solution rolling | ||
const loading = ref(false); | ||
// view properties | ||
defineProps({ | ||
calendars: Array, // list of calendars from db | ||
}); | ||
// handle calendar user input to add or edit calendar connections | ||
const inputModes = { | ||
hidden: 0, | ||
|
@@ -264,7 +263,9 @@ const closeModals = async () => { | |
}; | ||
const refreshData = async () => { | ||
await refresh({ onlyConnectedCalendars: false }); | ||
// Invalidate our calendar store | ||
await calendarStore.reset(); | ||
await refresh(); | ||
loading.value = false; | ||
}; | ||
|
@@ -392,6 +393,6 @@ onMounted(async () => { | |
await router.replace(route.path); | ||
} | ||
await refreshData(); | ||
await refresh(); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.