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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1797969aa547664019c9091a2286fc7ed2958e749c392094db1818e3f2826984
4
- data.tar.gz: 53049f9345f939d99f7083dbf49cd3a96f15f3282252a1b4a518aa16d589632d
3
+ metadata.gz: e5b8cdbd0f383e4034cdeffcb5af9f818b5930d2979eab7cfdf707c3029b1088
4
+ data.tar.gz: 5c97a2978caec6d498cb32e3c65a094c9c96f95a1ccc799e7149d99e7de55dc1
5
5
  SHA512:
6
- metadata.gz: 5088fcf2d122b23da5a2f82ac3054d64fe6974c6c984d9c3726db910bb101b67816b92b8a4b43b47e818fbb85f3bd02a9487d0ca2fd322daeea7cc475bf67b41
7
- data.tar.gz: 16d8ee8931f7911a00486f7c5fe0774a4cc80bc942b3477458df0e3bcb0dcc274f519789f10fb1b6e6c4d28419ef45649460c2c09104b95b81cf96c6478fe1bc
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.dup
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.delete(:route_helper_key)
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
- final_url = launch_url(opts, launch_type: launch_type)
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)
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.3.6.beta2"
2
+ VERSION = "5.3.6.beta3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.6.beta2
4
+ version: 5.3.6.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe