From f46c4b51302345192caca4140b13715128504698 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Mon, 8 Feb 2021 12:50:11 +0530 Subject: [PATCH] chore: Minor Changes to Bot Message APIs (#1739) --- app/presenters/conversations/event_data_presenter.rb | 1 + lib/woot_message_seeder.rb | 3 +++ spec/models/conversation_spec.rb | 1 + spec/presenters/conversations/event_data_presenter_spec.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/app/presenters/conversations/event_data_presenter.rb b/app/presenters/conversations/event_data_presenter.rb index 4a658c4c8..1e3ff66ae 100644 --- a/app/presenters/conversations/event_data_presenter.rb +++ b/app/presenters/conversations/event_data_presenter.rb @@ -10,6 +10,7 @@ class Conversations::EventDataPresenter < SimpleDelegator channel: inbox.try(:channel_type), id: display_id, inbox_id: inbox_id, + contact_inbox: contact_inbox, messages: push_messages, meta: push_meta, status: status, diff --git a/lib/woot_message_seeder.rb b/lib/woot_message_seeder.rb index fbd99bb99..728b60019 100644 --- a/lib/woot_message_seeder.rb +++ b/lib/woot_message_seeder.rb @@ -17,8 +17,10 @@ module WootMessageSeeder conversation: conversation, message_type: :template, content_type: 'cards', + content: 'cards', content_attributes: { items: [ + sample_card_item, sample_card_item ] } @@ -71,6 +73,7 @@ module WootMessageSeeder conversation: conversation, message_type: :template, content_type: 'form', + content: 'form', content_attributes: { "items": [ { "name": 'email', "placeholder": 'Please enter your email', "type": 'email', "label": 'Email' }, diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb index e8c8984c7..806b159a4 100644 --- a/spec/models/conversation_spec.rb +++ b/spec/models/conversation_spec.rb @@ -445,6 +445,7 @@ RSpec.describe Conversation, type: :model do messages: [], inbox_id: conversation.inbox_id, status: conversation.status, + contact_inbox: conversation.contact_inbox, timestamp: conversation.last_activity_at.to_i, can_reply: true, channel: 'Channel::WebWidget', diff --git a/spec/presenters/conversations/event_data_presenter_spec.rb b/spec/presenters/conversations/event_data_presenter_spec.rb index 487545906..e79ba41ab 100644 --- a/spec/presenters/conversations/event_data_presenter_spec.rb +++ b/spec/presenters/conversations/event_data_presenter_spec.rb @@ -22,6 +22,7 @@ RSpec.describe Conversations::EventDataPresenter do messages: [], inbox_id: conversation.inbox_id, status: conversation.status, + contact_inbox: conversation.contact_inbox, can_reply: conversation.can_reply?, channel: conversation.inbox.channel_type, timestamp: conversation.last_activity_at.to_i,