From 4aa4e2549f19f2f067e81cfb4e5403fd234fb438 Mon Sep 17 00:00:00 2001 From: Pranav Date: Thu, 22 Aug 2024 16:22:54 +0530 Subject: [PATCH] feat: Update the design for automation (#10002) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the continuation of the design update for the settings screens. In this PR, the automation page is updated with the latest design. - Moved the row to a new component - Migrated both components to composition API. - Order by ID (Earlier this was order by updated_at which was confusing). | Light | Dark | | -- | -- | | Screenshot 2024-08-21 at 9 46 48 PM | Screenshot 2024-08-21 at 9 46 57 PM | --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Shivam Mishra --- .../dashboard/i18n/locale/en/automation.json | 12 +- .../settings/automation/AutomationRuleRow.vue | 79 ++++ .../dashboard/settings/automation/Index.vue | 441 ++++++++---------- .../settings/automation/automation.routes.js | 9 +- .../dashboard/store/modules/automations.js | 2 +- 5 files changed, 298 insertions(+), 245 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleRow.vue diff --git a/app/javascript/dashboard/i18n/locale/en/automation.json b/app/javascript/dashboard/i18n/locale/en/automation.json index a933b1853..83944bd51 100644 --- a/app/javascript/dashboard/i18n/locale/en/automation.json +++ b/app/javascript/dashboard/i18n/locale/en/automation.json @@ -1,9 +1,10 @@ { "AUTOMATION": { - "HEADER": "Automations", + "HEADER": "Automation", + "DESCRIPTION": "Automation can replace and streamline existing processes that require manual effort, such as adding labels and assigning conversations to the most suitable agent. This allows the team to focus on their strengths while reducing time spent on routine tasks.", + "LEARN_MORE": "Learn more about automation", "HEADER_BTN_TXT": "Add Automation Rule", "LOADING": "Fetching automation rules", - "SIDEBAR_TXT": "

Automation Rules

Automation can replace and automate existing processes that require manual effort. You can do many things with automation, including adding labels and assigning conversation to the best agent. So the team focuses on what they do best and spends more little time on manual tasks.

", "ADD": { "TITLE": "Add Automation Rule", "SUBMIT": "Create", @@ -39,7 +40,12 @@ } }, "LIST": { - "TABLE_HEADER": ["Name", "Description", "Active", "Created on"], + "TABLE_HEADER": [ + "Name", + "Description", + "Active", + "Created on" + ], "404": "No automation rules found" }, "DELETE": { diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleRow.vue b/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleRow.vue new file mode 100644 index 000000000..950819193 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleRow.vue @@ -0,0 +1,79 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue index cbd200f09..f637b5c30 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue @@ -1,246 +1,219 @@ - diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/automation.routes.js b/app/javascript/dashboard/routes/dashboard/settings/automation/automation.routes.js index 14b03a45a..39e13bd94 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/automation/automation.routes.js +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/automation.routes.js @@ -1,17 +1,12 @@ import { frontendURL } from '../../../../helper/URLHelper'; -const SettingsContent = () => import('../Wrapper.vue'); +const SettingsWrapper = () => import('../SettingsWrapper.vue'); const Automation = () => import('./Index.vue'); export default { routes: [ { path: frontendURL('accounts/:accountId/settings/automation'), - component: SettingsContent, - props: { - headerTitle: 'AUTOMATION.HEADER', - icon: 'automation', - showNewButton: false, - }, + component: SettingsWrapper, children: [ { path: '', diff --git a/app/javascript/dashboard/store/modules/automations.js b/app/javascript/dashboard/store/modules/automations.js index df3bf6f6a..e36a2f4a4 100644 --- a/app/javascript/dashboard/store/modules/automations.js +++ b/app/javascript/dashboard/store/modules/automations.js @@ -15,7 +15,7 @@ export const state = { export const getters = { getAutomations(_state) { - return _state.records; + return _state.records.sort((a1, a2) => a1.id - a2.id); }, getUIFlags(_state) { return _state.uiFlags;