From 8ff9ea380e6a405cd499ded7c05e8428858298cf Mon Sep 17 00:00:00 2001 From: Rajeshbala2020 Date: Mon, 11 Nov 2024 10:54:58 +0530 Subject: [PATCH 01/13] multiple avatar component array reverse correction --- frontend/src/components/MultipleAvatar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/MultipleAvatar.vue b/frontend/src/components/MultipleAvatar.vue index d25670e3b..92604bd21 100644 --- a/frontend/src/components/MultipleAvatar.vue +++ b/frontend/src/components/MultipleAvatar.vue @@ -48,5 +48,5 @@ const props = defineProps({ default: 'md', }, }) -const reverseAvatars = computed(() => props.avatars.reverse()) +const reverseAvatars = computed(() => [...props.avatars].reverse()) From 3dc45c3c8cd3f44a971c7d408478e43f535a500c Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 23 Dec 2024 15:30:45 +0530 Subject: [PATCH 02/13] fix: remove the scroll behaviour in listview --- frontend/src/router.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/frontend/src/router.js b/frontend/src/router.js index a64bdd8ba..7ce0f1105 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -18,7 +18,6 @@ const routes = [ path: '/leads/view/:viewType?', name: 'Leads', component: () => import('@/pages/Leads.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { path: '/leads/:leadId', @@ -31,7 +30,6 @@ const routes = [ path: '/deals/view/:viewType?', name: 'Deals', component: () => import('@/pages/Deals.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { path: '/deals/:dealId', @@ -56,7 +54,6 @@ const routes = [ path: '/contacts/view/:viewType?', name: 'Contacts', component: () => import('@/pages/Contacts.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { path: '/contacts/:contactId', @@ -69,7 +66,6 @@ const routes = [ path: '/organizations/view/:viewType?', name: 'Organizations', component: () => import('@/pages/Organizations.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { path: '/organizations/:organizationId', @@ -82,14 +78,12 @@ const routes = [ path: '/call-logs/view/:viewType?', name: 'Call Logs', component: () => import('@/pages/CallLogs.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { alias: '/email-templates', path: '/email-templates/view/:viewType?', name: 'Email Templates', component: () => import('@/pages/EmailTemplates.vue'), - meta: { scrollPos: { top: 0, left: 0 } }, }, { path: '/email-templates/:emailTemplateId', @@ -108,29 +102,9 @@ const handleMobileView = (componentName) => { return window.innerWidth < 768 ? `Mobile${componentName}` : componentName } -const scrollBehavior = (to, from, savedPosition) => { - if (to.name === from.name) { - to.meta?.scrollPos && (to.meta.scrollPos.top = 0) - return { left: 0, top: 0 } - } - const scrollpos = to.meta?.scrollPos || { left: 0, top: 0 } - - if (scrollpos.top > 0) { - setTimeout(() => { - let el = document.querySelector('#list-rows') - el.scrollTo({ - top: scrollpos.top, - left: scrollpos.left, - behavior: 'smooth', - }) - }, 300) - } -} - let router = createRouter({ history: createWebHistory('/crm'), routes, - scrollBehavior, }) router.beforeEach(async (to, from, next) => { @@ -138,10 +112,6 @@ router.beforeEach(async (to, from, next) => { isLoggedIn && (await userResource.promise) - if (from.meta?.scrollPos) { - from.meta.scrollPos.top = document.querySelector('#list-rows')?.scrollTop - } - if (to.name === 'Home' && isLoggedIn) { next({ name: 'Leads' }) } else if (!isLoggedIn) { From d1efa543db67574e0f75a8e1e7ea5a80fc3ea162 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 23 Dec 2024 15:31:35 +0530 Subject: [PATCH 03/13] fix: maintain scroll position in ListRows component --- .../components/ListViews/CallLogsListView.vue | 181 ++++++++--------- .../components/ListViews/ContactsListView.vue | 176 ++++++++-------- .../components/ListViews/DealsListView.vue | 6 +- .../ListViews/EmailTemplatesListView.vue | 155 +++++++------- .../components/ListViews/LeadsListView.vue | 6 +- .../src/components/ListViews/ListRows.vue | 43 +++- .../ListViews/OrganizationsListView.vue | 159 +++++++-------- .../components/ListViews/TasksListView.vue | 192 +++++++++--------- 8 files changed, 472 insertions(+), 446 deletions(-) diff --git a/frontend/src/components/ListViews/CallLogsListView.vue b/frontend/src/components/ListViews/CallLogsListView.vue index 4f8071c08..4331237b3 100644 --- a/frontend/src/components/ListViews/CallLogsListView.vue +++ b/frontend/src/components/ListViews/CallLogsListView.vue @@ -11,7 +11,10 @@ row-key="name" v-bind="$attrs" > - + - - - - - +