Merge branch 'develop' into CW-3108

This commit is contained in:
Sivin Varghese
2024-04-30 21:43:41 +05:30
committed by GitHub
958 changed files with 23062 additions and 6309 deletions
+2 -3
View File
@@ -38,10 +38,9 @@ const setUserLastSeenAt = async ({ lastSeen }) => {
{ contact_last_seen_at: lastSeen }
);
};
const sendEmailTranscript = async ({ email }) => {
const sendEmailTranscript = async () => {
return API.post(
`/api/v1/widget/conversations/transcript${window.location.search}`,
{ email }
`/api/v1/widget/conversations/transcript${window.location.search}`
);
};
const toggleStatus = async () => {
@@ -87,7 +87,10 @@ export default {
return !allowMessagesAfterResolved && status === 'resolved';
},
showEmailTranscriptButton() {
return this.currentUser && this.currentUser.email;
return this.hasEmail;
},
hasEmail() {
return this.currentUser && this.currentUser.has_email;
},
hasReplyTo() {
return (
@@ -141,12 +144,9 @@ export default {
this.inReplyTo = message;
},
async sendTranscript() {
const { email } = this.currentUser;
if (email) {
if (this.hasEmail) {
try {
await sendEmailTranscript({
email,
});
await sendEmailTranscript();
window.bus.$emit(BUS_EVENTS.SHOW_ALERT, {
message: this.$t('EMAIL_TRANSCRIPT.SEND_EMAIL_SUCCESS'),
type: 'success',
@@ -49,7 +49,6 @@
<script>
import { mapGetters } from 'vuex';
import { mixin as clickaway } from 'vue-clickaway';
import ChatAttachmentButton from 'widget/components/ChatAttachment.vue';
import ChatSendButton from 'widget/components/ChatSendButton.vue';
@@ -69,7 +68,7 @@ export default {
FluentIcon,
ResizableTextArea,
},
mixins: [clickaway, configMixin, darkModeMixin],
mixins: [configMixin, darkModeMixin],
props: {
onSendMessage: {
type: Function,
@@ -83,7 +83,6 @@
</template>
<script>
import { mixin as clickaway } from 'vue-clickaway';
import countries from 'shared/constants/countries.js';
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
import mentionSelectionKeyboardMixin from 'dashboard/components/widgets/mentions/mentionSelectionKeyboardMixin.js';
@@ -94,12 +93,7 @@ export default {
components: {
FluentIcon,
},
mixins: [
mentionSelectionKeyboardMixin,
FormulateInputMixin,
darkModeMixin,
clickaway,
],
mixins: [mentionSelectionKeyboardMixin, FormulateInputMixin, darkModeMixin],
props: {
placeholder: {
type: String,
@@ -220,25 +214,26 @@ export default {
},
dropdownItem() {
// This function is used to get all the items in the dropdown.
if (!this.showDropdown) return [];
return Array.from(
this.$refs.dropdown.querySelectorAll(
this.$refs.dropdown?.querySelectorAll(
'div.country-dropdown div.country-dropdown--item'
)
);
},
focusedOrActiveItem(className) {
// This function is used to get the focused or active item in the dropdown.
if (!this.showDropdown) return [];
return Array.from(
this.$refs.dropdown.querySelectorAll(
this.$refs.dropdown?.querySelectorAll(
`div.country-dropdown div.country-dropdown--item.${className}`
)
);
},
handleKeyboardEvent(e) {
if (this.showDropdown) {
this.processKeyDownEvent(e);
adjustScroll() {
this.$nextTick(() => {
this.scrollToFocusedOrActiveItem(this.focusedOrActiveItem('focus'));
}
});
},
onSelect() {
this.onSelectCountry(this.items[this.selectedIndex]);
@@ -1,7 +1,7 @@
<template>
<FormulateForm
v-model="formValues"
class="flex flex-1 flex-col p-6 overflow-y-auto"
class="flex flex-col flex-1 p-6 overflow-y-auto"
@submit="onSubmit"
>
<div
@@ -49,7 +49,7 @@
/>
<custom-button
class="font-medium mt-2 mb-5"
class="mt-2 mb-5 font-medium"
block
:bg-color="widgetColor"
:text-color="textColor"
@@ -133,9 +133,10 @@ export default {
return this.preChatFormEnabled ? this.options.preChatFields : [];
},
filteredPreChatFields() {
const isUserEmailAvailable = !!this.currentUser.email;
const isUserPhoneNumberAvailable = !!this.currentUser.phone_number;
const isUserEmailAvailable = this.currentUser.has_email;
const isUserPhoneNumberAvailable = this.currentUser.has_phone_number;
const isUserIdentifierAvailable = !!this.currentUser.identifier;
const isUserNameAvailable = !!(
isUserIdentifierAvailable ||
isUserEmailAvailable ||
@@ -302,11 +303,10 @@ export default {
},
onSubmit() {
const { emailAddress, fullName, phoneNumber, message } = this.formValues;
const { email } = this.currentUser;
this.$emit('submit', {
fullName,
phoneNumber,
emailAddress: emailAddress || email,
emailAddress,
message,
activeCampaignId: this.activeCampaign.id,
conversationCustomAttributes: this.conversationCustomAttributes,
+3 -3
View File
@@ -36,7 +36,7 @@
"CONTINUE_CONVERSATION": "Konversation fortsetzen",
"YOU": "You",
"START_NEW_CONVERSATION": "Neue Unterhaltung starten",
"VIEW_UNREAD_MESSAGES": "You have unread messages",
"VIEW_UNREAD_MESSAGES": "Sie haben ungelesene Nachrichten",
"UNREAD_VIEW": {
"VIEW_MESSAGES_BUTTON": "Neue Nachrichten anzeigen",
"CLOSE_MESSAGES_BUTTON": "Schließen",
@@ -110,9 +110,9 @@
}
},
"PORTAL": {
"POPULAR_ARTICLES": "Popular Articles",
"POPULAR_ARTICLES": "Beliebte Artikel",
"VIEW_ALL_ARTICLES": "Alle Artikel anzeigen",
"IFRAME_LOAD_ERROR": "There was an error loading the article, please refresh the page and try again."
"IFRAME_LOAD_ERROR": "Beim Laden des Artikels ist ein Fehler aufgetreten. Bitte aktualisieren Sie die Seite und versuchen Sie es erneut."
},
"ATTACHMENTS": {
"image": {
+6 -6
View File
@@ -33,9 +33,9 @@
],
"START_CONVERSATION": "チャットを開始する",
"END_CONVERSATION": "End Conversation",
"CONTINUE_CONVERSATION": "Continue conversation",
"CONTINUE_CONVERSATION": "会話を続行",
"YOU": "You",
"START_NEW_CONVERSATION": "Start a new conversation",
"START_NEW_CONVERSATION": "新しいチャットを開始する",
"VIEW_UNREAD_MESSAGES": "You have unread messages",
"UNREAD_VIEW": {
"VIEW_MESSAGES_BUTTON": "新しいメッセージを見る",
@@ -80,7 +80,7 @@
},
"CAMPAIGN_HEADER": "Please provide your name and email before starting the conversation",
"IS_REQUIRED": "is required",
"REQUIRED": "Required",
"REQUIRED": "必須",
"REGEX_ERROR": "Please provide a valid input"
},
"FILE_SIZE_LIMIT": "添付ファイルサイズの上限 {MAXIMUM_FILE_UPLOAD_SIZE} を超えています",
@@ -99,7 +99,7 @@
"PLACEHOLDER": "Tell us more..."
},
"EMAIL_TRANSCRIPT": {
"BUTTON_TEXT": "Request a conversation transcript",
"BUTTON_TEXT": "会話の履歴をメールで受け取る",
"SEND_EMAIL_SUCCESS": "チャットの記録は正常に送信されました",
"SEND_EMAIL_ERROR": "エラーが発生しました。もう一度お試しください。"
},
@@ -110,8 +110,8 @@
}
},
"PORTAL": {
"POPULAR_ARTICLES": "Popular Articles",
"VIEW_ALL_ARTICLES": "View all articles",
"POPULAR_ARTICLES": "よくある質問",
"VIEW_ALL_ARTICLES": "全てのヘルプを表示",
"IFRAME_LOAD_ERROR": "There was an error loading the article, please refresh the page and try again."
},
"ATTACHMENTS": {
+2 -2
View File
@@ -33,7 +33,7 @@
],
"START_CONVERSATION": "대화 시작",
"END_CONVERSATION": "End Conversation",
"CONTINUE_CONVERSATION": "Continue conversation",
"CONTINUE_CONVERSATION": "대화 계속하기",
"YOU": "You",
"START_NEW_CONVERSATION": "Start a new conversation",
"VIEW_UNREAD_MESSAGES": "You have unread messages",
@@ -112,7 +112,7 @@
"PORTAL": {
"POPULAR_ARTICLES": "Popular Articles",
"VIEW_ALL_ARTICLES": "View all articles",
"IFRAME_LOAD_ERROR": "There was an error loading the article, please refresh the page and try again."
"IFRAME_LOAD_ERROR": "문서를 불러오는 중 오류가 발생했습니다. 페이지를 새로고침 한 후 다시 시도해 주세요."
},
"ATTACHMENTS": {
"image": {
+30 -30
View File
@@ -8,8 +8,8 @@
"SUBMIT": "Send"
},
"MESSAGE_BUBBLE": {
"RETRY": "Send message again",
"ERROR_MESSAGE": "Couldn't send, try again"
"RETRY": "Send meldingen på nytt",
"ERROR_MESSAGE": "Kunne ikke sende, prøv på nytt"
}
},
"TEAM_AVAILABILITY": {
@@ -20,23 +20,23 @@
"IN_A_FEW_MINUTES": "Svarer vanligvis innen et par timer",
"IN_A_FEW_HOURS": "Svarer vanligvis innen et par timer",
"IN_A_DAY": "Svarer vanligvis innen en dag",
"BACK_IN": "We will be back online"
"BACK_IN": "Vi vil være tilbake online"
},
"DAY_NAMES": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
"Søndag",
"Mandag",
"Tirsdag",
"Onsdag",
"Torsdag",
"Fredag",
"rdag"
],
"START_CONVERSATION": "Start samtale",
"END_CONVERSATION": "End Conversation",
"CONTINUE_CONVERSATION": "Continue conversation",
"YOU": "You",
"END_CONVERSATION": "Avslutt samtale",
"CONTINUE_CONVERSATION": "Fortsett samtalen",
"YOU": "Du",
"START_NEW_CONVERSATION": "Start en ny samtale",
"VIEW_UNREAD_MESSAGES": "You have unread messages",
"VIEW_UNREAD_MESSAGES": "Du har uleste meldinger",
"UNREAD_VIEW": {
"VIEW_MESSAGES_BUTTON": "Se nye meldinger",
"CLOSE_MESSAGES_BUTTON": "Lukk",
@@ -61,16 +61,16 @@
"EMAIL_ADDRESS": {
"LABEL": "E-postadresse",
"PLACEHOLDER": "Vennligst skriv inn din e-postadresse",
"REQUIRED_ERROR": "Email Address is required",
"REQUIRED_ERROR": "E-postadresse er påkrevd",
"VALID_ERROR": "Vennligst skriv inn en gyldig e-postadresse"
},
"PHONE_NUMBER": {
"LABEL": "Telefonnummer",
"PLACEHOLDER": "Please enter your phone number",
"REQUIRED_ERROR": "Phone Number is required",
"DIAL_CODE_VALID_ERROR": "Please select a country code",
"VALID_ERROR": "Please enter a valid phone number",
"DROPDOWN_EMPTY": "No results found"
"PLACEHOLDER": "Tast inn ditt telefonnummer",
"REQUIRED_ERROR": "Telefonnummer er påkrevd",
"DIAL_CODE_VALID_ERROR": "Vennligst velg landskode",
"VALID_ERROR": "Tast inn ditt telefonnummer",
"DROPDOWN_EMPTY": "Ingen resultater funnet"
},
"MESSAGE": {
"LABEL": "Melding",
@@ -79,9 +79,9 @@
}
},
"CAMPAIGN_HEADER": "Angi navn og e-post før du starter samtalen",
"IS_REQUIRED": "is required",
"REQUIRED": "Required",
"REGEX_ERROR": "Please provide a valid input"
"IS_REQUIRED": "er påkrevd",
"REQUIRED": "Påkrevd",
"REGEX_ERROR": "Vennligst oppgi gyldige opplysninger"
},
"FILE_SIZE_LIMIT": "Filens størrelse overskrider grensen på {MAXIMUM_FILE_UPLOAD_SIZE}",
"CHAT_FORM": {
@@ -90,8 +90,8 @@
}
},
"EMOJI": {
"PLACEHOLDER": "Search emojis",
"NOT_FOUND": "No emoji match your search"
"PLACEHOLDER": "Søk emojier",
"NOT_FOUND": "Ingen emojier samsvarer søket ditt"
},
"CSAT": {
"TITLE": "Vurder samtalen din",
@@ -105,14 +105,14 @@
},
"INTEGRATIONS": {
"DYTE": {
"CLICK_HERE_TO_JOIN": "Click here to join",
"LEAVE_THE_ROOM": "Leave the call"
"CLICK_HERE_TO_JOIN": "Klikk her for å bli med",
"LEAVE_THE_ROOM": "Forlat samtalen"
}
},
"PORTAL": {
"POPULAR_ARTICLES": "Popular Articles",
"VIEW_ALL_ARTICLES": "View all articles",
"IFRAME_LOAD_ERROR": "There was an error loading the article, please refresh the page and try again."
"POPULAR_ARTICLES": "Populære artikler",
"VIEW_ALL_ARTICLES": "Vis alle artikler",
"IFRAME_LOAD_ERROR": "Det oppstod en feil under lasting av artikkelen, oppdater siden og prøv igjen."
},
"ATTACHMENTS": {
"image": {
@@ -3,8 +3,8 @@ import { getters } from '../../contacts';
describe('#getters', () => {
it('getCurrentUser', () => {
const user = {
email: 'thoma@sphadikam.com',
name: 'Adu Thoma',
has_email: true,
has_name: true,
avatar_url: '',
identifier_hash: 'malana_hash',
};
@@ -12,8 +12,8 @@ describe('#getters', () => {
currentUser: user,
};
expect(getters.getCurrentUser(state)).toEqual({
email: 'thoma@sphadikam.com',
name: 'Adu Thoma',
has_email: true,
has_name: true,
avatar_url: '',
identifier_hash: 'malana_hash',
});
@@ -4,8 +4,8 @@ describe('#mutations', () => {
describe('#SET_CURRENT_USER', () => {
it('set current user', () => {
const user = {
email: 'thoma@sphadikam.com',
name: 'Adu Thoma',
has_email: true,
has_name: true,
avatar_url: '',
identifier_hash: 'malana_hash',
};