2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
2022-01-12 10:55:27 +00:00
|
|
|
<div class="flex flex-1 flex-col justify-end">
|
2021-02-15 19:28:57 +00:00
|
|
|
<div class="flex flex-1 overflow-auto">
|
2022-01-12 10:55:27 +00:00
|
|
|
<!-- Load Converstion List Components Here -->
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
2022-01-12 10:55:27 +00:00
|
|
|
<team-availability
|
|
|
|
:available-agents="availableAgents"
|
|
|
|
:has-conversation="!!conversationSize"
|
|
|
|
@start-conversation="startConversation"
|
|
|
|
/>
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-05-09 16:32:43 +00:00
|
|
|
import configMixin from '../mixins/configMixin';
|
2020-10-18 18:02:22 +00:00
|
|
|
import TeamAvailability from 'widget/components/TeamAvailability';
|
|
|
|
import { mapGetters } from 'vuex';
|
2021-04-15 16:58:19 +00:00
|
|
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
2022-01-12 10:55:27 +00:00
|
|
|
import routerMixin from 'widget/mixins/routerMixin';
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
name: 'Home',
|
|
|
|
components: {
|
2020-10-18 18:02:22 +00:00
|
|
|
TeamAvailability,
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
2022-01-12 10:55:27 +00:00
|
|
|
mixins: [configMixin, routerMixin],
|
2020-07-07 18:34:44 +00:00
|
|
|
props: {
|
|
|
|
hasFetched: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-11-11 13:32:16 +00:00
|
|
|
isCampaignViewClicked: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-07-07 18:34:44 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
data() {
|
2021-06-30 15:39:44 +00:00
|
|
|
return {
|
|
|
|
isOnCollapsedView: false,
|
|
|
|
isOnNewConversation: false,
|
|
|
|
};
|
2020-10-18 18:02:22 +00:00
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
computed: {
|
2020-10-18 18:02:22 +00:00
|
|
|
...mapGetters({
|
2021-02-15 18:44:13 +00:00
|
|
|
availableAgents: 'agent/availableAgents',
|
2021-11-11 13:32:16 +00:00
|
|
|
activeCampaign: 'campaign/getActiveCampaign',
|
2022-01-12 10:55:27 +00:00
|
|
|
conversationSize: 'conversation/getConversationSize',
|
2020-10-18 18:02:22 +00:00
|
|
|
}),
|
2020-02-05 05:57:22 +00:00
|
|
|
},
|
2021-04-15 16:58:19 +00:00
|
|
|
mounted() {
|
2021-06-30 15:39:44 +00:00
|
|
|
bus.$on(BUS_EVENTS.START_NEW_CONVERSATION, () => {
|
|
|
|
this.isOnCollapsedView = true;
|
|
|
|
this.isOnNewConversation = true;
|
|
|
|
});
|
2021-04-15 16:58:19 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
methods: {
|
|
|
|
startConversation() {
|
2022-01-12 10:55:27 +00:00
|
|
|
if (this.preChatFormEnabled && !this.conversationSize) {
|
|
|
|
return this.replaceRoute('prechat-form');
|
|
|
|
}
|
|
|
|
return this.replaceRoute('messages');
|
2021-09-02 06:43:53 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
};
|
|
|
|
</script>
|