diff --git a/app/views/task_requests/create.html.erb b/app/views/task_requests/create.html.erb index 3974af1..7968105 100644 --- a/app/views/task_requests/create.html.erb +++ b/app/views/task_requests/create.html.erb @@ -1,4 +1,9 @@ <% if params[:show_chat] %> <%= javascript_include_tag "https://js.hs-scripts.com/7344617.js", defer: "defer", async: true, id: "hs-script-loader" %> + <%= javascript_tag nonce: true do %> + $(document).ready(function(){ + window.HubSpotConversations.widget.open(); + }); + <% end %> <% end %> -

Your task request was successfully submitted. Thank you.

+

<%= t '.success_message' %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index a8fe4bd..ee67a04 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -943,11 +943,12 @@ en: notice: Task has been cancelled successfully. create: notice: Task request created succussfully. + success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. edit: heading: Edit Task Request form: - info_message: After submitting this task request, you'll be connected via chat with a BIG representative. + info_message: After submitting this task request, you'll be connected via chat with a ME Suite representative. labels: additional_notes: Please add any additional notes we should be aware of regarding this task. deadline: What is the deadline for this task? diff --git a/config/locales/es.yml b/config/locales/es.yml index 174b604..207c37e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -183,8 +183,10 @@ es: guardian_photo: heading: Guardian Photo (ES) task_requests: + create: + success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. (ES) form: - info_message: After submitting this task request, you'll be connected via chat with a BIG representative. (ES) + info_message: After submitting this task request, you'll be connected via chat with a ME Suite representative. (ES) task_request: actions: manage: Manage (ES) diff --git a/spec/features/user_creates_task_request_spec.rb b/spec/features/user_creates_task_request_spec.rb index b2540fe..2ecb847 100644 --- a/spec/features/user_creates_task_request_spec.rb +++ b/spec/features/user_creates_task_request_spec.rb @@ -20,7 +20,7 @@ RSpec.feature 'User creates task request', type: :feature do click_on 'Create Task request' - expect(page).to have_content('Task request created succussfully.') + expect(page).to have_content task_created_message end scenario 'user can view task request details' do @@ -85,4 +85,8 @@ RSpec.feature 'User creates task request', type: :feature do def additional_notes_field t "task_requests.form.labels.additional_notes" end + + def task_created_message + t 'task_requests.create.success_message' + end end \ No newline at end of file