panda_pal 5.3.6.beta2 → 5.3.6.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/panda_pal/lti_v1_p3_controller.rb +1 -2
- data/app/lib/lti_xml/base_platform.rb +1 -1
- data/app/lib/panda_pal/launch_url_helpers.rb +9 -3
- data/lib/panda_pal.rb +1 -0
- data/lib/panda_pal/helpers/route_helper.rb +1 -0
- data/lib/panda_pal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5b8cdbd0f383e4034cdeffcb5af9f818b5930d2979eab7cfdf707c3029b1088
|
4
|
+
data.tar.gz: 5c97a2978caec6d498cb32e3c65a094c9c96f95a1ccc799e7149d99e7de55dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df073ebfec0f0b72116935ec44f100870aa2af93f825de3d8fda52e7e4978b19eff3597c6fa9f402287a56e8cf85ad6ee4ec8aee004f5a3b3c143942c86921b8
|
7
|
+
data.tar.gz: b947596b1eec82c8b3ee3173af999f29897b9fc834dd75b2c67d88056b0f96b68ea1fa66732345522eea9a9e9eba738f400396fcb25ce06cafb5027b07016db0
|
@@ -55,8 +55,7 @@ module PandaPal
|
|
55
55
|
parsed_request_url = URI.parse(request_url)
|
56
56
|
|
57
57
|
mapped_placements = PandaPal.lti_paths.map do |k, opts|
|
58
|
-
opts = opts
|
59
|
-
opts.delete(:route_helper_key)
|
58
|
+
opts = LaunchUrlHelpers.normalize_lti_launch_desc(opts)
|
60
59
|
opts.merge!({
|
61
60
|
placement: k,
|
62
61
|
target_link_uri: LaunchUrlHelpers.absolute_launch_url(k.to_sym, host: parsed_request_url, launch_handler: v1p3_resource_link_request_path),
|
@@ -85,7 +85,7 @@ module LtiXml
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def ext_params(options, k)
|
88
|
-
options.
|
88
|
+
options = LaunchUrlHelpers.normalize_lti_launch_desc(options)
|
89
89
|
options[:url] = PandaPal::LaunchUrlHelpers.absolute_launch_url(k.to_sym, host: parsed_request_url, launch_handler: nil)
|
90
90
|
options
|
91
91
|
end
|
@@ -2,11 +2,10 @@ module PandaPal
|
|
2
2
|
module LaunchUrlHelpers
|
3
3
|
def self.absolute_launch_url(launch_type, host:, launch_handler: nil)
|
4
4
|
opts = PandaPal.lti_paths[launch_type]
|
5
|
-
|
6
|
-
|
7
|
-
is_direct = opts[:route_helper_key].present? || !launch_handler.present?
|
5
|
+
is_direct = opts[:no_redirect] || !launch_handler.present?
|
8
6
|
|
9
7
|
if is_direct
|
8
|
+
final_url = launch_url(opts, launch_type: launch_type)
|
10
9
|
return final_url if URI.parse(final_url).absolute?
|
11
10
|
return [host.to_s, final_url].join
|
12
11
|
else
|
@@ -17,6 +16,13 @@ module PandaPal
|
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
19
|
+
def self.normalize_lti_launch_desc(opts)
|
20
|
+
opts = opts.dup
|
21
|
+
opts.delete(:route_helper_key)
|
22
|
+
opts.delete(:no_redirect)
|
23
|
+
opts
|
24
|
+
end
|
25
|
+
|
20
26
|
def self.launch_url(opts, launch_type: nil)
|
21
27
|
url = launch_route(opts, launch_type: launch_type)
|
22
28
|
url = resolve_url_symbol(url) if url.is_a?(Symbol)
|
data/lib/panda_pal.rb
CHANGED
@@ -81,6 +81,7 @@ module PandaPal
|
|
81
81
|
|
82
82
|
def self.validate_lti_navigation(errors = [])
|
83
83
|
@@lti_navigation.each do |k, v|
|
84
|
+
next if v[:route_helper_key]
|
84
85
|
errors << "lti navigation '#{k}' does not have a Route!" unless (LaunchUrlHelpers.launch_url(k) rescue nil)
|
85
86
|
end
|
86
87
|
errors
|
@@ -9,6 +9,7 @@ module PandaPal::Helpers::RouteHelper
|
|
9
9
|
path = "#{base_path}/#{nav.to_s}"
|
10
10
|
|
11
11
|
lti_options = options.delete(:lti_options) || {}
|
12
|
+
lti_options[:no_redirect] = options.delete(:no_redirect)
|
12
13
|
lti_options[:route_helper_key] = path.split('/').reject(&:empty?).join('_')
|
13
14
|
post(path, options.dup, &block)
|
14
15
|
get(path, options.dup, &block)
|
data/lib/panda_pal/version.rb
CHANGED