diff --git a/.circleci/config.yml b/.circleci/config.yml index e287574e9..f758b5492 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -157,7 +157,7 @@ jobs: - run: name: Code Climate Test Coverage command: | - ~/tmp/cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.frontend_$CIRCLE_NODE_INDEX.json buildreports/lcov.info + ~/tmp/cc-test-reporter format-coverage -t lcov -o "coverage/codeclimate.frontend_$CIRCLE_NODE_INDEX.json" - persist_to_workspace: root: coverage diff --git a/app/controllers/api/v1/accounts/contacts/contact_inboxes_controller.rb b/app/controllers/api/v1/accounts/contacts/contact_inboxes_controller.rb index b4287ae08..d985c8a73 100644 --- a/app/controllers/api/v1/accounts/contacts/contact_inboxes_controller.rb +++ b/app/controllers/api/v1/accounts/contacts/contact_inboxes_controller.rb @@ -1,11 +1,13 @@ class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts::Contacts::BaseController + include HmacConcern before_action :ensure_inbox, only: [:create] def create @contact_inbox = ContactInboxBuilder.new( contact: @contact, inbox: @inbox, - source_id: params[:source_id] + source_id: params[:source_id], + hmac_verified: hmac_verified? ).perform end diff --git a/app/controllers/api/v1/accounts/conversations_controller.rb b/app/controllers/api/v1/accounts/conversations_controller.rb index 1f3fbae0b..cd8547213 100644 --- a/app/controllers/api/v1/accounts/conversations_controller.rb +++ b/app/controllers/api/v1/accounts/conversations_controller.rb @@ -1,6 +1,7 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseController include Events::Types include DateRangeHelper + include HmacConcern before_action :conversation, except: [:index, :meta, :search, :create, :filter] before_action :inbox, :contact, :contact_inbox, only: [:create] @@ -104,9 +105,6 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro end def set_conversation_status - # TODO: temporary fallback for the old bot status in conversation, we will remove after couple of releases - # commenting this out to see if there are any errors, if not we can remove this in subsequent releases - # status = params[:status] == 'bot' ? 'pending' : params[:status] @conversation.status = params[:status] @conversation.snoozed_until = parse_date_time(params[:snoozed_until].to_s) if params[:snoozed_until] end @@ -152,7 +150,8 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro ContactInboxBuilder.new( contact: @contact, inbox: @inbox, - source_id: params[:source_id] + source_id: params[:source_id], + hmac_verified: hmac_verified? ).perform end diff --git a/app/controllers/concerns/hmac_concern.rb b/app/controllers/concerns/hmac_concern.rb new file mode 100644 index 000000000..abc55a394 --- /dev/null +++ b/app/controllers/concerns/hmac_concern.rb @@ -0,0 +1,5 @@ +module HmacConcern + def hmac_verified? + ActiveModel::Type::Boolean.new.cast(params[:hmac_verified]).present? + end +end diff --git a/app/controllers/super_admin/accounts_controller.rb b/app/controllers/super_admin/accounts_controller.rb index 6a5fb0fdc..5de25f677 100644 --- a/app/controllers/super_admin/accounts_controller.rb +++ b/app/controllers/super_admin/accounts_controller.rb @@ -50,6 +50,13 @@ class SuperAdmin::AccountsController < SuperAdmin::ApplicationController # rubocop:enable Rails/I18nLocaleTexts end + def reset_cache + requested_resource.reset_cache_keys + # rubocop:disable Rails/I18nLocaleTexts + redirect_back(fallback_location: [namespace, requested_resource], notice: 'Cache keys cleared') + # rubocop:enable Rails/I18nLocaleTexts + end + def destroy account = Account.find(params[:id]) diff --git a/app/javascript/dashboard/i18n/locale/en/auditLogs.json b/app/javascript/dashboard/i18n/locale/en/auditLogs.json index e288e2959..a2bb40135 100644 --- a/app/javascript/dashboard/i18n/locale/en/auditLogs.json +++ b/app/javascript/dashboard/i18n/locale/en/auditLogs.json @@ -10,15 +10,22 @@ "TITLE": "Manage Audit Logs", "DESC": "Audit Logs are trails for events and actions in a Chatwoot System.", "TABLE_HEADER": [ - "User", - "Action", - "IP Address", - "Time" + "Activity", + "Time", + "IP Address" ] }, "API": { "SUCCESS_MESSAGE": "AuditLogs retrieved successfully", "ERROR_MESSAGE": "Could not connect to Woot Server, Please try again later" + }, + "ACTION": { + "ADD": "created", + "EDIT": "updated", + "DELETE": "deleted", + "SIGN_IN": "signed in", + "SIGN_OUT": "signed out", + "SYSTEM": "System" } } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/auditlogs/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/auditlogs/Index.vue index 63856b6d8..f11bbb6f4 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/auditlogs/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/auditlogs/Index.vue @@ -1,8 +1,8 @@