From 6338ff431a6486f6e28d5e8eeec0f5d203269243 Mon Sep 17 00:00:00 2001 From: k2maan Date: Wed, 25 Oct 2023 12:06:50 +0530 Subject: [PATCH] Implemented: user details header on user details page (#3) --- src/components/Image.vue | 69 +++++++++++++++++++++++++++++++++++++++ src/locales/en.json | 3 ++ src/main.ts | 18 ---------- src/router/index.ts | 6 ++++ src/views/UserDetails.vue | 69 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 147 insertions(+), 18 deletions(-) create mode 100644 src/components/Image.vue create mode 100644 src/views/UserDetails.vue diff --git a/src/components/Image.vue b/src/components/Image.vue new file mode 100644 index 0000000..aa2fb4e --- /dev/null +++ b/src/components/Image.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/locales/en.json b/src/locales/en.json index e69de29..a2ae567 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -0,0 +1,3 @@ +{ + "User details": "User details" +} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 655ae6a..f2f07a8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,7 +27,6 @@ import '@hotwax/apps-theme'; import i18n from './i18n' import store from './store' -import { DateTime } from 'luxon'; import logger from './logger'; @@ -42,23 +41,6 @@ const app = createApp(App) .use(i18n) .use(store); -// Filters are removed in Vue 3 and global filter introduced https://v3.vuejs.org/guide/migration/filters.html#global-filters -app.config.globalProperties.$filters = { - formatDate(value: any, inFormat?: string, outFormat?: string) { - // TODO Make default format configurable and from environment variables - if(inFormat){ - return DateTime.fromFormat(value, inFormat).toFormat(outFormat ? outFormat : 'MM-dd-yyyy'); - } - return DateTime.fromISO(value).toFormat(outFormat ? outFormat : 'MM-dd-yyyy'); - }, - formatUtcDate(value: any, inFormat?: any, outFormat?: string) { - // TODO Make default format configurable and from environment variables - const userProfile = store.getters['user/getUserProfile']; - // TODO Fix this setDefault should set the default timezone instead of getting it everytiem and setting the tz - return DateTime.fromISO(value, { zone: 'utc' }).setZone(userProfile.userTimeZone).toFormat(outFormat ? outFormat : 'MM-dd-yyyy') - } -} - router.isReady().then(() => { app.mount('#app'); }); \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index a45d6e7..bad3779 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,7 +1,13 @@ import { createRouter, createWebHistory } from '@ionic/vue-router'; import { RouteRecordRaw } from 'vue-router'; +import UserDetails from '@/views/UserDetails.vue' const routes: Array = [ + { + path: '/user-details/:partyId', + name: 'UserDetails', + component: UserDetails, + }, ] const router = createRouter({ diff --git a/src/views/UserDetails.vue b/src/views/UserDetails.vue new file mode 100644 index 0000000..46f4003 --- /dev/null +++ b/src/views/UserDetails.vue @@ -0,0 +1,69 @@ + + \ No newline at end of file