diff --git a/app/controllers/api/v1/accounts/automation_rules_controller.rb b/app/controllers/api/v1/accounts/automation_rules_controller.rb index 12b7b5957..2dc71bcec 100644 --- a/app/controllers/api/v1/accounts/automation_rules_controller.rb +++ b/app/controllers/api/v1/accounts/automation_rules_controller.rb @@ -3,7 +3,7 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont before_action :fetch_automation_rule, only: [:show, :update, :destroy, :clone] def index - @automation_rules = Current.account.automation_rules.active + @automation_rules = Current.account.automation_rules end def create @@ -32,7 +32,7 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont def automation_rules_permit params.permit( - :name, :description, :event_name, :account_id, + :name, :description, :event_name, :account_id, :active, conditions: [:attribute_key, :filter_operator, :query_operator, { values: [] }], actions: [:action_name, { action_params: [] }] ) diff --git a/app/javascript/dashboard/components/index.js b/app/javascript/dashboard/components/index.js index f737bd313..d2614421c 100644 --- a/app/javascript/dashboard/components/index.js +++ b/app/javascript/dashboard/components/index.js @@ -21,6 +21,7 @@ import SubmitButton from './buttons/FormSubmitButton'; import Tabs from './ui/Tabs/Tabs'; import TabsItem from './ui/Tabs/TabsItem'; import Thumbnail from './widgets/Thumbnail.vue'; +import ConfirmModal from './widgets/modal/ConfirmationModal.vue'; const WootUIKit = { AvatarUploader, @@ -45,6 +46,7 @@ const WootUIKit = { Tabs, TabsItem, Thumbnail, + ConfirmModal, install(Vue) { const keys = Object.keys(this); keys.pop(); // remove 'install' from keys diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue index 3a344d985..ffd8018d5 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue @@ -20,7 +20,8 @@ data-view-component="true" label="Beta" class="beta" - >Beta + > + {{ $t('SIDEBAR.BETA') }} @@ -233,7 +234,7 @@ export default { padding-left: var(--space-smaller) !important; margin-left: var(--space-half) !important; display: inline-block; - font-size: var(--font-size-mini); + font-size: var(--font-size-micro); font-weight: var(--font-weight-medium); line-height: 18px; border: 1px solid transparent; diff --git a/app/javascript/dashboard/components/widgets/modal/ConfirmationModal.vue b/app/javascript/dashboard/components/widgets/modal/ConfirmationModal.vue new file mode 100644 index 000000000..0c1472a84 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/modal/ConfirmationModal.vue @@ -0,0 +1,75 @@ + + diff --git a/app/javascript/dashboard/i18n/locale/en/automation.json b/app/javascript/dashboard/i18n/locale/en/automation.json index ce95b861c..8c92467bd 100644 --- a/app/javascript/dashboard/i18n/locale/en/automation.json +++ b/app/javascript/dashboard/i18n/locale/en/automation.json @@ -90,6 +90,18 @@ }, "ACTION": { "DELETE_MESSAGE": "You need to have atleast one action to save" + }, + "TOGGLE": { + "ACTIVATION_TITLE": "Activate Automation Rule", + "DEACTIVATION_TITLE": "Deactivate Automation Rule", + "ACTIVATION_DESCRIPTION": "This action will activate the automation rule '{automationName}'. Are you sure you want to proceed?", + "DEACTIVATION_DESCRIPTION": "This action will deactivate the automation rule '{automationName}'. Are you sure you want to proceed?", + "ACTIVATION_SUCCESFUL": "Automation Rule Activated Successfully", + "DEACTIVATION_SUCCESFUL": "Automation Rule Deactivated Successfully", + "ACTIVATION_ERROR": "Could not Activate Automation, Please try again later", + "DEACTIVATION_ERROR": "Could not Deactivate Automation, Please try again later", + "CONFIRMATION_LABEL": "Yes", + "CANCEL_LABEL": "No" } } } diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index d353e6b6e..5727e09d0 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -178,7 +178,8 @@ "REPORTS_LABEL": "Labels", "REPORTS_INBOX": "Inbox", "REPORTS_TEAM": "Team", - "SET_AVAILABILITY_TITLE": "Set yourself as" + "SET_AVAILABILITY_TITLE": "Set yourself as", + "BETA": "Beta" }, "CREATE_ACCOUNT": { "NO_ACCOUNT_WARNING": "Uh oh! We could not find any Chatwoot accounts. Please create a new account to continue.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue index be79dd4f5..811fc95c6 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/Index.vue @@ -34,12 +34,19 @@ {{ automation.name }} {{ automation.description }} - - + {{ readableTime(automation.created_on) }} @@ -120,6 +127,11 @@ @saveAutomation="submitAutomation" /> +