Merge remote-tracking branch 'origin/feat/support-pdf-upload-faq-gen' into test-pdf-support-captain

This commit is contained in:
Tanmay Deep Sharma
2025-07-08 18:34:36 +07:00
20 changed files with 173 additions and 113 deletions
@@ -40,8 +40,6 @@ export default {
regexPattern: null,
regexCue: null,
regexEnabled: false,
models: ATTRIBUTE_MODELS,
types: ATTRIBUTE_TYPES,
values: [],
options: [],
show: true,
@@ -53,6 +51,18 @@ export default {
...mapGetters({
uiFlags: 'getUIFlags',
}),
models() {
return ATTRIBUTE_MODELS.map(item => ({
...item,
option: this.$t(`ATTRIBUTES_MGMT.ATTRIBUTE_MODELS.${item.key}`),
}));
},
types() {
return ATTRIBUTE_TYPES.map(item => ({
...item,
option: this.$t(`ATTRIBUTES_MGMT.ATTRIBUTE_TYPES.${item.key}`),
}));
},
isMultiselectInvalid() {
return this.isTouched && this.values.length === 0;
},
@@ -113,7 +113,11 @@ const tableHeaders = computed(() => {
<td
class="py-4 ltr:pr-4 rtl:pl-4 overflow-hidden whitespace-nowrap text-ellipsis"
>
{{ attribute.attribute_display_type }}
{{
$t(
`ATTRIBUTES_MGMT.ATTRIBUTE_TYPES.${attribute.attribute_display_type?.toUpperCase()}`
)
}}
</td>
<td
class="py-4 ltr:pr-4 rtl:pl-4 attribute-key overflow-hidden whitespace-nowrap text-ellipsis"
@@ -32,7 +32,6 @@ export default {
regexPattern: null,
regexCue: null,
regexEnabled: false,
types: ATTRIBUTE_TYPES,
show: true,
attributeKey: '',
values: [],
@@ -59,6 +58,12 @@ export default {
},
},
computed: {
types() {
return ATTRIBUTE_TYPES.map(item => ({
...item,
option: this.$t(`ATTRIBUTES_MGMT.ATTRIBUTE_TYPES.${item.key}`),
}));
},
setAttributeListValue() {
return this.selectedAttribute.attribute_values.map(values => ({
name: values,
@@ -84,9 +89,9 @@ export default {
selectedAttributeType() {
return this.types.find(
item =>
item.option.toLowerCase() ===
item.key.toLowerCase() ===
this.selectedAttribute.attribute_display_type
).id;
)?.id;
},
keyErrorMessage() {
if (!this.v$.attributeKey.isKey) {
@@ -1,37 +1,13 @@
export const ATTRIBUTE_MODELS = [
{
id: 0,
option: 'Conversation',
},
{
id: 1,
option: 'Contact',
},
{ id: 0, key: 'CONVERSATION' },
{ id: 1, key: 'CONTACT' },
];
export const ATTRIBUTE_TYPES = [
{
id: 0,
option: 'Text',
},
{
id: 1,
option: 'Number',
},
{
id: 4,
option: 'Link',
},
{
id: 5,
option: 'Date',
},
{
id: 6,
option: 'List',
},
{
id: 7,
option: 'Checkbox',
},
{ id: 0, key: 'TEXT' },
{ id: 1, key: 'NUMBER' },
{ id: 4, key: 'LINK' },
{ id: 5, key: 'DATE' },
{ id: 6, key: 'LIST' },
{ id: 7, key: 'CHECKBOX' },
];