fix: added mapping to call log status to display on Ui

This commit is contained in:
Shariq Ansari 2024-01-13 13:51:29 +05:30
parent 4b9a31c2a3
commit d47f5bae13
2 changed files with 36 additions and 4 deletions

View File

@ -35,9 +35,9 @@
<div>
<Badge
:variant="'subtle'"
:theme="callLog.data.status === 'Completed' ? 'green' : 'gray'"
:theme="statusColorMap[callLog.data.status]"
size="md"
:label="callLog.data.status"
:label="statusLabelMap[callLog.data.status]"
/>
</div>
</div>
@ -245,6 +245,22 @@ const breadcrumbs = computed(() => [
route: { name: 'Call Log', params: { callLogId: props.callLogId } },
},
])
const statusLabelMap = {
Completed: 'Completed',
Busy: 'Declined',
Ringing: 'Ringing',
'No Answer': 'Missed Call',
'In Progress': 'In Progress',
}
const statusColorMap = {
Completed: 'green',
Busy: 'orange',
Ringing: 'gray',
'No Answer': 'red',
'In Progress': 'blue',
}
</script>
<style scoped>

View File

@ -103,8 +103,8 @@ const rows = computed(() => {
}
} else if (row === 'status') {
_rows[row] = {
label: callLog.status,
color: callLog.status === 'Completed' ? 'green' : 'gray',
label: statusLabelMap[callLog.status],
color: statusColorMap[callLog.status],
}
} else if (['modified', 'creation'].includes(row)) {
_rows[row] = {
@ -116,4 +116,20 @@ const rows = computed(() => {
return _rows
})
})
const statusLabelMap = {
Completed: 'Completed',
Busy: 'Declined',
Ringing: 'Ringing',
'No Answer': 'Missed Call',
'In Progress': 'In Progress',
}
const statusColorMap = {
Completed: 'green',
Busy: 'orange',
Ringing: 'gray',
'No Answer': 'red',
'In Progress': 'blue',
}
</script>