Fix turn it in docs not using new pdfjs

add locale to canvadoc session launcher

refs CNVS-37351
refs RD-4123

Test plan:

Make sure crocodoc sessions can still be hijacked
Not sure of the best way to test TII docs
If you want to see the new locale option being passed in you should be
able to see it when a crocodoc is autocreated you should see a new
locale param in the document created event log area

Change-Id: If65f7319efa3b51db04af994ce0e5183a9e4d1b6
Reviewed-on: https://gerrit.instructure.com/114382
Tested-by: Jenkins
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
This commit is contained in:
Brad Horrocks 2017-06-06 11:15:37 -06:00 committed by Caleb Guanzon
parent 5f29df248c
commit 558ac63600
2 changed files with 4 additions and 1 deletions

View File

@ -61,7 +61,9 @@ class CrocodocDocument < ActiveRecord::Base
end
def should_migrate_to_canvadocs?
Canvadocs.hijack_crocodoc_sessions? && attachment.context.try(:account)&.feature_enabled?(:new_annotations)
account_context = attachment.context.try(:account)
account_context ||= attachment.context.try(:root_account)
Canvadocs.hijack_crocodoc_sessions? && account_context&.feature_enabled?(:new_annotations)
end
private :should_migrate_to_canvadocs?

View File

@ -7,6 +7,7 @@ module Canvadocs
user = opts.delete(:user)
opts.merge! canvadoc_permissions_for_user(user)
opts[:url] = attachment.authenticated_s3_url(expires_in: 7.days)
opts[:locale] = I18n.locale || I18n.default_locale
Canvas.timeout_protection("canvadocs", raise_on_timeout: true) do
session = canvadocs_api.session(document_id, opts)