feat: Update bot typing indicator based on the conversation status (#7714)

- Show the indicator if the last message is incoming and the conversation is in pending status.
- Remove list of articles displayed in the bot response.
This commit is contained in:
Pranav Raj S
2023-08-11 16:41:01 -07:00
committed by GitHub
parent cfe86d9c06
commit 6f09f20991
4 changed files with 23 additions and 5 deletions

View File

@@ -16,7 +16,7 @@
:message="message"
/>
</div>
<agent-typing-bubble v-if="isAgentTyping" />
<agent-typing-bubble v-if="showStatusIndicator" />
</div>
</div>
</template>
@@ -27,7 +27,7 @@ import AgentTypingBubble from 'widget/components/AgentTypingBubble.vue';
import DateSeparator from 'shared/components/DateSeparator.vue';
import Spinner from 'shared/components/Spinner.vue';
import darkModeMixin from 'widget/mixins/darkModeMixin';
import { MESSAGE_TYPE } from 'shared/constants/messages';
import { mapActions, mapGetters } from 'vuex';
export default {
@@ -54,14 +54,26 @@ export default {
computed: {
...mapGetters({
earliestMessage: 'conversation/getEarliestMessage',
lastMessage: 'conversation/getLastMessage',
allMessagesLoaded: 'conversation/getAllMessagesLoaded',
isFetchingList: 'conversation/getIsFetchingList',
conversationSize: 'conversation/getConversationSize',
isAgentTyping: 'conversation/getIsAgentTyping',
conversationAttributes: 'conversationAttributes/getConversationParams',
}),
colorSchemeClass() {
return `${this.darkMode === 'dark' ? 'dark-scheme' : 'light-scheme'}`;
},
showStatusIndicator() {
const { status } = this.conversationAttributes;
const isConversationInPendingStatus = status === 'pending';
const isLastMessageIncoming =
this.lastMessage.message_type === MESSAGE_TYPE.INCOMING;
return (
this.isAgentTyping ||
(isConversationInPendingStatus && isLastMessageIncoming)
);
},
},
watch: {
allMessagesLoaded() {