From 85c6b67f50d9e1186867ee0b60d072965e9292ed Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Thu, 25 Apr 2024 16:40:37 +0300 Subject: [PATCH] refactor: timeline chats reorganization [WTEL-4465] --- .../utils/timeline-row-duration.vue | 7 ++- .../components/utils/timeline-row.vue | 7 +++ .../modules/chats/api/MessageHistoryAPI.js | 23 ++++---- ...e => chat-point-timeline-row-dropdown.vue} | 0 ...nt-row.vue => chat-point-timeline-row.vue} | 14 +++-- ...e => chat-points-timeline-row-section.vue} | 10 ++-- .../task-row/chat-task-timeline-row.vue | 57 +++++++++++-------- .../timeline/modules/chats/store/chats.js | 14 ++--- 8 files changed, 74 insertions(+), 58 deletions(-) rename src/modules/contacts/modules/timeline/modules/chats/components/point-row/{chat-point-row-dropdown.vue => chat-point-timeline-row-dropdown.vue} (100%) rename src/modules/contacts/modules/timeline/modules/chats/components/point-row/{chat-point-row.vue => chat-point-timeline-row.vue} (78%) rename src/modules/contacts/modules/timeline/modules/chats/components/point-row/{chat-points-row-section.vue => chat-points-timeline-row-section.vue} (77%) 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 index d4c0d60a..336fe804 100644 --- a/src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue +++ b/src/modules/contacts/modules/timeline/components/utils/timeline-row-duration.vue @@ -1,13 +1,14 @@ diff --git a/src/modules/contacts/modules/timeline/modules/chats/store/chats.js b/src/modules/contacts/modules/timeline/modules/chats/store/chats.js index baf778d6..6cab8dee 100644 --- a/src/modules/contacts/modules/timeline/modules/chats/store/chats.js +++ b/src/modules/contacts/modules/timeline/modules/chats/store/chats.js @@ -7,23 +7,21 @@ const state = { }; const getters = { - CONTACT_ID: (s, g, rS, rootGetters) => rootGetters['contacts/card/timeline/PARENT_ID'], - HISTORY_BY_CHAT_ID: (state) => (chatId) => state.historyById[chatId], + HISTORY_BY_CHAT_ID: (state) => (taskId) => state.historyById[taskId], }; const actions = { - LOAD_HISTORY: async (context, { chatId }) => { + LOAD_HISTORY: async (context, { taskId }) => { const { items } = await MessageHistoryAPI.getList({ - contactId: context.getters.CONTACT_ID, - chatId, + taskId, }); - context.commit('SET_TO_HISTORY', { chatId, data: items }); + context.commit('SET_TO_HISTORY', { taskId, data: items }); }, }; const mutations = { - SET_TO_HISTORY: (state, { chatId, data }) => { - state.historyById[chatId] = data; + SET_TO_HISTORY: (state, { taskId, data }) => { + state.historyById[taskId] = data; }, };