onFieldSelect(evt, datum)" />
|
-
+
{{ fieldData.value }}
-
+
{{ fieldData.value }}
-
+
-
+
Yes
No
-
+
{{ fieldData.value }}
-
+
{{ fieldData.value }}
{{ fieldData.value }}
@@ -98,41 +98,31 @@
-
diff --git a/frontend/src/models.ts b/frontend/src/models.ts
index 37c211ec..652c8239 100644
--- a/frontend/src/models.ts
+++ b/frontend/src/models.ts
@@ -1,6 +1,13 @@
import { Dayjs } from 'dayjs';
import { UseFetchReturn } from '@vueuse/core';
-import { InviteStatus, WaitingListAction, EventLocationType, CalendarProviders } from './definitions';
+import {
+ InviteStatus,
+ WaitingListAction,
+ EventLocationType,
+ CalendarProviders,
+ TableDataButtonType,
+ TableDataType,
+} from './definitions';
export type Attendee = {
id?: number;
@@ -252,12 +259,16 @@ export type Token = {
access_token: string;
token_type: string;
};
+export type AuthUrl = {
+ url: string;
+};
// Types and aliases used for our custom createFetch API calls and return types
+export type AuthUrlResponse = UseFetchReturn;
export type AppointmentListResponse = UseFetchReturn;
export type AppointmentResponse = UseFetchReturn;
export type AvailabilitySlotResponse = UseFetchReturn;
-export type BooleanResponse = UseFetchReturn;
+export type BooleanResponse = UseFetchReturn;
export type BlobResponse = UseFetchReturn;
export type CalendarResponse = UseFetchReturn;
export type CalendarListResponse = UseFetchReturn;
@@ -277,6 +288,31 @@ export type TokenResponse = UseFetchReturn;
export type WaitingListResponse = UseFetchReturn;
export type WaitingListActionResponse = UseFetchReturn;
+// Table types
+export type TableDataField = {
+ type: TableDataType;
+ value: string|number|boolean;
+ link?: string;
+ buttonType?: TableDataButtonType;
+ disabled?: boolean;
+};
+export type TableDataRow = {
+ [key:string]: TableDataField
+};
+export type TableDataColumn = {
+ name: string;
+ key: string;
+};
+export type TableFilterOption = {
+ name: string;
+ key: string;
+};
+export type TableFilter = {
+ name: string;
+ options: TableFilterOption[];
+ fn: (value: string, list: TableDataRow[]) => TableDataRow[];
+};
+
// Utility types
export type Time = {
start: T;
@@ -299,3 +335,7 @@ export type HTMLElementEvent = Event & {
target: HTMLElement;
currentTarget: HTMLElement;
};
+export type HTMLInputElementEvent = Event & {
+ target: HTMLInputElement;
+ currentTarget: HTMLInputElement;
+};
diff --git a/frontend/src/stores/user-store.ts b/frontend/src/stores/user-store.ts
index b5460ed8..448d2911 100644
--- a/frontend/src/stores/user-store.ts
+++ b/frontend/src/stores/user-store.ts
@@ -84,7 +84,7 @@ export const useUserStore = defineStore('user', () => {
const { data: userData, error } = await fetch('me').put(inputData).json();
if (!error.value) {
// update user in store
- await updateProfile(userData.value);
+ updateProfile(userData.value);
await updateSignedUrl(fetch);
return { error: false };
diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue
index 0a2ea184..a88583cf 100644
--- a/frontend/src/views/LoginView.vue
+++ b/frontend/src/views/LoginView.vue
@@ -1,126 +1,30 @@
-
-
-
-
-
- {{ t('app.title') }}
-
- {{ loginError }}
-
-
-
- {{ t('waitingList.signUpHeading') }}
- {{ t('waitingList.signUpInfo') }}
- {{ t('waitingList.signUpCheckYourEmail') }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ t('app.title') }}
+
+ {{ loginError }}
+
+
+
+ {{ t('waitingList.signUpHeading') }}
+ {{ t('waitingList.signUpInfo') }}
+ {{ t('waitingList.signUpCheckYourEmail') }}
+
+
+
+
+
+
+
diff --git a/frontend/src/views/PostLoginView.vue b/frontend/src/views/PostLoginView.vue
index ed1b7e19..ad166236 100644
--- a/frontend/src/views/PostLoginView.vue
+++ b/frontend/src/views/PostLoginView.vue
@@ -1,14 +1,9 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/frontend/src/views/admin/InviteCodePanelView.vue b/frontend/src/views/admin/InviteCodePanelView.vue
index d042eb5b..eeb8fa0f 100644
--- a/frontend/src/views/admin/InviteCodePanelView.vue
+++ b/frontend/src/views/admin/InviteCodePanelView.vue
@@ -3,10 +3,10 @@ import {
computed, inject, onMounted, ref,
} from 'vue';
import { useI18n } from 'vue-i18n';
-import { AlertSchemes, tableDataButtonType, tableDataType } from '@/definitions';
+import { AlertSchemes, TableDataButtonType, TableDataType } from '@/definitions';
import { useRouter } from 'vue-router';
import { IconSend } from '@tabler/icons-vue';
-import { Invite, InviteListResponse, BooleanResponse, Exception } from "@/models";
+import { Invite, InviteListResponse, BooleanResponse, Exception, TableDataRow, TableDataColumn, TableFilter } from "@/models";
import { InviteStatus } from "@/definitions";
import { dayjsKey, callKey } from "@/keys";
import DataTable from '@/components/DataTable.vue';
@@ -30,32 +30,32 @@ const pageNotification = ref('');
const filteredInvites = computed(() => invites.value.map((invite) => ({
code: {
- type: tableDataType.code,
+ type: TableDataType.Code,
value: invite.code,
},
status: {
- type: tableDataType.text,
+ type: TableDataType.Text,
value: invite.status === InviteStatus.Active ? 'Available' : 'Revoked',
},
subscriber_id: {
- type: tableDataType.text,
+ type: TableDataType.Text,
value: invite.subscriber_id ?? 'Unused',
},
timeCreated: {
- type: tableDataType.text,
+ type: TableDataType.Text,
value: dj(invite.time_created).format('ll LTS'),
},
timeUpdated: {
- type: tableDataType.text,
+ type: TableDataType.Text,
value: dj(invite.time_updated).format('ll LTS'),
},
revoke: {
- type: tableDataType.button,
- buttonType: tableDataButtonType.secondary,
+ type: TableDataType.Button,
+ buttonType: TableDataButtonType.Secondary,
value: 'Revoke',
disabled: invite.subscriber_id || invite.status === InviteStatus.Revoked,
},
-})));
+} as TableDataRow)));
const columns = [
{
key: 'code',
@@ -81,7 +81,7 @@ const columns = [
key: 'revoke',
name: '',
},
-];
+] as TableDataColumn[];
const filters = [
{
name: 'Invite Status',
@@ -105,12 +105,8 @@ const filters = [
],
/**
* Callback function, filter the list by selectedKey and return it back to the table
- * TODO: Add types when DataTable.vue is typed
- * @param selectedKey
- * @param mutableDataList
- * @returns {*}
*/
- fn: (selectedKey, mutableDataList) => {
+ fn: (selectedKey: string, mutableDataList: TableDataRow[]) => {
switch (selectedKey) {
case 'all':
return null;
@@ -138,7 +134,7 @@ const filters = [
return null;
},
},
-];
+] as TableFilter[];
/**
* Retrieve list of all existing invites
diff --git a/frontend/src/views/admin/SubscriberPanelView.vue b/frontend/src/views/admin/SubscriberPanelView.vue
index 76acf2e5..6abd03e0 100644
--- a/frontend/src/views/admin/SubscriberPanelView.vue
+++ b/frontend/src/views/admin/SubscriberPanelView.vue
@@ -1,5 +1,5 @@
|