Merge branch 'feat/contacts-redesign' into feat/compose-new-conversation

This commit is contained in:
Sivin Varghese
2024-11-22 09:04:27 +05:30
committed by GitHub
8 changed files with 52 additions and 18 deletions
@@ -38,14 +38,16 @@ const onClickViewDetails = async () => {
<span class="text-sm font-medium truncate text-n-slate-12">
{{ name }}
</span>
<template v-if="additionalAttributes?.companyName">
<span class="text-sm text-n-slate-11">
{{ t('CONTACTS_LAYOUT.CARD.OF') }}
</span>
<span class="text-sm font-medium truncate text-n-slate-12">
{{ additionalAttributes.companyName }}
</span>
</template>
<span
v-if="additionalAttributes?.companyName"
class="i-lucide-briefcase-business size-4 text-n-slate-11"
/>
<span
v-if="additionalAttributes?.companyName"
class="text-sm truncate text-n-slate-11"
>
{{ additionalAttributes.companyName }}
</span>
</div>
<div class="flex items-center gap-3">
<span v-if="email" class="text-sm text-n-slate-11">{{ email }}</span>
@@ -63,7 +63,7 @@ const updateContact = async updatedData => {
const handleFormUpdate = debounce(
updatedData => updateContact(updatedData),
500,
600,
false
);
@@ -27,7 +27,7 @@ const updateContact = async ({ id, updatedData }) => {
const handleFormUpdate = debounce(
({ id, updatedData }) => updateContact({ id, updatedData }),
500,
600,
false
);
@@ -9,7 +9,6 @@ export const labelMenuItems = [
label: 'delivery',
value: 3,
thumbnail: {
name: 'delivery',
color: '#A2FDD5',
},
isSelected: true,
@@ -19,7 +18,6 @@ export const labelMenuItems = [
label: 'lead',
value: 6,
thumbnail: {
name: 'lead',
color: '#F161C8',
},
isSelected: false,
@@ -29,7 +27,6 @@ export const labelMenuItems = [
label: 'ops-handover',
value: 4,
thumbnail: {
name: 'ops-handover',
color: '#A53326',
},
isSelected: false,
@@ -39,7 +36,6 @@ export const labelMenuItems = [
label: 'billing',
value: 1,
thumbnail: {
name: 'billing',
color: '#28AD21',
},
isSelected: false,
@@ -49,7 +45,6 @@ export const labelMenuItems = [
label: 'premium-customer',
value: 5,
thumbnail: {
name: 'premium-customer',
color: '#6FD4EF',
},
isSelected: false,
@@ -59,7 +54,6 @@ export const labelMenuItems = [
label: 'software',
value: 2,
thumbnail: {
name: 'software',
color: '#8F6EF2',
},
isSelected: false,
@@ -449,7 +449,6 @@
"SHOWING": "Showing {startItem} - {endItem} of {totalItems} contacts"
},
"CARD": {
"OF": "of",
"VIEW_DETAILS": "View details",
"EDIT_DETAILS_FORM": {
"TITLE": "Edit contact details",
@@ -4,6 +4,7 @@ import {
} from 'shared/helpers/CustomErrors';
import types from '../../mutation-types';
import ContactAPI from '../../../api/contacts';
import decamelizeKeys from 'decamelize-keys';
import AccountActionsAPI from '../../../api/accountActions';
import AnalyticsHelper from '../../../helper/AnalyticsHelper';
import { CONTACTS_EVENTS } from '../../../helper/AnalyticsHelper/events';
@@ -90,11 +91,16 @@ export const actions = {
},
update: async ({ commit }, { id, isFormData = false, ...contactParams }) => {
const decamelizedContactParams = decamelizeKeys(contactParams, {
deep: true,
});
commit(types.SET_CONTACT_UI_FLAG, { isUpdating: true });
try {
const response = await ContactAPI.update(
id,
isFormData ? buildContactFormData(contactParams) : contactParams
isFormData
? buildContactFormData(decamelizedContactParams)
: decamelizedContactParams
);
commit(types.EDIT_CONTACT, response.data.payload);
commit(types.SET_CONTACT_UI_FLAG, { isUpdating: false });
+1
View File
@@ -65,6 +65,7 @@
"countries-and-timezones": "^3.6.0",
"date-fns": "2.21.1",
"date-fns-tz": "^1.3.3",
"decamelize-keys": "^2.0.1",
"dompurify": "3.1.6",
"floating-vue": "^5.2.2",
"highlight.js": "^11.10.0",
+32
View File
@@ -118,6 +118,9 @@ importers:
date-fns-tz:
specifier: ^1.3.3
version: 1.3.8(date-fns@2.21.1)
decamelize-keys:
specifier: ^2.0.1
version: 2.0.1
dompurify:
specifier: 3.1.6
version: 3.1.6
@@ -2428,6 +2431,14 @@ packages:
supports-color:
optional: true
decamelize-keys@2.0.1:
resolution: {integrity: sha512-nrNeSCtU2gV3Apcmn/EZ+aR20zKDuNDStV67jPiupokD3sOAFeMzslLMCFdKv1sPqzwoe5ZUhsSW9IAVgKSL/Q==}
engines: {node: '>=14.16'}
decamelize@6.0.0:
resolution: {integrity: sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
decimal.js@10.4.3:
resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
@@ -3479,6 +3490,10 @@ packages:
resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
engines: {node: '>=10'}
map-obj@4.3.0:
resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==}
engines: {node: '>=8'}
map-obj@5.0.0:
resolution: {integrity: sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -4659,6 +4674,10 @@ packages:
resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
engines: {node: '>=10'}
type-fest@3.13.1:
resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==}
engines: {node: '>=14.16'}
type-fest@4.26.1:
resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==}
engines: {node: '>=16'}
@@ -7494,6 +7513,15 @@ snapshots:
dependencies:
ms: 2.1.3
decamelize-keys@2.0.1:
dependencies:
decamelize: 6.0.0
map-obj: 4.3.0
quick-lru: 6.1.2
type-fest: 3.13.1
decamelize@6.0.0: {}
decimal.js@10.4.3: {}
deep-eql@5.0.2: {}
@@ -8806,6 +8834,8 @@ snapshots:
dependencies:
semver: 7.6.3
map-obj@4.3.0: {}
map-obj@5.0.0: {}
markdown-it-anchor@8.6.7(@types/markdown-it@12.2.3)(markdown-it@12.3.2):
@@ -10083,6 +10113,8 @@ snapshots:
type-fest@1.4.0: {}
type-fest@3.13.1: {}
type-fest@4.26.1: {}
typed-array-buffer@1.0.0: