diff --git a/app/controllers/api/v1/widget/messages_controller.rb b/app/controllers/api/v1/widget/messages_controller.rb index 69a84e31b..ae6ae7902 100644 --- a/app/controllers/api/v1/widget/messages_controller.rb +++ b/app/controllers/api/v1/widget/messages_controller.rb @@ -38,7 +38,9 @@ class Api::V1::Widget::MessagesController < ActionController::Base inbox_id: inbox.id, contact_id: cookie_params[:contact_id], additional_attributes: { - browser: browser_params + browser: browser_params, + referer: permitted_params[:message][:referer_url], + initiated_at: timestamp_params } } end @@ -53,6 +55,12 @@ class Api::V1::Widget::MessagesController < ActionController::Base } end + def timestamp_params + { + timestamp: permitted_params[:message][:timestamp] + } + end + def inbox @inbox ||= ::Inbox.find_by(id: cookie_params[:inbox_id]) end @@ -79,7 +87,7 @@ class Api::V1::Widget::MessagesController < ActionController::Base end def permitted_params - params.permit(:before, message: [:content]) + params.permit(:before, message: [:content, :referer_url, :timestamp]) end def secret_key diff --git a/app/javascript/dashboard/api/contacts.js b/app/javascript/dashboard/api/contacts.js new file mode 100644 index 000000000..2addd9ce1 --- /dev/null +++ b/app/javascript/dashboard/api/contacts.js @@ -0,0 +1,9 @@ +import ApiClient from './ApiClient'; + +class ContactAPI extends ApiClient { + constructor() { + super('contacts'); + } +} + +export default new ContactAPI(); diff --git a/app/javascript/dashboard/assets/scss/_mixins.scss b/app/javascript/dashboard/assets/scss/_mixins.scss index 0b7a73c2c..c0cf98494 100644 --- a/app/javascript/dashboard/assets/scss/_mixins.scss +++ b/app/javascript/dashboard/assets/scss/_mixins.scss @@ -217,3 +217,9 @@ border-left: $size solid transparent; } } + +@mixin text-ellipsis { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue index 39b13c579..1c4c0c869 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue @@ -8,7 +8,7 @@ :username="chat.meta.sender.name" />