Skip to content

Commit ad2bf79

Browse files
authored
Merge pull request #182 from frappe/develop
chore: Merged develop to main
2 parents 022556e + 69d6491 commit ad2bf79

21 files changed

+111
-36
lines changed

crm/api/activities.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def get_deal_activities(name):
110110
}
111111
activities.append(activity)
112112

113-
for communication in docinfo.communications:
113+
for communication in docinfo.communications + docinfo.automated_messages:
114114
activity = {
115115
"activity_type": "communication",
116+
"communication_type": communication.communication_type,
116117
"creation": communication.creation,
117118
"data": {
118119
"subject": communication.subject,
@@ -222,9 +223,10 @@ def get_lead_activities(name):
222223
}
223224
activities.append(activity)
224225

225-
for communication in docinfo.communications:
226+
for communication in docinfo.communications + docinfo.automated_messages:
226227
activity = {
227228
"activity_type": "communication",
229+
"communication_type": communication.communication_type,
228230
"creation": communication.creation,
229231
"data": {
230232
"subject": communication.subject,

crm/fcrm/doctype/crm_deal/crm_deal.py

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def set_sla(self):
108108
"""
109109
sla = get_sla(self)
110110
if not sla:
111+
self.first_responded_on = None
112+
self.first_response_time = None
111113
return
112114
self.sla = sla.name
113115

crm/fcrm/doctype/crm_lead/crm_lead.py

+2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ def set_sla(self):
234234
"""
235235
sla = get_sla(self)
236236
if not sla:
237+
self.first_responded_on = None
238+
self.first_response_time = None
237239
return
238240
self.sla = sla.name
239241

frontend/src/components/Activities.vue

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<div class="flex items-center justify-between mx-10 mt-8 mb-4 text-lg font-medium">
2+
<div
3+
class="mx-10 mb-4 mt-8 flex items-center justify-between text-lg font-medium"
4+
>
35
<div class="flex h-8 items-center text-xl font-semibold text-gray-800">
46
{{ __(title) }}
57
</div>
@@ -71,8 +73,9 @@
7173
<LoadingIndicator class="h-6 w-6" />
7274
<span>{{ __('Loading...') }}</span>
7375
</div>
74-
<div
76+
<FadedScrollableDiv
7577
v-else-if="title == 'WhatsApp' && whatsappMessages.data?.length"
78+
:maskHeight="30"
7679
class="activities flex-1 overflow-y-auto"
7780
>
7881
<WhatsAppArea
@@ -81,8 +84,12 @@
8184
v-model:reply="replyMessage"
8285
:messages="whatsappMessages.data"
8386
/>
84-
</div>
85-
<div v-else-if="activities?.length" class="activities flex-1 overflow-y-auto">
87+
</FadedScrollableDiv>
88+
<FadedScrollableDiv
89+
v-else-if="activities?.length"
90+
:maskHeight="30"
91+
class="activities flex-1 overflow-y-auto"
92+
>
8693
<div
8794
v-if="title == 'Notes'"
8895
class="activity grid grid-cols-1 gap-4 px-10 pb-5 lg:grid-cols-2 xl:grid-cols-3"
@@ -386,6 +393,12 @@
386393
{{ __(timeAgo(activity.creation)) }}
387394
</div>
388395
</Tooltip>
396+
<Badge
397+
v-if="activity.communication_type == 'Automated Message'"
398+
:label="__('Notification')"
399+
variant="subtle"
400+
theme="green"
401+
/>
389402
</div>
390403
<div class="flex gap-0.5">
391404
<Tooltip :text="__('Reply')">
@@ -433,7 +446,8 @@
433446
</span>
434447
<span v-if="activity.data.bcc">{{ activity.data.bcc }}</span>
435448
</div>
436-
<div
449+
<FadedScrollableDiv
450+
:maskHeight="30"
437451
class="email-content prose-f max-h-[500px] overflow-y-auto"
438452
v-html="activity.data.content"
439453
/>
@@ -720,7 +734,7 @@
720734
</div>
721735
</div>
722736
</div>
723-
</div>
737+
</FadedScrollableDiv>
724738
<div
725739
v-else
726740
class="flex flex-1 flex-col items-center justify-center gap-3 text-xl font-medium text-gray-500"
@@ -812,6 +826,7 @@ import OutboundCallIcon from '@/components/Icons/OutboundCallIcon.vue'
812826
import ReplyIcon from '@/components/Icons/ReplyIcon.vue'
813827
import ReplyAllIcon from '@/components/Icons/ReplyAllIcon.vue'
814828
import AttachmentItem from '@/components/AttachmentItem.vue'
829+
import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
815830
import CommunicationArea from '@/components/CommunicationArea.vue'
816831
import NoteModal from '@/components/Modals/NoteModal.vue'
817832
import TaskModal from '@/components/Modals/TaskModal.vue'
@@ -834,6 +849,7 @@ import {
834849
Dropdown,
835850
TextEditor,
836851
Avatar,
852+
Badge,
837853
createResource,
838854
call,
839855
} from 'frappe-ui'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div ref="scrollableDiv" class="scrr" :style="`maskImage: ${maskStyle}`">
3+
<slot></slot>
4+
</div>
5+
</template>
6+
<script setup>
7+
import { ref, onMounted } from 'vue'
8+
9+
const props = defineProps({
10+
maskHeight: {
11+
type: Number,
12+
default: 20,
13+
},
14+
})
15+
16+
const scrollableDiv = ref(null)
17+
const maskStyle = ref('none')
18+
19+
function setMaskStyle() {
20+
// show mask only if div is scrollable
21+
if (scrollableDiv.value.scrollHeight > scrollableDiv.value.clientHeight) {
22+
maskStyle.value = `linear-gradient(to bottom, black calc(100% - ${props.maskHeight}px), transparent 100%);`
23+
} else {
24+
maskStyle.value = 'none'
25+
}
26+
}
27+
28+
onMounted(() => setMaskStyle())
29+
</script>

frontend/src/components/Modals/CallLogModal.vue

+20-8
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,21 @@
5454
></audio>
5555
</div>
5656
<div
57-
class="max-h-30 min-h-16 w-full cursor-pointer overflow-hidden rounded border px-2 py-1.5 text-base text-gray-700"
57+
class="w-full cursor-pointer rounded border px-2 pt-1.5 text-base text-gray-700"
5858
v-else-if="field.name == 'note'"
5959
@click="() => (showNoteModal = true)"
6060
>
61-
<div
62-
v-if="field.value?.title"
63-
:class="[field.value?.content ? 'mb-1 font-bold' : '']"
64-
v-html="field.value?.title"
65-
/>
66-
<div v-if="field.value?.content" v-html="field.value?.content" />
61+
<FadedScrollableDiv class="max-h-24 min-h-16 overflow-y-auto">
62+
<div
63+
v-if="field.value?.title"
64+
:class="[field.value?.content ? 'mb-1 font-bold' : '']"
65+
v-html="field.value?.title"
66+
/>
67+
<div
68+
v-if="field.value?.content"
69+
v-html="field.value?.content"
70+
/>
71+
</FadedScrollableDiv>
6772
</div>
6873
<div v-else :class="field.color ? `text-${field.color}-600` : ''">
6974
{{ field.value }}
@@ -103,7 +108,14 @@ import CalendarIcon from '@/components/Icons/CalendarIcon.vue'
103108
import NoteIcon from '@/components/Icons/NoteIcon.vue'
104109
import CheckCircleIcon from '@/components/Icons/CheckCircleIcon.vue'
105110
import NoteModal from '@/components/Modals/NoteModal.vue'
106-
import { FeatherIcon, Avatar, Tooltip, createDocumentResource, call } from 'frappe-ui'
111+
import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
112+
import {
113+
FeatherIcon,
114+
Avatar,
115+
Tooltip,
116+
createDocumentResource,
117+
call,
118+
} from 'frappe-ui'
107119
import { ref, computed, h, watch } from 'vue'
108120
import { useRouter } from 'vue-router'
109121

frontend/src/components/Notifications.vue

+2-5
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@
5252
>
5353
<div class="mt-1 flex items-center gap-2.5">
5454
<div
55-
class="h-[5px] w-[5px] rounded-full"
55+
class="size-[5px] rounded-full"
5656
:class="[n.read ? 'bg-transparent' : 'bg-gray-900']"
5757
/>
58-
<WhatsAppIcon
59-
v-if="n.type == 'WhatsApp'"
60-
class="size-7 rounded-full"
61-
/>
58+
<WhatsAppIcon v-if="n.type == 'WhatsApp'" class="size-7" />
6259
<UserAvatar v-else :user="n.from_user.name" size="lg" />
6360
</div>
6461
<div>

frontend/src/components/Resizer.vue

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function startResize() {
3838
document.addEventListener('mouseup', () => {
3939
document.body.classList.remove('select-none')
4040
document.body.classList.remove('cursor-col-resize')
41+
document.querySelectorAll('.select-text1').forEach((el) => {
42+
el.classList.remove('select-text1')
43+
el.classList.add('select-text')
44+
})
4145
localStorage.setItem('sidebarWidth', sidebarWidth.value)
4246
sidebarResizing.value = false
4347
document.removeEventListener('mousemove', resize)
@@ -47,6 +51,10 @@ function resize(e) {
4751
sidebarResizing.value = true
4852
document.body.classList.add('select-none')
4953
document.body.classList.add('cursor-col-resize')
54+
document.querySelectorAll('.select-text').forEach((el) => {
55+
el.classList.remove('select-text')
56+
el.classList.add('select-text1')
57+
})
5058
sidebarWidth.value =
5159
props.side == 'left' ? e.clientX : window.innerWidth - e.clientX
5260

frontend/src/components/SectionFields.vue

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<div class="flex max-h-[300px] flex-col gap-1.5 overflow-y-auto">
2+
<FadedScrollableDiv
3+
class="flex max-h-[300px] flex-col gap-1.5 overflow-y-auto"
4+
>
35
<div
46
v-for="field in _fields"
57
:key="field.label"
@@ -105,10 +107,11 @@
105107
@click="field.link(data[field.name])"
106108
/>
107109
</div>
108-
</div>
110+
</FadedScrollableDiv>
109111
</template>
110112

111113
<script setup>
114+
import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
112115
import ArrowUpRightIcon from '@/components/Icons/ArrowUpRightIcon.vue'
113116
import Link from '@/components/Controls/Link.vue'
114117
import UserAvatar from '@/components/UserAvatar.vue'
@@ -168,6 +171,10 @@ function evaluate(code, context = {}) {
168171
</script>
169172
170173
<style scoped>
174+
.form-control {
175+
margin: 2px;
176+
}
177+
171178
:deep(.form-control input:not([type='checkbox'])),
172179
:deep(.form-control select),
173180
:deep(.form-control textarea),

frontend/src/components/WhatsAppArea.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</div>
4444
</div>
4545
</div>
46-
<div class="inline-flex gap-2">
46+
<div class="flex gap-2 justify-between">
4747
<div
4848
class="absolute -right-0.5 -top-0.5 flex cursor-pointer gap-1 rounded-full bg-white pb-2 pl-2 pr-1.5 pt-1.5 opacity-0 group-hover/message:opacity-100"
4949
:style="{

frontend/src/pages/CallLogs.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
4646
>
4747
<PhoneIcon class="h-10 w-10" />
48-
<span>{{ __('No Logs Found') }}</span>
48+
<span>{{ __('No {0} Found', [__('Logs')]) }}</span>
4949
</div>
5050
</div>
5151
<CallLogModal

frontend/src/pages/Contacts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
5252
>
5353
<ContactsIcon class="h-10 w-10" />
54-
<span>{{ __('No Contacts Found') }}</span>
54+
<span>{{ __('No {0} Found', [__('Contacts')]) }}</span>
5555
<Button :label="__('Create')" @click="showContactModal = true">
5656
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5757
</Button>

frontend/src/pages/Deal.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</div>
6565
</Tooltip>
6666
<div class="flex flex-col gap-2.5 truncate">
67-
<Tooltip :text="organization?.name">
67+
<Tooltip :text="organization?.name || __('Set an organization')">
6868
<div class="truncate text-2xl font-medium">
6969
{{ organization?.name || __('Untitled') }}
7070
</div>

frontend/src/pages/Deals.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
4949
>
5050
<DealsIcon class="h-10 w-10" />
51-
<span>{{ __('No Deals Found') }}</span>
51+
<span>{{ __('No {0} Found', [__('Deals')]) }}</span>
5252
<Button :label="__('Create')" @click="showDealModal = true">
5353
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5454
</Button>

frontend/src/pages/EmailTemplates.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
5353
>
5454
<EmailIcon class="h-10 w-10" />
55-
<span>{{ __('No Email Templates Found') }}</span>
55+
<span>{{ __('No {0} Found', [__('Email Templates')]) }}</span>
5656
<Button :label="__('Create')" @click="showEmailTemplateModal = true">
5757
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5858
</Button>

frontend/src/pages/Lead.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
class="!absolute bottom-0 left-0 right-0"
9696
>
9797
<div
98-
class="z-1 absolute bottom-0 left-0 right-0 flex h-9 cursor-pointer items-center justify-center rounded-b-full bg-black bg-opacity-40 pt-3 opacity-0 duration-300 ease-in-out group-hover:opacity-100"
98+
class="z-1 absolute bottom-0.5 left-0 right-0.5 flex h-9 cursor-pointer items-center justify-center rounded-b-full bg-black bg-opacity-40 pt-3 opacity-0 duration-300 ease-in-out group-hover:opacity-100"
9999
style="
100100
-webkit-clip-path: inset(12px 0 0 0);
101101
clip-path: inset(12px 0 0 0);
@@ -106,7 +106,7 @@
106106
</component>
107107
</div>
108108
<div class="flex flex-col gap-2.5 truncate">
109-
<Tooltip :text="lead.data.lead_name">
109+
<Tooltip :text="lead.data.lead_name || __('Set first name')">
110110
<div class="truncate text-2xl font-medium">
111111
{{ lead.data.lead_name || __('Untitled') }}
112112
</div>

frontend/src/pages/Leads.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
5050
>
5151
<LeadsIcon class="h-10 w-10" />
52-
<span>{{ __('No Leads Found') }}</span>
52+
<span>{{ __('No {0} Found', [__('Leads')]) }}</span>
5353
<Button :label="__('Create')" @click="showLeadModal = true">
5454
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5555
</Button>

frontend/src/pages/Notes.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
8989
>
9090
<NoteIcon class="h-10 w-10" />
91-
<span>{{ __('No Notes Found') }}</span>
91+
<span>{{ __('No {0} Found', [__('Notes')]) }}</span>
9292
<Button :label="__('Create')" @click="createNote">
9393
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
9494
</Button>

frontend/src/pages/Organizations.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
5252
>
5353
<OrganizationsIcon class="h-10 w-10" />
54-
<span>{{ __('No Organizations Found') }}</span>
54+
<span>{{ __('No {0} Found', [__('Organizations')]) }}</span>
5555
<Button :label="__('Create')" @click="showOrganizationModal = true">
5656
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5757
</Button>

frontend/src/pages/Tasks.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
4646
>
4747
<EmailIcon class="h-10 w-10" />
48-
<span>{{ __('No Tasks Found') }}</span>
48+
<span>{{ __('No {0} Found', [__('Tasks')]) }}</span>
4949
<Button :label="__('Create')" @click="showTaskModal = true">
5050
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
5151
</Button>

frontend/src/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function errorMessage(title, message) {
150150

151151
export function copyToClipboard(text) {
152152
if (navigator.clipboard && window.isSecureContext) {
153-
navigator.clipboard.writeText(string).then(show_success_alert)
153+
navigator.clipboard.writeText(text).then(show_success_alert)
154154
} else {
155155
let input = document.createElement('textarea')
156156
document.body.appendChild(input)

0 commit comments

Comments
 (0)