zendesk_apps_support 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f36f2639f048681823a88ef9669638499ce53d2
4
- data.tar.gz: 526ed308014fe9475d670597f63904a112ecdd5c
3
+ metadata.gz: 05ad3567f597664ad8ce94c872134e67f2e9bda7
4
+ data.tar.gz: 2a3f1251f376c3e59f81ec773586aafa559c50f9
5
5
  SHA512:
6
- metadata.gz: 881df6e418a86e65c7e8774b72f96924fd2b5d4aa96ffa34bb27d1f9fadc141d852835cc6677ceae7bfcad3284399b785f788c91547b982f20e5d109319a3b0b
7
- data.tar.gz: d49736cdfb17419959dadee4b5755f0ef709432d0ffea53bf86655fe57ed5ec9794c1ea4276a8dcd3c9c93fe6be183f54dc23725fc19904295d5aff831e307dc
6
+ metadata.gz: b56372c5c05c92f5e17b213a53fcfabdbdf4533691ad0cab5738eb0c28aa31719ae22f6ba7488432565f537ca39605bec0abd611ce8586588d47b1f1ce62a8e1
7
+ data.tar.gz: a5661aba54f00f86803467580fc11eb04ccda18d7ef808e72275548e8c55267675d9475b50a9fe68e5b89696e842783be12e75a8cfa8eee52774df9984d9b9c6
@@ -83,6 +83,10 @@ en:
83
83
  duplicate_reference: 'Duplicate reference in manifest: "%{key}".'
84
84
  duplicate_reference_values: Initially set to "%{original}", attempted
85
85
  overwrite to "%{attempted}".
86
+ locations_must_be_urls: App locations need to be URLs for this framework
87
+ version.
88
+ locations_cant_be_urls: App locations must not be URLs for this framework
89
+ version.
86
90
  warning:
87
91
  app_build:
88
92
  deprecated_version: You are targeting a deprecated version of the framework.
@@ -220,3 +220,11 @@ parts:
220
220
  key: "txt.apps.admin.error.app_build.duplicate_reference_values"
221
221
  title: "This sentence follows txt.apps.admin.error.app_build.duplicate_reference. The values are included to help find the problem."
222
222
  value: "Initially set to \"%{original}\", attempted overwrite to \"%{attempted}\"."
223
+ - translation:
224
+ key: "txt.apps.admin.error.app_build.locations_must_be_urls"
225
+ title: "The locations needed to be URLs, but they were empty."
226
+ value: "App locations need to be URLs for this framework version."
227
+ - translation:
228
+ key: "txt.apps.admin.error.app_build.locations_cant_be_urls"
229
+ title: "The locations can't be URLs, but they were."
230
+ value: "App locations must not be URLs for this framework version."
@@ -23,6 +23,7 @@ module ZendeskAppsSupport
23
23
  }.freeze
24
24
 
25
25
  attr_reader(*RUBY_TO_JSON.keys)
26
+ attr_reader :locations
26
27
 
27
28
  alias_method :requirements_only?, :requirements_only
28
29
  alias_method :signed_urls?, :signed_urls
@@ -45,27 +46,9 @@ module ZendeskAppsSupport
45
46
  !locations.values.all?(&:empty?)
46
47
  end
47
48
 
48
- def locations
49
- @locations ||=
50
- case original_locations
51
- when Hash
52
- @used_hosts = original_locations.keys
53
- replace_legacy_locations original_locations
54
- when Array
55
- @used_hosts = ['support']
56
- { 'support' => NoOverrideHash[original_locations.map { |location| [ location, LEGACY_URI_STUB ] }] }
57
- when String
58
- @used_hosts = ['support']
59
- { 'support' => { original_locations => LEGACY_URI_STUB } }
60
- # TODO: error out for numbers and Booleans
61
- else # NilClass
62
- @used_hosts = ['support']
63
- { 'support' => {} }
64
- end
65
- end
66
-
67
49
  def unknown_hosts
68
- @unknown_hosts ||= @used_hosts - Product::PRODUCTS_AVAILABLE.flat_map { |p| [p.name, p.legacy_name] }
50
+ @unknown_hosts ||=
51
+ @used_hosts - Product::PRODUCTS_AVAILABLE.flat_map { |p| [p.name, p.legacy_name] }
69
52
  end
70
53
 
71
54
  def iframe_only?
@@ -91,10 +74,30 @@ module ZendeskAppsSupport
91
74
  @private = m.fetch('private', true)
92
75
  @signed_urls ||= false
93
76
  @no_template ||= false
77
+ set_locations_and_hosts
94
78
  end
95
79
 
96
80
  private
97
81
 
82
+ def set_locations_and_hosts
83
+ @locations =
84
+ case original_locations
85
+ when Hash
86
+ @used_hosts = original_locations.keys
87
+ replace_legacy_locations original_locations
88
+ when Array
89
+ @used_hosts = ['support']
90
+ { 'support' => NoOverrideHash[original_locations.map { |location| [ location, LEGACY_URI_STUB ] }] }
91
+ when String
92
+ @used_hosts = ['support']
93
+ { 'support' => { original_locations => LEGACY_URI_STUB } }
94
+ # TODO: error out for numbers and Booleans
95
+ else # NilClass
96
+ @used_hosts = ['support']
97
+ { 'support' => {} }
98
+ end
99
+ end
100
+
98
101
  def replace_legacy_locations(original_locations)
99
102
  NoOverrideHash.new.tap do |new_locations_obj|
100
103
  Product::PRODUCTS_AVAILABLE.each do |product|
@@ -244,7 +244,7 @@ module ZendeskAppsSupport
244
244
  url != stub
245
245
  end
246
246
  legacy_locations = (!iframe_locations && manifest.location?) || locations_any?(locations) do |url|
247
- url != stub
247
+ url == stub
248
248
  end
249
249
  if manifest.iframe_only?
250
250
  return ValidationError.new(:locations_must_be_urls) if legacy_locations
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen