chore: Refactor widget (#5621)
This commit is contained in:
@@ -104,8 +104,7 @@ export default {
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (!this.message.content) return false;
|
||||
return true;
|
||||
return this.message.content;
|
||||
},
|
||||
readableTime() {
|
||||
const { created_at: createdAt = '' } = this.message;
|
||||
|
||||
@@ -54,9 +54,9 @@ export default {
|
||||
},
|
||||
async onFileUpload(file) {
|
||||
if (this.globalConfig.directUploadsEnabled) {
|
||||
this.onDirectFileUpload(file);
|
||||
await this.onDirectFileUpload(file);
|
||||
} else {
|
||||
this.onIndirectFileUpload(file);
|
||||
await this.onIndirectFileUpload(file);
|
||||
}
|
||||
},
|
||||
async onDirectFileUpload(file) {
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
class="flex items-start"
|
||||
:class="[avatarUrl ? 'justify-between' : 'justify-end']"
|
||||
>
|
||||
<img v-if="avatarUrl" class="h-12 rounded-full" :src="avatarUrl" />
|
||||
<img
|
||||
v-if="avatarUrl"
|
||||
class="h-12 rounded-full"
|
||||
:src="avatarUrl"
|
||||
alt="Avatar"
|
||||
/>
|
||||
<header-actions :show-popout-button="showPopoutButton" />
|
||||
</div>
|
||||
<h2
|
||||
|
||||
@@ -209,9 +209,7 @@ export default {
|
||||
min-height: $space-large;
|
||||
max-height: 2.4 * $space-mega;
|
||||
resize: none;
|
||||
padding: 0;
|
||||
padding-top: $space-smaller;
|
||||
padding-bottom: $space-smaller;
|
||||
padding: $space-smaller 0;
|
||||
margin-top: $space-small;
|
||||
margin-bottom: $space-small;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,7 @@ export default {
|
||||
: decodeURI(this.fileName);
|
||||
},
|
||||
fileName() {
|
||||
const filename = this.url.substring(this.url.lastIndexOf('/') + 1);
|
||||
return filename;
|
||||
return this.url.substring(this.url.lastIndexOf('/') + 1);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -118,13 +118,10 @@ export default {
|
||||
const isUserEmailAvailable = !!this.currentUser.email;
|
||||
const isUserPhoneNumberAvailable = !!this.currentUser.phone_number;
|
||||
return this.preChatFields.filter(field => {
|
||||
if (
|
||||
return !(
|
||||
(isUserEmailAvailable && field.name === 'emailAddress') ||
|
||||
(isUserPhoneNumberAvailable && field.name === 'phoneNumber')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
);
|
||||
});
|
||||
},
|
||||
enabledPreChatFields() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
}}
|
||||
</div>
|
||||
<div class="text-xs leading-4 mt-1">
|
||||
{{ replyWaitMeessage }}
|
||||
{{ replyWaitMessage }}
|
||||
</div>
|
||||
</div>
|
||||
<available-agents v-if="isOnline" :agents="availableAgents" />
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
}
|
||||
return anyAgentOnline;
|
||||
},
|
||||
replyWaitMeessage() {
|
||||
replyWaitMessage() {
|
||||
const { workingHoursEnabled } = this.channelConfig;
|
||||
|
||||
if (this.isOnline) {
|
||||
|
||||
@@ -107,13 +107,12 @@ export default {
|
||||
.clear-button {
|
||||
background: transparent;
|
||||
color: $color-woot;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-weight: $font-weight-bold;
|
||||
font-size: $font-size-medium;
|
||||
transition: all 0.3s var(--ease-in-cubic);
|
||||
margin-left: $space-smaller;
|
||||
padding-right: $space-one;
|
||||
padding: 0 $space-one 0 0;
|
||||
|
||||
&:hover {
|
||||
transform: translateX($space-smaller);
|
||||
|
||||
Reference in New Issue
Block a user