diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue
index db211978..35ae4814 100644
--- a/frontend/src/components/Activities.vue
+++ b/frontend/src/components/Activities.vue
@@ -91,9 +91,9 @@
- {{ timeAgo(call.modified) }}
+ {{ timeAgo(call.creation) }}
@@ -208,6 +208,89 @@
+
+
+
+ {{ activity.type == 'Incoming' ? 'Inbound' : 'Outbound' }} call
+
+
+
+ {{ timeAgo(activity.creation) }}
+
+
+
+
+
+
+
Duration
+
+ {{ activity.duration }}
+
+
+
+
+
+ {{ activity.show_recording ? 'Hide recording' : 'Listen to call' }}
+
+
+
+
+
+
+
+
+
+ {{ activity.caller.label }}
+
+
+ {{ activity.from }}
+
+
+
+
+
+
+ {{ activity.receiver.label }}
+
+
+ {{ activity.to }}
+
+
+
+
+
- {{ timeAgo(callLog.data.modified) }}
+ {{ timeAgo(callLog.data.creation) }}
diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue
index a7744412..ab22818a 100644
--- a/frontend/src/pages/Deal.vue
+++ b/frontend/src/pages/Deal.vue
@@ -380,7 +380,7 @@ const tabs = computed(() => {
{
label: 'Activity',
icon: ActivityIcon,
- content: deal.data.activities,
+ content: all_activities(),
activityTitle: 'Activity log',
},
{
@@ -411,6 +411,17 @@ const tabs = computed(() => {
]
})
+function all_activities() {
+ if (!lead.data) return []
+ if (!calls.data) return lead.data.activities
+ console.log(lead.data.activities[0].creation)
+ console.log(calls.data[0].creation)
+ return [
+ ...lead.data.activities,
+ ...calls.data,
+ ].sort((a, b) => new Date(b.creation) - new Date(a.creation))
+}
+
const tabRef = ref([])
const indicator = ref(null)
@@ -581,15 +592,16 @@ const calls = createListResource({
'status',
'type',
'recording_url',
- 'modified',
+ 'creation',
'note',
],
filters: { lead: props.dealId },
- orderBy: 'modified desc',
+ orderBy: 'creation desc',
pageLength: 999,
auto: true,
transform: (docs) => {
docs.forEach((doc) => {
+ doc.activity_type = doc.type === 'Incoming' ? 'incoming_call' : 'outgoing_call'
doc.duration = secondsToDuration(doc.duration)
if (doc.type === 'Incoming') {
doc.caller = {
diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue
index f3ac3d65..d17b2764 100644
--- a/frontend/src/pages/Lead.vue
+++ b/frontend/src/pages/Lead.vue
@@ -372,7 +372,7 @@ const tabs = computed(() => {
{
label: 'Activity',
icon: ActivityIcon,
- content: lead.data.activities,
+ content: all_activities(),
activityTitle: 'Activity log',
},
{
@@ -403,6 +403,17 @@ const tabs = computed(() => {
]
})
+function all_activities() {
+ if (!lead.data) return []
+ if (!calls.data) return lead.data.activities
+ console.log(lead.data.activities[0].creation)
+ console.log(calls.data[0].creation)
+ return [
+ ...lead.data.activities,
+ ...calls.data,
+ ].sort((a, b) => new Date(b.creation) - new Date(a.creation))
+}
+
const tabRef = ref([])
const indicator = ref(null)
@@ -614,15 +625,16 @@ const calls = createListResource({
'status',
'type',
'recording_url',
- 'modified',
+ 'creation',
'note',
],
filters: { lead: props.leadId },
- orderBy: 'modified desc',
+ orderBy: 'creation desc',
pageLength: 999,
auto: true,
transform: (docs) => {
docs.forEach((doc) => {
+ doc.activity_type = doc.type === 'Incoming' ? 'incoming_call' : 'outgoing_call'
doc.duration = secondsToDuration(doc.duration)
if (doc.type === 'Incoming') {
doc.caller = {