diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index c610dc846..4d675593f 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -92,7 +92,7 @@ class Api::V1::AccountsController < Api::BaseController end def settings_params - params.permit(:auto_resolve_after, :auto_resolve_message, :auto_resolve_ignore_waiting) + params.permit(:auto_resolve_after, :auto_resolve_message, :auto_resolve_ignore_waiting, :auto_resolve_label) end def check_signup_enabled diff --git a/app/javascript/dashboard/components-next/filter/inputs/FilterSelect.vue b/app/javascript/dashboard/components-next/filter/inputs/FilterSelect.vue index 9f71a8361..2c4d0b01f 100644 --- a/app/javascript/dashboard/components-next/filter/inputs/FilterSelect.vue +++ b/app/javascript/dashboard/components-next/filter/inputs/FilterSelect.vue @@ -74,6 +74,7 @@ const updateSelected = newValue => { @@ -87,7 +121,7 @@ const toggleSelected = option => { v-model="searchTerm" autofocus class="p-1.5 pl-8 text-n-slate-11 bg-n-alpha-1 rounded-lg w-full" - :placeholder="t('COMBOBOX.SEARCH_PLACEHOLDER')" + :placeholder="searchPlaceholder || t('COMBOBOX.SEARCH_PLACEHOLDER')" /> diff --git a/app/javascript/dashboard/components-next/input/DurationInput.vue b/app/javascript/dashboard/components-next/input/DurationInput.vue index 15c6d102a..802e1d500 100644 --- a/app/javascript/dashboard/components-next/input/DurationInput.vue +++ b/app/javascript/dashboard/components-next/input/DurationInput.vue @@ -1,7 +1,8 @@ diff --git a/app/javascript/dashboard/components-next/input/constants.js b/app/javascript/dashboard/components-next/input/constants.js new file mode 100644 index 000000000..b8ed1d4a2 --- /dev/null +++ b/app/javascript/dashboard/components-next/input/constants.js @@ -0,0 +1,5 @@ +export const DURATION_UNITS = { + MINUTES: 'minutes', + HOURS: 'hours', + DAYS: 'days', +}; diff --git a/app/javascript/dashboard/composables/useAccount.js b/app/javascript/dashboard/composables/useAccount.js index 9a2ba012b..5a8441d33 100644 --- a/app/javascript/dashboard/composables/useAccount.js +++ b/app/javascript/dashboard/composables/useAccount.js @@ -45,9 +45,10 @@ export function useAccount() { }; }; - const updateAccount = async data => { + const updateAccount = async (data, options) => { await store.dispatch('accounts/update', { ...data, + options, }); }; diff --git a/app/javascript/dashboard/i18n/locale/en/generalSettings.json b/app/javascript/dashboard/i18n/locale/en/generalSettings.json index 7da76df18..d243c0583 100644 --- a/app/javascript/dashboard/i18n/locale/en/generalSettings.json +++ b/app/javascript/dashboard/i18n/locale/en/generalSettings.json @@ -46,7 +46,31 @@ }, "AUTO_RESOLVE": { "TITLE": "Auto-resolve conversations", - "NOTE": "This configuration would allow you to automatically resolve the conversation after a certain period. Set the duration and customize the message to the user below." + "NOTE": "This configuration would allow you to automatically resolve the conversation after a certain period of inactivity.", + "DURATION": { + "LABEL": "Inactivity duration", + "HELP": "Time period of inactivity after which conversation is auto-resolved", + "PLACEHOLDER": "30", + "ERROR": "Auto resolve duration should be between 10 minutes and 999 days", + "API": { + "SUCCESS": "Auto resolve settings updated successfully", + "ERROR": "Failed to update auto resolve settings" + } + }, + "MESSAGE": { + "LABEL": "Custom auto-resolution message", + "PLACEHOLDER": "Conversation was marked resolved by system due to 15 days of inactivity", + "HELP": "Message sent to the customer after conversation is auto-resolved" + }, + "PREFERENCES": "Preferences", + "LABEL": { + "LABEL": "Add label after auto-resolution", + "PLACEHOLDER": "Select a label" + }, + "IGNORE_WAITING": { + "LABEL": "Skip conversations waiting for agent’s reply" + }, + "UPDATE_BUTTON": "Save Changes" }, "NAME": { "LABEL": "Account name", @@ -68,24 +92,6 @@ "PLACEHOLDER": "Your company's support email", "ERROR": "" }, - "AUTO_RESOLVE_IGNORE_WAITING": { - "LABEL": "Exclude unattended conversations", - "HELP": "When enabled, the system will skip resolving conversations that are still waiting for an agent’s reply." - }, - "AUTO_RESOLVE_DURATION": { - "LABEL": "Inactivity duration for resolution", - "HELP": "Duration after a conversation should auto resolve if there is no activity", - "PLACEHOLDER": "30", - "ERROR": "Auto resolve duration should be between 10 minutes and 999 days", - "API": { - "SUCCESS": "Auto resolve settings updated successfully", - "ERROR": "Failed to update auto resolve settings" - }, - "UPDATE_BUTTON": "Update", - "MESSAGE_LABEL": "Custom resolution message", - "MESSAGE_PLACEHOLDER": "Conversation was marked resolved by system due to 15 days of inactivity", - "MESSAGE_HELP": "This message is sent to the customer when a conversation is automatically resolved by the system due to inactivity." - }, "FEATURES": { "INBOUND_EMAIL_ENABLED": "Conversation continuity with emails is enabled for your account.", "CUSTOM_EMAIL_DOMAIN_ENABLED": "You can receive emails in your custom domain now." diff --git a/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoResolve.vue b/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoResolve.vue index 9816fc7e0..881ccb0e8 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoResolve.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoResolve.vue @@ -1,35 +1,78 @@