2019-11-17 07:39:10 +00:00
|
|
|
<template>
|
|
|
|
<div class="columns full-height conv-empty-state">
|
|
|
|
<woot-loading-state
|
2019-12-28 16:26:42 +00:00
|
|
|
v-if="uiFlags.isFetching || loadingChatList"
|
2019-11-17 07:39:10 +00:00
|
|
|
:message="loadingIndicatorMessage"
|
|
|
|
/>
|
|
|
|
<!-- Show empty state images if not loading -->
|
2019-12-28 16:26:42 +00:00
|
|
|
<div v-if="!uiFlags.isFetching && !loadingChatList" class="current-chat">
|
2019-11-17 07:39:10 +00:00
|
|
|
<!-- No inboxes attached -->
|
|
|
|
<div v-if="!inboxesList.length">
|
|
|
|
<img src="~dashboard/assets/images/inboxes.svg" alt="No Inboxes" />
|
|
|
|
<span v-if="isAdmin()">
|
|
|
|
{{ $t('CONVERSATION.NO_INBOX_1') }}
|
|
|
|
<br />
|
|
|
|
<router-link :to="newInboxURL">
|
|
|
|
{{ $t('CONVERSATION.CLICK_HERE') }}
|
|
|
|
</router-link>
|
|
|
|
{{ $t('CONVERSATION.NO_INBOX_2') }}
|
|
|
|
</span>
|
|
|
|
<span v-if="!isAdmin()">
|
|
|
|
{{ $t('CONVERSATION.NO_INBOX_AGENT') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<!-- No conversations available -->
|
|
|
|
<div v-else-if="!allConversations.length">
|
|
|
|
<img src="~dashboard/assets/images/chat.svg" alt="No Chat" />
|
|
|
|
<span>
|
|
|
|
{{ $t('CONVERSATION.NO_MESSAGE_1') }}
|
|
|
|
<br />
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<!-- No conversation selected -->
|
|
|
|
<div v-else-if="allConversations.length && currentChat.id === null">
|
|
|
|
<img src="~dashboard/assets/images/chat.svg" alt="No Chat" />
|
|
|
|
<span>{{ $t('CONVERSATION.404') }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import adminMixin from '../../../mixins/isAdmin';
|
2020-04-23 06:51:45 +00:00
|
|
|
import accountMixin from '../../../mixins/account';
|
2019-11-17 07:39:10 +00:00
|
|
|
|
|
|
|
export default {
|
2020-04-23 06:51:45 +00:00
|
|
|
mixins: [accountMixin, adminMixin],
|
2019-11-17 07:39:10 +00:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
currentChat: 'getSelectedChat',
|
|
|
|
allConversations: 'getAllConversations',
|
2019-12-28 16:26:42 +00:00
|
|
|
inboxesList: 'inboxes/getInboxes',
|
|
|
|
uiFlags: 'inboxes/getUIFlags',
|
2019-11-17 07:39:10 +00:00
|
|
|
loadingChatList: 'getChatListLoadingStatus',
|
|
|
|
}),
|
|
|
|
loadingIndicatorMessage() {
|
2019-12-28 16:26:42 +00:00
|
|
|
if (this.uiFlags.isFetching) {
|
2019-11-17 07:39:10 +00:00
|
|
|
return this.$t('CONVERSATION.LOADING_INBOXES');
|
|
|
|
}
|
|
|
|
return this.$t('CONVERSATION.LOADING_CONVERSATIONS');
|
|
|
|
},
|
|
|
|
newInboxURL() {
|
2020-04-23 06:51:45 +00:00
|
|
|
return this.addAccountScoping('settings/inboxes/new');
|
2019-11-17 07:39:10 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|