From 523240b092f5f6ef87df89f111699a32c8f98ab3 Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Fri, 19 Apr 2024 14:28:32 +0300 Subject: [PATCH] refactor: timeline restructurization [WTEL-3534] --- package.json | 1 + .../day-row/day-timeline-row-counters.vue | 34 +++ .../day-row/day-timeline-row-section.vue | 68 +++++ .../components/day-row/day-timeline-row.vue | 88 ++++++ .../{utils => }/event-status-detail.vue | 0 .../{utils => }/event-type-filter.vue | 0 .../components/opened-timeline-call.vue | 19 -- .../components/opened-timeline-chat.vue | 0 .../components/opened-timeline-day.vue | 237 ---------------- .../task-row/call-task-timeline-row.vue | 11 + .../task-row/chat-task-timeline-row.vue | 255 ++++++++++++++++++ .../components/task-row/task-timeline-row.vue | 33 +++ .../timeline/components/the-timeline.vue | 56 ++-- .../components/timeline-container.vue | 31 +++ .../timeline/components/timeline-day.vue | 96 ------- .../timeline/components/timeline-header.vue | 2 +- .../components/utils/event-record.vue | 23 -- .../components/utils/timeline-pin.vue | 68 +++++ .../utils/timeline-row-duration.vue | 18 ++ .../components/utils/timeline-row-info.vue | 60 +++++ ...or-name.vue => timeline-row-initiator.vue} | 0 .../components/utils/timeline-row.vue | 68 +++++ .../timeline/enums/TimelinePinType.enum.js | 10 + 23 files changed, 773 insertions(+), 405 deletions(-) create mode 100644 src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-counters.vue create mode 100644 src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-section.vue create mode 100644 src/modules/contacts/modules/timeline/components/day-row/day-timeline-row.vue rename src/modules/contacts/modules/timeline/components/{utils => }/event-status-detail.vue (100%) rename src/modules/contacts/modules/timeline/components/{utils => }/event-type-filter.vue (100%) delete mode 100644 src/modules/contacts/modules/timeline/components/opened-timeline-call.vue delete mode 100644 src/modules/contacts/modules/timeline/components/opened-timeline-chat.vue delete mode 100644 src/modules/contacts/modules/timeline/components/opened-timeline-day.vue create mode 100644 src/modules/contacts/modules/timeline/components/task-row/call-task-timeline-row.vue create mode 100644 src/modules/contacts/modules/timeline/components/task-row/chat-task-timeline-row.vue create mode 100644 src/modules/contacts/modules/timeline/components/task-row/task-timeline-row.vue create mode 100644 src/modules/contacts/modules/timeline/components/timeline-container.vue delete mode 100644 src/modules/contacts/modules/timeline/components/timeline-day.vue delete mode 100644 src/modules/contacts/modules/timeline/components/utils/event-record.vue create mode 100644 src/modules/contacts/modules/timeline/components/utils/timeline-pin.vue create mode 100644 src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue create mode 100644 src/modules/contacts/modules/timeline/components/utils/timeline-row-info.vue rename src/modules/contacts/modules/timeline/components/utils/{event-initiator-name.vue => timeline-row-initiator.vue} (100%) create mode 100644 src/modules/contacts/modules/timeline/components/utils/timeline-row.vue create mode 100644 src/modules/contacts/modules/timeline/enums/TimelinePinType.enum.js diff --git a/package.json b/package.json index 5bc01cd1..d1c65e6a 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "test:unit": "vitest", "lint:fix": "eslint --fix --ext .js,.vue src" }, + "type": "module", "dependencies": { "@vue/compat": "^3.3.9", "@vuelidate/core": "^2.0.0", diff --git a/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-counters.vue b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-counters.vue new file mode 100644 index 00000000..2ca47192 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-counters.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-section.vue b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-section.vue new file mode 100644 index 00000000..697bca4d --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row-section.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row.vue b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row.vue new file mode 100644 index 00000000..83f8d79f --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/day-row/day-timeline-row.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/utils/event-status-detail.vue b/src/modules/contacts/modules/timeline/components/event-status-detail.vue similarity index 100% rename from src/modules/contacts/modules/timeline/components/utils/event-status-detail.vue rename to src/modules/contacts/modules/timeline/components/event-status-detail.vue diff --git a/src/modules/contacts/modules/timeline/components/utils/event-type-filter.vue b/src/modules/contacts/modules/timeline/components/event-type-filter.vue similarity index 100% rename from src/modules/contacts/modules/timeline/components/utils/event-type-filter.vue rename to src/modules/contacts/modules/timeline/components/event-type-filter.vue diff --git a/src/modules/contacts/modules/timeline/components/opened-timeline-call.vue b/src/modules/contacts/modules/timeline/components/opened-timeline-call.vue deleted file mode 100644 index ee68f187..00000000 --- a/src/modules/contacts/modules/timeline/components/opened-timeline-call.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/src/modules/contacts/modules/timeline/components/opened-timeline-chat.vue b/src/modules/contacts/modules/timeline/components/opened-timeline-chat.vue deleted file mode 100644 index e69de29b..00000000 diff --git a/src/modules/contacts/modules/timeline/components/opened-timeline-day.vue b/src/modules/contacts/modules/timeline/components/opened-timeline-day.vue deleted file mode 100644 index dce1df19..00000000 --- a/src/modules/contacts/modules/timeline/components/opened-timeline-day.vue +++ /dev/null @@ -1,237 +0,0 @@ - - - - - diff --git a/src/modules/contacts/modules/timeline/components/task-row/call-task-timeline-row.vue b/src/modules/contacts/modules/timeline/components/task-row/call-task-timeline-row.vue new file mode 100644 index 00000000..762e8b79 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/task-row/call-task-timeline-row.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/task-row/chat-task-timeline-row.vue b/src/modules/contacts/modules/timeline/components/task-row/chat-task-timeline-row.vue new file mode 100644 index 00000000..08962e92 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/task-row/chat-task-timeline-row.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/task-row/task-timeline-row.vue b/src/modules/contacts/modules/timeline/components/task-row/task-timeline-row.vue new file mode 100644 index 00000000..f217fc29 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/task-row/task-timeline-row.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/the-timeline.vue b/src/modules/contacts/modules/timeline/components/the-timeline.vue index 4983477d..9fa6f76b 100644 --- a/src/modules/contacts/modules/timeline/components/the-timeline.vue +++ b/src/modules/contacts/modules/timeline/components/the-timeline.vue @@ -1,38 +1,45 @@ diff --git a/src/modules/contacts/modules/timeline/components/timeline-container.vue b/src/modules/contacts/modules/timeline/components/timeline-container.vue new file mode 100644 index 00000000..c73e5b74 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/timeline-container.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/timeline-day.vue b/src/modules/contacts/modules/timeline/components/timeline-day.vue deleted file mode 100644 index bd7fa9c1..00000000 --- a/src/modules/contacts/modules/timeline/components/timeline-day.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - diff --git a/src/modules/contacts/modules/timeline/components/timeline-header.vue b/src/modules/contacts/modules/timeline/components/timeline-header.vue index a0d8d018..001c4854 100644 --- a/src/modules/contacts/modules/timeline/components/timeline-header.vue +++ b/src/modules/contacts/modules/timeline/components/timeline-header.vue @@ -22,7 +22,7 @@ import getNamespacedState from '@webitel/ui-sdk/src/store/helpers/getNamespacedS import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useStore } from 'vuex'; -import EventTypeFilter from './utils/event-type-filter.vue'; +import EventTypeFilter from './event-type-filter.vue'; import timelineEventTypes from './enums/timelineEventTypes.enum'; const props = defineProps({ diff --git a/src/modules/contacts/modules/timeline/components/utils/event-record.vue b/src/modules/contacts/modules/timeline/components/utils/event-record.vue deleted file mode 100644 index f9840068..00000000 --- a/src/modules/contacts/modules/timeline/components/utils/event-record.vue +++ /dev/null @@ -1,23 +0,0 @@ - - diff --git a/src/modules/contacts/modules/timeline/components/utils/timeline-pin.vue b/src/modules/contacts/modules/timeline/components/utils/timeline-pin.vue new file mode 100644 index 00000000..dc4bddf2 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/utils/timeline-pin.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue b/src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue new file mode 100644 index 00000000..7ddf5be0 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/utils/timeline-row-info.vue b/src/modules/contacts/modules/timeline/components/utils/timeline-row-info.vue new file mode 100644 index 00000000..74aad991 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/utils/timeline-row-info.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/components/utils/event-initiator-name.vue b/src/modules/contacts/modules/timeline/components/utils/timeline-row-initiator.vue similarity index 100% rename from src/modules/contacts/modules/timeline/components/utils/event-initiator-name.vue rename to src/modules/contacts/modules/timeline/components/utils/timeline-row-initiator.vue diff --git a/src/modules/contacts/modules/timeline/components/utils/timeline-row.vue b/src/modules/contacts/modules/timeline/components/utils/timeline-row.vue new file mode 100644 index 00000000..a8ccaf74 --- /dev/null +++ b/src/modules/contacts/modules/timeline/components/utils/timeline-row.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/modules/contacts/modules/timeline/enums/TimelinePinType.enum.js b/src/modules/contacts/modules/timeline/enums/TimelinePinType.enum.js new file mode 100644 index 00000000..255afcaa --- /dev/null +++ b/src/modules/contacts/modules/timeline/enums/TimelinePinType.enum.js @@ -0,0 +1,10 @@ +const TimelinePinType = Object.freeze({ + CALL_INBOUND: 'CALL_INBOUND', + DAY: 'DAY', + CALL_TRANSFER: 'CALL_TRANSFER', + CHAT_INVITE: 'CHAT_INVITE', + CLOSE: 'CLOSE', + // TODO ... +}); + +export default TimelinePinType;