feat: update tool-chain to latest (#7975)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Shivam Mishra
2023-09-27 14:02:34 +05:30
committed by GitHub
parent e8b7e791a5
commit a88d155dd7
162 changed files with 3566 additions and 2884 deletions

View File

@@ -157,9 +157,8 @@ export default {
if (this.messageContentAttributes.submitted_values) {
if (this.contentType === 'input_select') {
const [
selectionOption = {},
] = this.messageContentAttributes.submitted_values;
const [selectionOption = {}] =
this.messageContentAttributes.submitted_values;
return { content: selectionOption.title || selectionOption.value };
}
}

View File

@@ -1,14 +1,14 @@
<template>
<div class="py-4 space-y-4 bg-white dark:bg-slate-700">
<div class="space-y-2 animate-pulse ">
<div class="space-y-2 animate-pulse">
<div class="h-6 bg-slate-100 dark:bg-slate-500 rounded w-2/5" />
</div>
<div class="space-y-2 animate-pulse ">
<div class="space-y-2 animate-pulse">
<div class="h-4 bg-slate-100 dark:bg-slate-500 rounded" />
<div class="h-4 bg-slate-100 dark:bg-slate-500 rounded" />
<div class="h-4 bg-slate-100 dark:bg-slate-500 rounded" />
</div>
<div class="space-y-2 animate-pulse ">
<div class="space-y-2 animate-pulse">
<div class="h-4 bg-slate-100 dark:bg-slate-500 rounded w-1/5" />
</div>
</div>

View File

@@ -1,6 +1,6 @@
<template>
<li
class="py-1 flex items-center justify-between -mx-1 px-1 hover:bg-slate-25 dark:hover:bg-slate-600 rounded cursor-pointer text-slate-700 dark:text-slate-50 dark:hover:text-slate-25 hover:text-slate-900 "
class="py-1 flex items-center justify-between -mx-1 px-1 hover:bg-slate-25 dark:hover:bg-slate-600 rounded cursor-pointer text-slate-700 dark:text-slate-50 dark:hover:text-slate-25 hover:text-slate-900"
role="button"
@click="onClick"
>

View File

@@ -28,10 +28,8 @@
>
<span v-dompurify-html="title" class="mr-1" />
<div
:class="
`h-2 w-2 rounded-full
${isOnline ? 'bg-green-500' : 'hidden'}`
"
:class="`h-2 w-2 rounded-full
${isOnline ? 'bg-green-500' : 'hidden'}`"
/>
</div>
<div

View File

@@ -185,7 +185,9 @@ export default {
border-radius: 7px;
&.is-focused {
box-shadow: 0 0 0 1px $color-woot, 0 0 2px 3px $color-primary-light;
box-shadow:
0 0 0 1px $color-woot,
0 0 2px 3px $color-primary-light;
}
}

View File

@@ -75,7 +75,7 @@
class="text-sm mt-4 justify-center text-center flex"
:class="$dm('text-slate-700', 'dark:text-slate-50')"
>
{{ this.$t('PRE_CHAT_FORM.FIELDS.PHONE_NUMBER.DROPDOWN_EMPTY') }}
{{ $t('PRE_CHAT_FORM.FIELDS.PHONE_NUMBER.DROPDOWN_EMPTY') }}
</span>
</div>
</div>

View File

@@ -3,11 +3,9 @@
<span
v-for="(user, index) in users"
:key="user.id"
:class="
`${
index ? '-ml-4' : ''
} inline-block rounded-full text-white shadow-solid`
"
:class="`${
index ? '-ml-4' : ''
} inline-block rounded-full text-white shadow-solid`"
>
<thumbnail
size="36px"

View File

@@ -3,8 +3,8 @@
<button
v-if="
canLeaveConversation &&
hasEndConversationEnabled &&
showEndConversationButton
hasEndConversationEnabled &&
showEndConversationButton
"
class="button transparent compact"
:title="$t('END_CONVERSATION')"
@@ -18,7 +18,7 @@
</button>
<button
v-if="showPopoutButton"
class="button transparent compact new-window--button "
class="button transparent compact new-window--button"
@click="popoutWindow"
>
<fluent-icon

View File

@@ -1,6 +1,6 @@
<template>
<div class="p-4 shadow-sm rounded-md bg-white dark:bg-slate-700">
<div class="flex items-center justify-between ">
<div class="flex items-center justify-between">
<div class=" ">
<div class="text-sm font-medium text-slate-700 dark:text-slate-50">
{{

View File

@@ -65,11 +65,10 @@ export default {
async joinTheCall() {
this.isLoading = true;
try {
const {
data: { authResponse: { authToken = '' } = {} } = {},
} = await IntegrationAPIClient.addParticipantToDyteMeeting(
this.messageId
);
const { data: { authResponse: { authToken = '' } = {} } = {} } =
await IntegrationAPIClient.addParticipantToDyteMeeting(
this.messageId
);
this.dyteAuthToken = authToken;
} catch (error) {
// Ignore Error for now

View File

@@ -32,9 +32,8 @@ export const shouldTriggerMessageUpdateEvent = message => {
if (!previousChanges) {
return false;
}
const hasNotifiableAttributeChanges = Object.keys(previousChanges).includes(
'content_attributes'
);
const hasNotifiableAttributeChanges =
Object.keys(previousChanges).includes('content_attributes');
if (!hasNotifiableAttributeChanges) {
return false;
}

View File

@@ -84,15 +84,16 @@ class ActionCableConnector extends BaseActionCableConnector {
this.app.$store.dispatch('agent/updatePresence', data.users);
};
// eslint-disable-next-line class-methods-use-this
onContactMerge = data => {
const { pubsub_token: pubsubToken } = data;
ActionCableConnector.refreshConnector(pubsubToken);
};
onTypingOn = data => {
const activeConversationId = this.app.$store.getters[
'conversationAttributes/getConversationParams'
].id;
const activeConversationId =
this.app.$store.getters['conversationAttributes/getConversationParams']
.id;
const isUserTypingOnAnotherConversation =
data.conversation && data.conversation.id !== activeConversationId;

View File

@@ -11,14 +11,12 @@ describe('#IFrameHelper', () => {
it('returns if the event is valid', () => {
expect(
IFrameHelper.isAValidEvent({
data:
'chatwoot-widget:{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
data: 'chatwoot-widget:{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
})
).toEqual(true);
expect(
IFrameHelper.isAValidEvent({
data:
'{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
data: '{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
})
).toEqual(false);
});
@@ -27,8 +25,7 @@ describe('#IFrameHelper', () => {
it('returns parsed message', () => {
expect(
IFrameHelper.getMessage({
data:
'chatwoot-widget:{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
data: 'chatwoot-widget:{"event":"config-set","locale":"fr","position":"left","hideMessageBubble":false,"showPopoutButton":true}',
})
).toEqual({
event: 'config-set',

View File

@@ -271,10 +271,8 @@ describe('nextAvailabilityTimeMixin', () => {
'Friday',
'Saturday',
];
const {
open_hour: openHour,
open_minutes: openMinute,
} = wrapper.vm.nextDayWorkingHours;
const { open_hour: openHour, open_minutes: openMinute } =
wrapper.vm.nextDayWorkingHours;
expect(wrapper.vm.nextDayTimings).toEqual({
openHour,
@@ -359,11 +357,12 @@ describe('nextAvailabilityTimeMixin', () => {
chatwootWebChannel.workingHours[
wrapper.vm.currentDay === 6 ? 0 : wrapper.vm.currentDay + 1
].open_minutes;
const expectedHoursAndMinutes = wrapper.vm.getHoursAndMinutesUntilNextDayOpen(
nextDayOpenHour,
nextDayOpenMinute,
currentDayCloseHour
);
const expectedHoursAndMinutes =
wrapper.vm.getHoursAndMinutesUntilNextDayOpen(
nextDayOpenHour,
nextDayOpenMinute,
currentDayCloseHour
);
expect(wrapper.vm.hoursAndMinutesBackInOnline).toEqual(
expectedHoursAndMinutes
);

View File

@@ -223,7 +223,7 @@ describe('#actions', () => {
const state = {
uiFlags: { allMessagesLoaded: false },
conversations: {
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -232,7 +232,7 @@ describe('#actions', () => {
created_at: 1682244355, // Sunday, 23 April 2023 10:05:55
conversation_id: 20,
},
'463': {
463: {
id: 463,
content: 'ss',
message_type: 0,
@@ -269,7 +269,7 @@ describe('#actions', () => {
'setMissingMessagesInConversation',
{
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -278,7 +278,7 @@ describe('#actions', () => {
created_at: 1682244355,
conversation_id: 20,
},
'463': {
463: {
id: 463,
content: 'ss',
message_type: 0,
@@ -287,7 +287,7 @@ describe('#actions', () => {
created_at: 1682490729,
conversation_id: 20,
},
'465': {
465: {
id: 465,
content: 'hi',
message_type: 0,
@@ -305,7 +305,7 @@ describe('#actions', () => {
const state = {
uiFlags: { allMessagesLoaded: false },
conversations: {
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -314,7 +314,7 @@ describe('#actions', () => {
created_at: 1682244355, // Sunday, 23 April 2023 10:05:55
conversation_id: 20,
},
'463': {
463: {
id: 463,
content: 'ss',
message_type: 0,
@@ -352,7 +352,7 @@ describe('#actions', () => {
'setMissingMessagesInConversation',
{
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -361,7 +361,7 @@ describe('#actions', () => {
created_at: 1682244355,
conversation_id: 20,
},
'460': {
460: {
id: 460,
content: 'Hi how are you',
message_type: 0,
@@ -370,7 +370,7 @@ describe('#actions', () => {
created_at: 1682417926,
conversation_id: 20,
},
'463': {
463: {
id: 463,
content: 'ss',
message_type: 0,
@@ -388,7 +388,7 @@ describe('#actions', () => {
const state = {
uiFlags: { allMessagesLoaded: false },
conversation: {
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -397,7 +397,7 @@ describe('#actions', () => {
created_at: 1682244355, // Sunday, 23 April 2023 10:05:55
conversation_id: 20,
},
'463': {
463: {
id: 463,
content: 'ss',
message_type: 0,

View File

@@ -189,7 +189,7 @@ describe('#mutations', () => {
const state = {
uiFlags: { allMessagesLoaded: false },
conversations: {
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -198,7 +198,7 @@ describe('#mutations', () => {
created_at: 1682432667,
conversation_id: 20,
},
'464': {
464: {
id: 464,
content: 'hey will be back soon',
message_type: 3,
@@ -221,7 +221,7 @@ describe('#mutations', () => {
},
]);
expect(state.conversations).toEqual({
'454': {
454: {
id: 454,
content: 'hi',
message_type: 0,
@@ -230,7 +230,7 @@ describe('#mutations', () => {
created_at: 1682432667,
conversation_id: 20,
},
'455': {
455: {
id: 455,
content: 'Hey billowing-grass-423 how are you?',
message_type: 3,
@@ -239,7 +239,7 @@ describe('#mutations', () => {
created_at: 1682432667,
conversation_id: 20,
},
'464': {
464: {
id: 464,
content: 'hey will be back soon',
message_type: 3,

View File

@@ -16,8 +16,8 @@
<article-hero
v-if="
!articleUiFlags.isFetching &&
!articleUiFlags.isError &&
popularArticles.length
!articleUiFlags.isError &&
popularArticles.length
"
:articles="popularArticles"
@view="openArticleInArticleViewer"
@@ -84,10 +84,8 @@ export default {
},
defaultLocale() {
const widgetLocale = this.widgetLocale;
const {
allowed_locales: allowedLocales,
default_locale: defaultLocale,
} = this.portal.config;
const { allowed_locales: allowedLocales, default_locale: defaultLocale } =
this.portal.config;
// IMPORTANT: Variation strict locale matching, Follow iso_639_1_code
// If the exact match of a locale is available in the list of portal locales, return it