Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
clixnet authored and versedpro committed Sep 11, 2020
1 parent fe3cb76 commit 6db445c
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .rake_tasks~
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
about
action_mailbox:ingress:exim
action_mailbox:ingress:postfix
action_mailbox:ingress:qmail
action_mailbox:install
action_text:install
active_storage:install
acts_as_taggable_on_engine:install:migrations
acts_as_taggable_on_engine:tag_names:collate_bin
acts_as_taggable_on_engine:tag_names:collate_ci
annotate_models
annotate_routes
app:template
app:update
assets:clean[keep]
assets:clobber
assets:environment
assets:precompile
cache_digests:dependencies
cache_digests:nested_dependencies
db:create
db:drop
db:environment:set
db:fixtures:load
db:migrate
db:migrate:status
db:prepare
db:rollback
db:schema:cache:clear
db:schema:cache:dump
db:schema:dump
db:schema:load
db:seed
db:seed:dump
db:seed:replant
db:setup
db:structure:dump
db:structure:load
db:version
log:clear
middleware
raven:test[dsn]
remove_annotation
remove_routes
restart
scout:doctor
scout:support
secret
spec
spec:actions
spec:builders
spec:channels
spec:controllers
spec:dispatchers
spec:finders
spec:helpers
spec:jobs
spec:lib
spec:listeners
spec:mailboxes
spec:mailers
spec:models
spec:policies
spec:presenters
spec:requests
spec:services
spec:workers
stats
swagger:build
test
test:db
test:system
time:zones[country_or_offset]
tmp:clear
tmp:create
webpacker
webpacker:binstubs
webpacker:check_binstubs
webpacker:check_node
webpacker:check_yarn
webpacker:clean[keep,age]
webpacker:clobber
webpacker:compile
webpacker:info
webpacker:install
webpacker:install:angular
webpacker:install:coffee
webpacker:install:elm
webpacker:install:erb
webpacker:install:react
webpacker:install:stimulus
webpacker:install:svelte
webpacker:install:typescript
webpacker:install:vue
webpacker:verify_install
webpacker:yarn_install
webpush:generate_keys
yarn:install
zeitwerk:check
47 changes: 47 additions & 0 deletions app/controllers/api/v1/widget/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ def update
if @message.content_type == 'input_email'
@message.update!(submitted_email: contact_email)
update_contact(contact_email)
<<<<<<< HEAD
else
=======
elsif @message.content_type == 'form'
@message.update!(message_update_params[:message])
update_contact(contact_email_original, contact_name_original, contact_phone_number)
else
>>>>>>> 27387460... Upgrade bot enable to collect contact info at start widget
@message.update!(message_update_params[:message])
end
rescue StandardError => e
Expand Down Expand Up @@ -87,6 +94,7 @@ def message_finder
@message_finder ||= MessageFinder.new(conversation, message_finder_params)
end

<<<<<<< HEAD
def update_contact(email)
contact_with_email = @account.contacts.find_by(email: email)
if contact_with_email
Expand All @@ -96,6 +104,32 @@ def update_contact(email)
mergee_contact: @contact
).perform
else
=======
def update_contact(email=nil, name=nil, phone_number=nil)
if email
contact_with_email = @account.contacts.find_by(email: email)

if contact_with_email
@contact = ::ContactMergeAction.new(
account: @account,
base_contact: contact_with_email,
mergee_contact: @contact
).perform
elsif name
@contact.update!(
email: email,
name: name
)
else
@contact.update!(
email: email,
name: contact_name
)
end
end

if name
>>>>>>> 27387460... Upgrade bot enable to collect contact info at start widget
@contact.update!(
email: email,
name: contact_name
Expand All @@ -106,6 +140,19 @@ def update_contact(email)
def contact_email
permitted_params[:contact][:email].downcase
end
<<<<<<< HEAD
=======

def contact_email_original
permitted = params.permit(message: [{submitted_values: :value}])
permitted[:message][:submitted_values][2][:value]
end

def contact_name_original
permitted = params.permit(message: [{submitted_values: :value}])
permitted[:message][:submitted_values][0][:value]
end
>>>>>>> 27387460... Upgrade bot enable to collect contact info at start widget

def contact_name
contact_email.split('@')[0]
Expand Down
5 changes: 5 additions & 0 deletions app/services/message_templates/template/email_collect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ def perform
ActiveRecord::Base.transaction do
conversation.messages.create!(ways_to_reach_you_message_params)
conversation.messages.create!(email_input_box_template_message_params)
<<<<<<< HEAD
end
=======
# conversation.messages.create!(phone_number_input_box_template_message_params)
end
>>>>>>> 27387460... Upgrade bot enable to collect contact info at start widget
rescue StandardError => e
Raven.capture_exception(e)
true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":{"dashboardChart-da2e2dcb2751ae16ad92d6ee00958a063cc6d59876a0bc50b2a1525c176f5d59.js":{"logical_path":"dashboardChart.js","mtime":"2020-09-11T12:58:27+00:00","size":1233,"digest":"da2e2dcb2751ae16ad92d6ee00958a063cc6d59876a0bc50b2a1525c176f5d59","integrity":"sha256-2i4tyydRrhatktbuAJWKBjzG1Zh2oLxQsqFSXBdvXVk="},"administrate/application-9ad4e4c4addd9e0bf509314dc2f0cbe63c49c4220553dfe5b02770ce7f901989.css":{"logical_path":"administrate/application.css","mtime":"2020-09-11T12:58:27+00:00","size":30897,"digest":"9ad4e4c4addd9e0bf509314dc2f0cbe63c49c4220553dfe5b02770ce7f901989","integrity":"sha256-mtTkxK3dngv1CTFNwvDL5jxJxCIFU9/lsCdwzn+QGYk="},"bootstrap/glyphicons-halflings-regular-f495f34e4f177cf0115af995bbbfeb3fcabc88502876e76fc51a4ab439bc8431.eot":{"logical_path":"bootstrap/glyphicons-halflings-regular.eot","mtime":"2020-09-01T17:43:23+00:00","size":20335,"digest":"f495f34e4f177cf0115af995bbbfeb3fcabc88502876e76fc51a4ab439bc8431","integrity":"sha256-9JXzTk8XfPARWvmVu7/rP8q8iFAodudvxRpKtDm8hDE="},"bootstrap/glyphicons-halflings-regular-fc969dc1c6ff531abcf368089dcbaf5775133b0626ff56b52301a059fc0f9e1e.woff":{"logical_path":"bootstrap/glyphicons-halflings-regular.woff","mtime":"2020-09-01T17:43:23+00:00","size":23320,"digest":"fc969dc1c6ff531abcf368089dcbaf5775133b0626ff56b52301a059fc0f9e1e","integrity":"sha256-/Jadwcb/Uxq882gIncuvV3UTOwYm/1a1IwGgWfwPnh4="},"bootstrap/glyphicons-halflings-regular-bd18efd3efd70fec8ad09611a20cdbf99440b2c1d40085c29be036f891d65358.ttf":{"logical_path":"bootstrap/glyphicons-halflings-regular.ttf","mtime":"2020-09-01T17:43:23+00:00","size":41280,"digest":"bd18efd3efd70fec8ad09611a20cdbf99440b2c1d40085c29be036f891d65358","integrity":"sha256-vRjv0+/XD+yK0JYRogzb+ZRAssHUAIXCm+A2+JHWU1g="},"bootstrap/glyphicons-halflings-regular-d168d50a88c730b4e6830dc0da2a2b51dae4658a77d9619943c27b8ecfc19d1a.svg":{"logical_path":"bootstrap/glyphicons-halflings-regular.svg","mtime":"2020-09-01T17:43:23+00:00","size":62927,"digest":"d168d50a88c730b4e6830dc0da2a2b51dae4658a77d9619943c27b8ecfc19d1a","integrity":"sha256-0WjVCojHMLTmgw3A2iorUdrkZYp32WGZQ8J7js/BnRo="},"administrate/application-9b94457a8e933d1cc67846d0f4bc8dfb06d99986bee728ced7655e1abaf4b40a.js":{"logical_path":"administrate/application.js","mtime":"2020-09-11T12:58:28+00:00","size":654945,"digest":"9b94457a8e933d1cc67846d0f4bc8dfb06d99986bee728ced7655e1abaf4b40a","integrity":"sha256-m5RFeo6TPRzGeEbQ9LyN+wbZmYa+5yjO12VeGrr0tAo="}},"assets":{"dashboardChart.js":"dashboardChart-da2e2dcb2751ae16ad92d6ee00958a063cc6d59876a0bc50b2a1525c176f5d59.js","administrate/application.css":"administrate/application-9ad4e4c4addd9e0bf509314dc2f0cbe63c49c4220553dfe5b02770ce7f901989.css","bootstrap/glyphicons-halflings-regular.eot":"bootstrap/glyphicons-halflings-regular-f495f34e4f177cf0115af995bbbfeb3fcabc88502876e76fc51a4ab439bc8431.eot","bootstrap/glyphicons-halflings-regular.woff":"bootstrap/glyphicons-halflings-regular-fc969dc1c6ff531abcf368089dcbaf5775133b0626ff56b52301a059fc0f9e1e.woff","bootstrap/glyphicons-halflings-regular.ttf":"bootstrap/glyphicons-halflings-regular-bd18efd3efd70fec8ad09611a20cdbf99440b2c1d40085c29be036f891d65358.ttf","bootstrap/glyphicons-halflings-regular.svg":"bootstrap/glyphicons-halflings-regular-d168d50a88c730b4e6830dc0da2a2b51dae4658a77d9619943c27b8ecfc19d1a.svg","administrate/application.js":"administrate/application-9b94457a8e933d1cc67846d0f4bc8dfb06d99986bee728ced7655e1abaf4b40a.js"}}

0 comments on commit 6db445c

Please sign in to comment.