chore: Minor Changes to Bot Message APIs (#1739)

This commit is contained in:
Sojan Jose 2021-02-08 12:50:11 +05:30 committed by GitHub
parent 933661b22c
commit f46c4b5130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

View file

@ -10,6 +10,7 @@ class Conversations::EventDataPresenter < SimpleDelegator
channel: inbox.try(:channel_type), channel: inbox.try(:channel_type),
id: display_id, id: display_id,
inbox_id: inbox_id, inbox_id: inbox_id,
contact_inbox: contact_inbox,
messages: push_messages, messages: push_messages,
meta: push_meta, meta: push_meta,
status: status, status: status,

View file

@ -17,8 +17,10 @@ module WootMessageSeeder
conversation: conversation, conversation: conversation,
message_type: :template, message_type: :template,
content_type: 'cards', content_type: 'cards',
content: 'cards',
content_attributes: { content_attributes: {
items: [ items: [
sample_card_item,
sample_card_item sample_card_item
] ]
} }
@ -71,6 +73,7 @@ module WootMessageSeeder
conversation: conversation, conversation: conversation,
message_type: :template, message_type: :template,
content_type: 'form', content_type: 'form',
content: 'form',
content_attributes: { content_attributes: {
"items": [ "items": [
{ "name": 'email', "placeholder": 'Please enter your email', "type": 'email', "label": 'Email' }, { "name": 'email', "placeholder": 'Please enter your email', "type": 'email', "label": 'Email' },

View file

@ -445,6 +445,7 @@ RSpec.describe Conversation, type: :model do
messages: [], messages: [],
inbox_id: conversation.inbox_id, inbox_id: conversation.inbox_id,
status: conversation.status, status: conversation.status,
contact_inbox: conversation.contact_inbox,
timestamp: conversation.last_activity_at.to_i, timestamp: conversation.last_activity_at.to_i,
can_reply: true, can_reply: true,
channel: 'Channel::WebWidget', channel: 'Channel::WebWidget',

View file

@ -22,6 +22,7 @@ RSpec.describe Conversations::EventDataPresenter do
messages: [], messages: [],
inbox_id: conversation.inbox_id, inbox_id: conversation.inbox_id,
status: conversation.status, status: conversation.status,
contact_inbox: conversation.contact_inbox,
can_reply: conversation.can_reply?, can_reply: conversation.can_reply?,
channel: conversation.inbox.channel_type, channel: conversation.inbox.channel_type,
timestamp: conversation.last_activity_at.to_i, timestamp: conversation.last_activity_at.to_i,