From bf996a3cbd7f1b83cbd0706da7551d6ed95cf903 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:54:49 +0530 Subject: [PATCH] fix: created SLA Section component & added in lead/deal page --- frontend/src/components/SLASection.vue | 114 +++++++++++++++++++++++++ frontend/src/pages/Deal.vue | 80 ++--------------- frontend/src/pages/Lead.vue | 66 ++------------ 3 files changed, 128 insertions(+), 132 deletions(-) create mode 100644 frontend/src/components/SLASection.vue diff --git a/frontend/src/components/SLASection.vue b/frontend/src/components/SLASection.vue new file mode 100644 index 00000000..9dd97133 --- /dev/null +++ b/frontend/src/components/SLASection.vue @@ -0,0 +1,114 @@ + + + + diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index f30ea416..c4ead911 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -99,72 +99,11 @@ -
-
-
Response By
- - {{ timeAgo(deal.data.response_by) }} - -
-
-
Fulfilled In
- - {{ formatTime(deal.data.first_response_time) }} - -
-
-
Fulfilled In
- - {{ formatTime(deal.data.first_response_time) }} - -
-
-
Status
-
- -
-
-
+
-
-
-
{{ s.label }}
- -
{{ s.value }}
- -
-
-
+
{ - let sections = [] - if (lead.data.first_response_time) { - sections.push({ - label: 'Fulfilled In', - value: formatTime(lead.data.first_response_time), - tooltipText: dateFormat(lead.data.first_responded_on, dateTooltipFormat), - }) - } - - let status = lead.data.sla_status - let tooltipText = status - let color = - lead.data.sla_status == 'Failed' - ? 'red' - : lead.data.sla_status == 'Fulfilled' - ? 'green' - : 'orange' - - if (status == 'First Response Due') { - status = timeAgo(lead.data.response_by) - tooltipText = dateFormat(lead.data.response_by, dateTooltipFormat) - if (new Date(lead.data.response_by) < new Date()) { - color = 'red' - } - } - - sections.push({ - label: 'Status', - isBadge: true, - value: status, - tooltipText: tooltipText, - color: color, - }) - return sections -})