Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMM - (SPARCRequest) Get Cost Estimate Email Extra Blank/Line #138

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 3 additions & 9 deletions app/views/notifier/_welcome.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS~
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR~
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~

- welcome_text = I18n.t('notifier.welcome_obtain_research_pricing')

- if @role != 'none'
%p= I18n.t('notifier.body1', :full_name => @full_name)
%p.inline
= I18n.t('notifier.non_service_provider_intro_1', :welcome => welcome_text, :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase)
%p.inline
%a.link{href: @portal_link}=t(:notifier)[:sparc_dashboard]
%p.inline= t(:notifier)[:non_service_provider_intro_2]
%strong= t(:notifier)[:non_service_provider_intro_3]
= raw(I18n.t('notifier.non_service_provider_message', :welcome => welcome_text, :href => link_to( t(:notifier)[:sparc_dashboard],@portal_link), :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase))
- else
%p= I18n.t('notifier.body1', :full_name => @full_name)
%p.inline= I18n.t('notifier.service_provider_intro_1', :welcome => welcome_text, :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase)
%p.inline
%a.link{href: @portal_link}=t(:notifier)[:sparc_dashboard]
%p.inline= t(:notifier)[:service_provider_intro_2]
= raw(I18n.t('notifier.service_provider_message', :welcome => welcome_text, :href => link_to( t(:notifier)[:sparc_dashboard],@portal_link), :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase))
%br
- if @portal_text
%p
Expand Down
8 changes: 2 additions & 6 deletions app/views/notifier/_welcome_for_submitted_status.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@
- if @role != 'none'
%p= I18n.t('notifier.body1', :full_name => @full_name)
%p.inline
= I18n.t('notifier.non_service_provider_intro_submitted_1', :welcome => welcome_text, :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase)
%p.inline
%a.link{href: @portal_link}=t(:notifier)[:sparc_dashboard]
%p.inline= t(:notifier)[:non_service_provider_intro_submitted_2]
= raw(I18n.t('notifier.non_service_provider_submitted_message', :welcome => welcome_text, :href => link_to( t(:notifier)[:sparc_dashboard],@portal_link), :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase))
%p= t(:notifier)[:note]
- else
%p= I18n.t('notifier.body1', :full_name => @full_name)
%p.inline= I18n.t('notifier.service_provider_intro_submitted_1', :welcome => welcome_text, :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase)
%p.inline
%a.link{href: @portal_link}=t(:notifier)[:sparc_dashboard_period]
= raw(I18n.t('notifier.service_provider_submitted_message', :welcome => welcome_text, :href => link_to( t(:notifier)[:sparc_dashboard],@portal_link), :application_title => t(:mailer)[:application_title], :root_url => ROOT_URL, :protocol_type => @protocol.type.downcase))
%br
- if @portal_text
%p
Expand Down
16 changes: 4 additions & 12 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1373,13 +1373,10 @@ en:
epic_access: "Epic Access"
link: "HERE"
name: "User Name"
# Language for 'Get a Cost Estimate'
non_service_provider_intro_1: "%{welcome} in SPARCRequest. You can review or edit this request in "
non_service_provider_intro_2: ". An email has been sent to the service provider(s) to review and ensure the services are appropriate."
non_service_provider_intro_3: "Please note the services will not start until this request is submitted through SPARCDashboard."
# Language for 'Submitted'
non_service_provider_intro_submitted_1: "%{welcome} in SPARCRequest. Visit "
non_service_provider_intro_submitted_2: " to view the status or make any updates to your request."
non_service_provider_message: "%{welcome} in SPARCRequest. You can review or edit this request in %{href}. An email has been sent to the service provider(s) to review and ensure the services are appropriate. <b>Please note the services will not start until this request is submitted through SPARCDashboard.</b>"
service_provider_message: "%{welcome} in SPARCRequest and is awaiting your review in %{href}. Please ensure services chosen are appropriate and can be provided. Communicate any necessary changes to the study team and request they “Submit to Start Services” once ready to proceed."
non_service_provider_submitted_message: "%{welcome} in SPARCRequest. Visit %{href} to view the status or make any updates to your request."
service_provider_submitted_message: "%{welcome} in SPARCRequest and is awaiting your review in %{href}."
note: "*Note: upon submission, services selected to go to Epic will be sent daily at 4:30pm."
notes_present: "*Note(s) are included with this submission."
notice:
Expand All @@ -1405,13 +1402,8 @@ en:
s_name: "Sponsor Name"
service: "Service"
service_request: "Service Request"
# Language for 'Submitted'
service_provider_intro_submitted_1: "%{welcome} in SPARCRequest and is awaiting your review in "
# Language for 'Get a Cost Estimate'
service_provider_intro_1: "%{welcome} in SPARCRequest and is awaiting your review in "
sparc_dashboard: "SPARCDashboard"
sparc_dashboard_period: "SPARCDashboard."
service_provider_intro_2: ". Please ensure services chosen are appropriate and can be provided. Communicate any necessary changes to the study team and request they “Submit to Start Services” once ready to proceed."
source: "Funding Source"
srid_info: "Service Request Information"
sr_id: "Service Request ID:"
Expand Down
16 changes: 7 additions & 9 deletions spec/support/emails/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ def submitted_service_provider_and_admin_message
# Expected message:
# 'A request has been submitted to start services in
# SPARCRequest and is awaiting your review in SPARCDashboard.'
expect(mail).to have_xpath("//p[normalize-space(text()) = 'A request has been submitted to start services in SPARCRequest and is awaiting your review in']")
expect(mail).to have_xpath "//p//a[@href='/dashboard/protocols/#{service_request.protocol.id}'][text()= 'SPARCDashboard.']/@href"
expect(mail).to have_text('A request has been submitted to start services in SPARCRequest and is awaiting your review in SPARCDashboard.')
expect(mail).to have_xpath "//a[@href='/dashboard/protocols/#{service_request.protocol.id}'][text()= 'SPARCDashboard']/@href"
end

def submitted_general_users_message
# Expected user message:
# "A request has been submitted to start services in
# SPARCRequest. Visit SPARCDashboard to view the status or
# make any updates to your request."
expect(mail.body.parts.first.body).to have_xpath("//p[normalize-space(text()) = 'A request has been submitted to start services in SPARCRequest. Visit']")
expect(mail.body.parts.first.body).to have_text("A request has been submitted to start services in SPARCRequest. Visit SPARCDashboard to view the status or make any updates to your request.")
expect(mail.body.parts.first.body).to have_xpath "//p//a[@href='/dashboard/protocols/#{service_request.protocol.id}'][text()= 'SPARCDashboard']/@href"
expect(mail.body.parts.first.body).to have_xpath("//p[normalize-space(text()) = 'to view the status or make any updates to your request.']")
end
#### END SUBMITTED MESSAGE METHODS ####

Expand All @@ -67,9 +66,10 @@ def get_a_cost_estimate_service_provider_admin_message(mail_response)
# SPARCRequest and is awaiting your review in SPARCDashboard. Please ensure services chosen
# are appropriate and can be provided. Communicate any necessary changes to the study team
# and request they “Submit to Start Services” once ready to proceed."
expect(mail_response).to have_xpath("//p[normalize-space(text()) = 'A request has been made for a budget review (Get Cost Estimate) in SPARCRequest and is awaiting your review in']")

expect(mail_response).to have_text('A request has been made for a budget review (Get Cost Estimate) in SPARCRequest and is awaiting your review in SPARCDashboard. Please ensure services chosen are appropriate and can be provided. Communicate any necessary changes to the study team and request they “Submit to Start Services” once ready to proceed.')
expect(mail_response).to have_xpath "//a[@href='/dashboard/protocols/#{service_request.protocol.id}'][text()= 'SPARCDashboard']/@href"
expect(mail_response).to have_xpath("//p[normalize-space(text()) = '. Please ensure services chosen are appropriate and can be provided. Communicate any necessary changes to the study team and request they “Submit to Start Services” once ready to proceed.']")

end

def get_a_cost_estimate_general_users
Expand All @@ -79,10 +79,8 @@ def get_a_cost_estimate_general_users
# An email has been sent to the service provider(s) to review and ensure
# the services are appropriate. Please note the services will not start
# until this request is submitted through SPARCDashboard.'
expect(mail.body.parts.first.body).to have_xpath("//p[normalize-space(text()) = 'A request has been made for a budget review (Get Cost Estimate) in SPARCRequest. You can review or edit this request in']")
expect(mail.body.parts.first.body).to have_text('A request has been made for a budget review (Get Cost Estimate) in SPARCRequest. You can review or edit this request in SPARCDashboard. An email has been sent to the service provider(s) to review and ensure the services are appropriate. Please note the services will not start until this request is submitted through SPARCDashboard.')
expect(mail.body.parts.first.body).to have_xpath "//a[@href='/dashboard/protocols/#{service_request.protocol.id}'][text()= 'SPARCDashboard']/@href"
expect(mail.body.parts.first.body).to have_xpath("//p[normalize-space(text()) = '. An email has been sent to the service provider(s) to review and ensure the services are appropriate.']")
expect(mail.body.parts.first.body).to have_xpath("//strong[normalize-space(text()) = 'Please note the services will not start until this request is submitted through SPARCDashboard.']")
end
#### END GET A COST ESTIMATE MESSAGE METHODS ####

Expand Down