diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index 4fccad865..91247105d 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -11,7 +11,7 @@ "TITLE": "Search messages", "LOADING_MESSAGE": "Crunching data...", "PLACEHOLDER": "Type any text to search messages", - "NO_MATCHING_RESULTS": "There are no messages matching the search parameters." + "NO_MATCHING_RESULTS": "No results found." }, "UNREAD_MESSAGES": "Unread Messages", "UNREAD_MESSAGE": "Unread Message", diff --git a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue index 702613cf8..0e1bfd464 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue @@ -6,17 +6,7 @@ :active-team="activeTeam" @conversation-load="onConversationLoad" > - - - - {{ $t('CONVERSATION.SEARCH_MESSAGES') }} - - - + import { mapGetters } from 'vuex'; - import ChatList from '../../../components/ChatList'; import ConversationBox from '../../../components/widgets/conversation/ConversationBox'; -import Search from './search/Search.vue'; +import PopOverSearch from './search/PopOverSearch'; import uiSettingsMixin from 'dashboard/mixins/uiSettings'; export default { components: { ChatList, ConversationBox, - Search, + PopOverSearch, }, mixins: [uiSettingsMixin], props: { @@ -146,31 +135,6 @@ export default { }; diff --git a/app/javascript/dashboard/routes/dashboard/conversation/search/ResultItem.vue b/app/javascript/dashboard/routes/dashboard/conversation/search/ResultItem.vue new file mode 100644 index 000000000..20bb34cc9 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/conversation/search/ResultItem.vue @@ -0,0 +1,191 @@ + + + + + + + + {{ userName }} + + # {{ conversationId }} + + + {{ inboxName }} + + + {{ readableTime }} + + + + + + + + diff --git a/app/javascript/dashboard/routes/dashboard/conversation/search/Search.vue b/app/javascript/dashboard/routes/dashboard/conversation/search/Search.vue deleted file mode 100644 index 611e77968..000000000 --- a/app/javascript/dashboard/routes/dashboard/conversation/search/Search.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - {{ $t('CONVERSATION.SEARCH.LOADING_MESSAGE') }} - - - - - onClick(conversation)" - > - - #{{ conversation.id }} - {{ dynamicTime(message.created_at) }} - - - - - - - - {{ $t('CONVERSATION.SEARCH.NO_MATCHING_RESULTS') }} - - - - - - - - diff --git a/app/javascript/dashboard/routes/dashboard/conversation/search/SearchMessageItem.vue b/app/javascript/dashboard/routes/dashboard/conversation/search/SearchMessageItem.vue new file mode 100644 index 000000000..40da05e99 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/conversation/search/SearchMessageItem.vue @@ -0,0 +1,155 @@ + + + + + + {{ userName }} + + + + + {{ readableTime }} + + + + + + + + diff --git a/app/views/api/v1/accounts/conversations/search.json.jbuilder b/app/views/api/v1/accounts/conversations/search.json.jbuilder index 9193b0e48..ab9114ad7 100644 --- a/app/views/api/v1/accounts/conversations/search.json.jbuilder +++ b/app/views/api/v1/accounts/conversations/search.json.jbuilder @@ -6,9 +6,22 @@ end json.payload do json.array! @conversations do |conversation| json.id conversation.display_id + json.created_at conversation.created_at.to_i + json.contact do + json.id conversation.contact.id + json.name conversation.contact.name + end + json.inbox do + json.id conversation.inbox.id + json.name conversation.inbox.name + json.channel_type conversation.inbox.channel_type + end json.messages do json.array! conversation.messages do |message| json.content message.content + json.id message.id + json.sender_name message.sender.name if message.sender + json.message_type message.message_type_before_type_cast json.created_at message.created_at.to_i end end