Merge branch 'develop' into feat/support-variables-in-message

This commit is contained in:
Muhsin Keloth 2022-12-16 00:03:29 +05:30 committed by GitHub
commit c4682eb57c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 19 deletions

View file

@ -60,15 +60,11 @@ export const getFormattedPreChatFields = ({ preChatFields }) => {
return {
...item,
label: getLabel({
key: standardFieldKeys[item.name]
? standardFieldKeys[item.name].key
: item.name,
key: item.name,
label: item.label ? item.label : item.name,
}),
placeholder: getPlaceHolder({
key: standardFieldKeys[item.name]
? standardFieldKeys[item.name].key
: item.name,
key: item.name,
placeholder: item.placeholder ? item.placeholder : item.name,
}),
};

View file

@ -43,7 +43,6 @@
<script>
import draggable from 'vuedraggable';
import { standardFieldKeys } from 'dashboard/helper/preChat';
export default {
components: { draggable },
props: {
@ -64,7 +63,7 @@ export default {
},
methods: {
isFieldEditable(item) {
return !!standardFieldKeys[item.name] || !item.enabled;
return !item.enabled;
},
handlePreChatFieldOptions(event, type, item) {
this.$emit('update', event, type, item);

View file

@ -37,6 +37,9 @@
:label="$t('PRE_CHAT_FORM.FIELDS.MESSAGE.LABEL')"
:placeholder="$t('PRE_CHAT_FORM.FIELDS.MESSAGE.PLACEHOLDER')"
validation="required"
:validation-messages="{
required: $t('PRE_CHAT_FORM.FIELDS.MESSAGE.ERROR'),
}"
/>
<custom-button
@ -208,14 +211,10 @@ export default {
isContactFieldRequired(field) {
return this.preChatFields.find(option => option.name === field).required;
},
getLabel({ name, label }) {
if (this.labels[name])
return this.$t(`PRE_CHAT_FORM.FIELDS.${this.labels[name]}.LABEL`);
getLabel({ label }) {
return label;
},
getPlaceHolder({ name, placeholder }) {
if (this.labels[name])
return this.$t(`PRE_CHAT_FORM.FIELDS.${this.labels[name]}.PLACEHOLDER`);
getPlaceHolder({ placeholder }) {
return placeholder;
},
getValue({ name, type }) {
@ -226,11 +225,7 @@ export default {
return this.formValues[name] || null;
},
getRequiredErrorMessage({ name, label }) {
if (this.labels[name])
return this.$t(
`PRE_CHAT_FORM.FIELDS.${this.labels[name]}.REQUIRED_ERROR`
);
getRequiredErrorMessage({ label }) {
return `${label} ${this.$t('PRE_CHAT_FORM.IS_REQUIRED')}`;
},
getValidation({ type, name }) {