switch url lookup to use "url"

fixes: PLAT-4361

test-plan:

* install a 1.1 tool with user navigation
* it should launch to the user_navigation_url

Change-Id: Ib064859f446007c05a0551a507104faf78f5a8fe
Reviewed-on: https://gerrit.instructure.com/188416
Tested-by: Jenkins
Product-Review: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
This commit is contained in:
Nathan Mills 2019-04-04 14:43:11 -06:00 committed by Marc Phillips
parent 13bdcb1098
commit 2fe0bc27aa
3 changed files with 6 additions and 4 deletions

View File

@ -410,9 +410,10 @@ class ContextExternalTool < ActiveRecord::Base
end
def login_or_launch_url(extension_type: nil, content_tag_uri: nil)
use_1_3? && developer_key&.oidc_initiation_url ||
(use_1_3? && developer_key&.oidc_initiation_url) ||
content_tag_uri ||
extension_setting(extension_type, :target_link_uri) ||
(use_1_3? && extension_setting(extension_type, :target_link_uri)) ||
extension_setting(extension_type, :url) ||
url
end

View File

@ -50,4 +50,4 @@ module Lti
end
end
end
end

View File

@ -74,7 +74,7 @@ describe ContextExternalTool do
before do
tool.editor_button = {
"target_link_uri" => placement_url,
"url" => placement_url,
"text" => "LTI 1.3 twoa",
"enabled" => true,
"icon_url" => "https://static.thenounproject.com/png/131630-200.png",
@ -86,6 +86,7 @@ describe ContextExternalTool do
it 'returns the extension url' do
expect(tool.login_or_launch_url(extension_type: :editor_button)).to eq placement_url
end
end
context 'lti_1_3 tool' do