2019-11-17 07:39:10 +00:00
|
|
|
<template>
|
2021-02-24 05:46:38 +00:00
|
|
|
<div :class="emptyClassName">
|
2019-11-17 07:39:10 +00:00
|
|
|
<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"
|
|
|
|
/>
|
2021-02-24 05:46:38 +00:00
|
|
|
<!-- No inboxes attached -->
|
|
|
|
<div
|
|
|
|
v-if="!inboxesList.length && !uiFlags.isFetching && !loadingChatList"
|
|
|
|
class="clearfix"
|
|
|
|
>
|
|
|
|
<onboarding-view v-if="isAdmin" />
|
|
|
|
<div v-else class="current-chat">
|
|
|
|
<div>
|
|
|
|
<img src="~dashboard/assets/images/inboxes.svg" alt="No Inboxes" />
|
|
|
|
<span>
|
|
|
|
{{ $t('CONVERSATION.NO_INBOX_AGENT') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
2019-11-17 07:39:10 +00:00
|
|
|
</div>
|
2021-02-24 05:46:38 +00:00
|
|
|
</div>
|
|
|
|
<!-- Show empty state images if not loading -->
|
|
|
|
<div
|
|
|
|
v-else-if="!uiFlags.isFetching && !loadingChatList"
|
|
|
|
class="current-chat"
|
|
|
|
>
|
2019-11-17 07:39:10 +00:00
|
|
|
<!-- No conversations available -->
|
2021-02-24 05:46:38 +00:00
|
|
|
<div v-if="!allConversations.length">
|
2019-11-17 07:39:10 +00:00
|
|
|
<img src="~dashboard/assets/images/chat.svg" alt="No Chat" />
|
|
|
|
<span>
|
|
|
|
{{ $t('CONVERSATION.NO_MESSAGE_1') }}
|
|
|
|
<br />
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<!-- No conversation selected -->
|
2020-07-23 18:03:17 +00:00
|
|
|
<div v-else-if="allConversations.length && !currentChat.id">
|
2019-11-17 07:39:10 +00:00
|
|
|
<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';
|
2021-02-24 05:46:38 +00:00
|
|
|
import OnboardingView from './OnboardingView';
|
2019-11-17 07:39:10 +00:00
|
|
|
|
|
|
|
export default {
|
2021-02-24 05:46:38 +00:00
|
|
|
components: {
|
|
|
|
OnboardingView,
|
|
|
|
},
|
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
|
|
|
},
|
2021-02-24 05:46:38 +00:00
|
|
|
emptyClassName() {
|
|
|
|
if (
|
|
|
|
!this.inboxesList.length &&
|
|
|
|
!this.uiFlags.isFetching &&
|
|
|
|
!this.loadingChatList &&
|
|
|
|
this.isAdmin
|
|
|
|
) {
|
|
|
|
return 'inbox-empty-state';
|
|
|
|
}
|
2021-03-02 17:14:04 +00:00
|
|
|
return 'columns conv-empty-state';
|
2021-02-24 05:46:38 +00:00
|
|
|
},
|
2019-11-17 07:39:10 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2021-03-02 17:14:04 +00:00
|
|
|
<style lang="scss" scoped>
|
2021-02-24 05:46:38 +00:00
|
|
|
.inbox-empty-state {
|
|
|
|
height: 100%;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
2021-03-02 17:14:04 +00:00
|
|
|
|
|
|
|
.current-chat {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
div {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
img {
|
|
|
|
margin: var(--space-normal);
|
|
|
|
width: 10rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
|
|
font-size: var(--font-size-small);
|
|
|
|
font-weight: var(--font-weight-medium);
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.conv-empty-state {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
height: 100vh;
|
|
|
|
}
|
2021-02-24 05:46:38 +00:00
|
|
|
</style>
|