# Pull Request Template ## Description This PR includes the following changes: 1. Fixes a couple of UI issues. 2. Moves all styles to inline classes. 3. Migrates the `ConversationCard.vue` component from the Options API to the Composition API. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Screenshots **Before** <img width="353" height="550" alt="image" src="https://github.com/user-attachments/assets/070c9bf1-6077-48d8-832d-79037b794f42" /> **After** <img width="353" height="541" alt="image" src="https://github.com/user-attachments/assets/c54bf69c-d175-45cf-a6fe-9c7ab6f66226" /> ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules
79 lines
1.9 KiB
Vue
79 lines
1.9 KiB
Vue
<script>
|
|
import ConversationCard from 'dashboard/components/widgets/conversation/ConversationCard.vue';
|
|
import { mapGetters } from 'vuex';
|
|
import Spinner from 'dashboard/components-next/spinner/Spinner.vue';
|
|
|
|
export default {
|
|
components: {
|
|
ConversationCard,
|
|
Spinner,
|
|
},
|
|
props: {
|
|
contactId: {
|
|
type: [String, Number],
|
|
required: true,
|
|
},
|
|
conversationId: {
|
|
type: [String, Number],
|
|
required: true,
|
|
},
|
|
},
|
|
computed: {
|
|
conversations() {
|
|
return this.$store.getters['contactConversations/getContactConversation'](
|
|
this.contactId
|
|
);
|
|
},
|
|
previousConversations() {
|
|
return this.conversations.filter(
|
|
conversation => conversation.id !== Number(this.conversationId)
|
|
);
|
|
},
|
|
...mapGetters({
|
|
uiFlags: 'contactConversations/getUIFlags',
|
|
}),
|
|
},
|
|
watch: {
|
|
contactId(newContactId, prevContactId) {
|
|
if (newContactId && newContactId !== prevContactId) {
|
|
this.$store.dispatch('contactConversations/get', newContactId);
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
this.$store.dispatch('contactConversations/get', this.contactId);
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="!uiFlags.isFetching" class="">
|
|
<div v-if="!previousConversations.length" class="no-label-message px-4 p-3">
|
|
<span>
|
|
{{ $t('CONTACT_PANEL.CONVERSATIONS.NO_RECORDS_FOUND') }}
|
|
</span>
|
|
</div>
|
|
<div v-else class="contact-conversation--list">
|
|
<ConversationCard
|
|
v-for="conversation in previousConversations"
|
|
:key="conversation.id"
|
|
:chat="conversation"
|
|
:hide-inbox-name="false"
|
|
hide-thumbnail
|
|
enable-context-menu
|
|
compact
|
|
:allowed-context-menu-options="['open-new-tab', 'copy-link']"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div v-else class="flex items-center justify-center py-5">
|
|
<Spinner />
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
.no-label-message {
|
|
@apply text-n-slate-11 mb-4;
|
|
}
|
|
</style>
|