Merge branch 'develop' into feat/setup-eslint-rules

This commit is contained in:
iamsivin
2024-07-31 00:21:16 +05:30
9 changed files with 30 additions and 21 deletions
@@ -194,9 +194,9 @@ export default {
</script>
<template>
<div class="px-4 py-3">
<div class="py-3 px-4">
<div class="flex items-center mb-1">
<h4 class="flex items-center w-full m-0 text-sm error">
<h4 class="text-sm flex items-center m-0 w-full error">
<div v-if="isAttributeTypeCheckbox" class="flex items-center">
<input
v-model="editedValue"
@@ -236,7 +236,7 @@ export default {
</div>
<div v-if="notAttributeTypeCheckboxAndList">
<div v-if="isEditing" v-on-clickaway="onClickAway">
<div class="flex items-center w-full mb-2">
<div class="mb-2 w-full flex items-center">
<input
ref="inputfield"
v-model="editedValue"
@@ -258,7 +258,7 @@ export default {
</div>
<span
v-if="shouldShowErrorMessage"
class="block w-full -mt-px text-sm font-normal text-red-400 dark:text-red-500"
class="text-red-400 dark:text-red-500 text-sm block font-normal -mt-px w-full"
>
{{ errorMessage }}
</span>
@@ -16,7 +16,7 @@ export const ATLEAST_ONE_ACTION_REQUIRED = 'ATLEAST_ONE_ACTION_REQUIRED';
* @param {Object} filter - The filter object to validate.
* @param {string} filter.attribute_key - The key of the attribute to filter on.
* @param {string} filter.filter_operator - The operator to use for filtering.
* @param {string|number} [filter.values] - The value(s) to filter by (required for most operators).
* @param {string|number|Array} [filter.values] - The value(s) to filter by (required for most operators).
*
* @returns {string|null} An error message if validation fails, or null if validation passes.
*/
@@ -32,7 +32,8 @@ const validateSingleFilter = filter => {
if (
filter.filter_operator !== 'is_present' &&
filter.filter_operator !== 'is_not_present' &&
!filter.values
(!filter.values ||
(Array.isArray(filter.values) && filter.values.length === 0))
) {
return VALUE_REQUIRED;
}
@@ -200,7 +200,11 @@ export default {
}
.multiselect__tags {
@apply h-[52px];
@apply h-auto;
}
.multiselect__select {
@apply mt-px mr-1;
}
}
</style>
@@ -474,7 +474,7 @@ export default {
v-else-if="hasWhatsappTemplates"
:inbox-id="selectedInbox.inbox.id"
@on-select-template="toggleWaTemplate"
@onSend="onSendWhatsAppReply"
@on-send="onSendWhatsAppReply"
/>
<label v-else :class="{ error: v$.message.$error }">
{{ $t('NEW_CONVERSATION.FORM.MESSAGE.LABEL') }}
@@ -527,7 +527,7 @@ export default {
<AttachmentPreview
class="[&>.preview-item]:dark:bg-slate-700 flex-row flex-wrap gap-x-3 gap-y-1"
:attachments="attachedFiles"
@removeAttachment="removeAttachment"
:remove-attachment="removeAttachment"
/>
</div>
</div>
@@ -140,8 +140,8 @@ export default {
:help-text="$t('HELP_CENTER.CATEGORY.ADD.NAME.HELP_TEXT')"
:has-error="v$.name.$error"
:error-message="$t('HELP_CENTER.CATEGORY.ADD.NAME.ERROR')"
@nameChange="onNameChange"
@iconChange="onClickInsertEmoji"
@name-change="onNameChange"
@icon-change="onClickInsertEmoji"
/>
<woot-input
v-model.trim="slug"
@@ -151,8 +151,8 @@ export default {
:error-message="$t('HELP_CENTER.CATEGORY.ADD.NAME.ERROR')"
:existing-name="category.name"
:saved-icon="category.icon"
@nameChange="changeName"
@iconChange="onClickInsertEmoji"
@name-change="changeName"
@icon-change="onClickInsertEmoji"
/>
<woot-input
v-model.trim="slug"
@@ -3,7 +3,6 @@ import { mapGetters } from 'vuex';
import automationMethodsMixin from 'dashboard/mixins/automations/methodsMixin';
import FilterInputBox from 'dashboard/components/widgets/FilterInput/Index.vue';
import AutomationActionInput from 'dashboard/components/widgets/AutomationActionInput.vue';
// import { useVuelidate } from '@vuelidate/core';
import {
AUTOMATION_RULE_EVENTS,
@@ -392,9 +392,9 @@ export default {
<div class="widget-container w-100 lg:w-3/5">
<InputRadioGroup
name="widget-view-options"
class="text-center"
:items="getWidgetViewOptions"
:action="handleWidgetViewChange"
class="text-center"
/>
<div v-if="isWidgetPreview" class="widget-preview">
<Widget
@@ -60,6 +60,11 @@ export default {
},
},
methods: {
removeObjectProperty(obj, keyToRemove) {
return Object.fromEntries(
Object.entries(obj).filter(([key]) => key !== keyToRemove)
);
},
updateName(value) {
this.macro.name = value;
},
@@ -73,9 +78,9 @@ export default {
});
},
deleteNode(index) {
// delete that index specifically
// remove that index specifically
// so that the next item does not get marked invalid
delete this.errors[`action_${index}`];
this.errors = this.removeObjectProperty(this.errors, `action_${index}`);
this.macro.actions.splice(index, 1);
},
submit() {
@@ -88,9 +93,9 @@ export default {
this.$emit('submit', this.macro);
},
resetNode(index) {
// delete that index specifically
// remove that index specifically
// so that the next item does not get marked invalid
delete this.errors[`action_${index}`];
this.errors = this.removeObjectProperty(this.errors, `action_${index}`);
this.macro.actions[index].action_params = [];
},
resetValidation() {
@@ -102,9 +107,9 @@ export default {
</script>
<template>
<div class="flex flex-col w-full h-auto md:flex-row md:h-full">
<div class="flex flex-col md:flex-row h-auto md:h-full w-full">
<div
class="flex-1 w-full h-full max-h-full px-12 py-4 overflow-y-auto md:w-auto macro-gradient-radial dark:macro-dark-gradient-radial macro-gradient-radial-size"
class="flex-1 w-full md:w-auto macro-gradient-radial dark:macro-dark-gradient-radial macro-gradient-radial-size h-full max-h-full py-4 px-12 overflow-y-auto"
>
<MacroNodes
v-model="macro.actions"