Bug fixes and Code Climate issue fix
This commit is contained in:
parent
123b5a7e6a
commit
fe2bf47fce
2 changed files with 28 additions and 27 deletions
|
@ -218,6 +218,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.allCustomAttributes = this.$store.getters['attributes/getAttributes'];
|
||||||
this.manifestCustomAttributes();
|
this.manifestCustomAttributes();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -123,11 +123,8 @@ export default {
|
||||||
},
|
},
|
||||||
getConditionDropdownValues(type) {
|
getConditionDropdownValues(type) {
|
||||||
const statusFilters = this.$t('CHAT_LIST.CHAT_STATUS_FILTER_ITEMS');
|
const statusFilters = this.$t('CHAT_LIST.CHAT_STATUS_FILTER_ITEMS');
|
||||||
const allCustomAttributes = this.$store.getters[
|
|
||||||
'attributes/getAttributes'
|
|
||||||
];
|
|
||||||
|
|
||||||
const isCustomAttributeCheckbox = allCustomAttributes.find(attr => {
|
const isCustomAttributeCheckbox = this.allCustomAttributes.find(attr => {
|
||||||
return (
|
return (
|
||||||
attr.attribute_key === type &&
|
attr.attribute_key === type &&
|
||||||
attr.attribute_display_type === 'checkbox'
|
attr.attribute_display_type === 'checkbox'
|
||||||
|
@ -146,14 +143,13 @@ export default {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
const isCustomAttributeList = allCustomAttributes.find(attr => {
|
const isCustomAttributeList = this.allCustomAttributes.find(attr => {
|
||||||
return (
|
return (
|
||||||
attr.attribute_key === type && attr.attribute_display_type === 'list'
|
attr.attribute_key === type && attr.attribute_display_type === 'list'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isCustomAttributeList) {
|
if (isCustomAttributeList) {
|
||||||
return allCustomAttributes
|
return this.allCustomAttributes
|
||||||
.find(attr => attr.attribute_key === type)
|
.find(attr => attr.attribute_key === type)
|
||||||
.attribute_values.map(item => {
|
.attribute_values.map(item => {
|
||||||
return {
|
return {
|
||||||
|
@ -162,7 +158,6 @@ export default {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'status':
|
case 'status':
|
||||||
return [
|
return [
|
||||||
|
@ -331,7 +326,7 @@ export default {
|
||||||
].conditions.find(item => item.key === condition.attribute_key)
|
].conditions.find(item => item.key === condition.attribute_key)
|
||||||
.inputType;
|
.inputType;
|
||||||
}
|
}
|
||||||
if (inputType === 'plain_text') {
|
if (inputType === 'plain_text' || inputType === 'date') {
|
||||||
return {
|
return {
|
||||||
...condition,
|
...condition,
|
||||||
values: condition.values[0],
|
values: condition.values[0],
|
||||||
|
@ -346,10 +341,8 @@ export default {
|
||||||
});
|
});
|
||||||
return conditions;
|
return conditions;
|
||||||
},
|
},
|
||||||
manifestActions(automation) {
|
generateActionsArray(action) {
|
||||||
const actions = automation.actions.map(action => {
|
|
||||||
let actionParams = [];
|
let actionParams = [];
|
||||||
if (action.action_params.length) {
|
|
||||||
const inputType = this.automationActionTypes.find(
|
const inputType = this.automationActionTypes.find(
|
||||||
item => item.key === action.action_name
|
item => item.key === action.action_name
|
||||||
).inputType;
|
).inputType;
|
||||||
|
@ -367,6 +360,13 @@ export default {
|
||||||
message: action.action_params[0].message,
|
message: action.action_params[0].message,
|
||||||
};
|
};
|
||||||
} else actionParams = [...action.action_params];
|
} else actionParams = [...action.action_params];
|
||||||
|
return actionParams;
|
||||||
|
},
|
||||||
|
manifestActions(automation) {
|
||||||
|
let actionParams = [];
|
||||||
|
const actions = automation.actions.map(action => {
|
||||||
|
if (action.action_params.length) {
|
||||||
|
actionParams = this.generateActionsArray(action);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...action,
|
...action,
|
||||||
|
|
Loading…
Reference in a new issue