zendesk_apps_support 3.1.2 → 3.1.3

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: 17e0397eb9e955f39c20172e468c5c802c16e6b9
4
- data.tar.gz: 729794611cb19c2ad235ef74edcdb57b8d10cea3
3
+ metadata.gz: 0109ce4105d60dea50f5b3a1fd4ef1be8f846f97
4
+ data.tar.gz: ed2fbeaef6580326d51ffe0168f509962b3a3353
5
5
  SHA512:
6
- metadata.gz: 31db6f1d415c359436fda55684f6040bc5187b6700814f63398bcfa6f6f912dc329f63cb2b5628eb186b7a1abea085d11b4e7e28cc68d55381608c6b1be2e55e
7
- data.tar.gz: 855a7bd5ae36894856819ebed680ce64d5628b54da9ec6fae5873eae20a7537fdea6851e5e22ca254e470604e75fb06e74c29d4a34a9326661198d2b1c59cb86
6
+ metadata.gz: 8c9adc260e3f74ae811b728a05988a42c81542c96bbb1c004f524b61d99f9cac393bb3ce1bf9660b167e0042e79fdc3e0c7648587cc5b84adbc1d1ea754736b4
7
+ data.tar.gz: 69aa0c73c61277e9d2816cd39884fbf0f5435c3736b49f92d67c19f877a44487c83b60f6b13bc45b3b5bfab0a987396cb5da1dd0b77bc54e5aeb257ba181634f
@@ -20,6 +20,8 @@ en:
20
20
  manifest_not_json: manifest is not proper JSON. %{errors}
21
21
  missing_manifest: Could not find manifest.json
22
22
  symlink_in_zip: Symlinks are not allowed in the zip file
23
+ invalid_experiment: 'Manifest specifies unknown or unavailable experiment:
24
+ %{experiment}'
23
25
  missing_requirements: Could not find requirements.json
24
26
  requirements_not_supported: App requirements are not supported for marketing-only
25
27
  apps
@@ -53,7 +55,7 @@ en:
53
55
  not allowed when an iframe URI or noTemplate is specified
54
56
  invalid_default_locale: "%{default_locale} is not a valid default locale."
55
57
  missing_translation_file: 'Missing translation file for locale ''%{default_locale}''.
56
- Please read: http://developer.zendesk.com/documentation/apps/i18n.html'
58
+ Learn more: http://developer.zendesk.com/documentation/apps/i18n.html'
57
59
  invalid_host: "%{host_name} is an invalid host for apps."
58
60
  invalid_location:
59
61
  one: "%{invalid_locations} is an invalid location in %{host_name}."
@@ -81,7 +83,7 @@ en:
81
83
  invalid_type_parameter:
82
84
  one: "%{invalid_types} is an invalid parameter type."
83
85
  other: "%{invalid_types} are invalid parameter types."
84
- unacceptable_boolean: '%{field} must be a Boolean value, got "%{value}"'
86
+ unacceptable_boolean: '%{field} must be a boolean value, got "%{value}".'
85
87
  invalid_no_template: noTemplate must be set to true, false, or an array
86
88
  of valid locations.
87
89
  duplicate_reference: 'Duplicate reference in manifest: "%{key}".'
@@ -44,6 +44,10 @@ parts:
44
44
  key: "txt.apps.admin.error.app_build.symlink_in_zip"
45
45
  title: "App builder job: symlinks not allowed. https://en.wikipedia.org/wiki/Symbolic_link"
46
46
  value: "Symlinks are not allowed in the zip file"
47
+ - translation:
48
+ key: "txt.apps.admin.error.app_build.invalid_experiment"
49
+ title: "App builder job: experiment has been specifed that is not publically available or otherwise invalid"
50
+ value: "Manifest specifies unknown or unavailable experiment: %{experiment}"
47
51
  - translation:
48
52
  key: "txt.apps.admin.error.app_build.missing_requirements"
49
53
  title: "App builder job: missing requirements error"
@@ -127,7 +131,7 @@ parts:
127
131
  - translation:
128
132
  key: "txt.apps.admin.error.app_build.missing_translation_file"
129
133
  title: "App builder job: missing translation file"
130
- value: "Missing translation file for locale '%{default_locale}'. Please read: http://developer.zendesk.com/documentation/apps/i18n.html"
134
+ value: "Missing translation file for locale '%{default_locale}'. Learn more: http://developer.zendesk.com/documentation/apps/i18n.html"
131
135
  - translation:
132
136
  key: "txt.apps.admin.error.app_build.invalid_host"
133
137
  title: "App builder job: invalid host application for apps"
@@ -214,8 +218,8 @@ parts:
214
218
  value: "%{invalid_types} are invalid parameter types."
215
219
  - translation:
216
220
  key: "txt.apps.admin.error.app_build.unacceptable_boolean"
217
- title: "App builder job: this value needs to be either true or false, but something else was passed in"
218
- value: "%{field} must be a Boolean value, got \"%{value}\""
221
+ title: "App builder job: this value needs to be either true or false, but something else was passed in. placeholder value is taken from user input. You can translate as: The value %{field} must be a Boolean... to avoid any gender issues."
222
+ value: "%{field} must be a boolean value, got \"%{value}\"."
219
223
  - translation:
220
224
  key: "txt.apps.admin.error.app_build.invalid_no_template"
221
225
  title: "App builder job: `noTemplate` needs to be true, false or a valid array, but something else was passed in. noTemplate, true, and false should not be translated."
@@ -8,6 +8,7 @@ module ZendeskAppsSupport
8
8
  marketing_only: 'marketingOnly',
9
9
  version: 'version',
10
10
  author: 'author',
11
+ experiments: 'experiments',
11
12
  framework_version: 'frameworkVersion',
12
13
  single_install: 'singleInstall',
13
14
  signed_urls: 'signedUrls',
@@ -66,6 +67,10 @@ module ZendeskAppsSupport
66
67
  end
67
68
  end
68
69
 
70
+ def enabled_experiments
71
+ (experiments || {}).select { |k, v| v }.keys
72
+ end
73
+
69
74
  def initialize(manifest_text)
70
75
  m = parse_json(manifest_text)
71
76
  RUBY_TO_JSON.each do |ruby, json|
@@ -77,6 +82,7 @@ module ZendeskAppsSupport
77
82
  @private = m.fetch('private', true)
78
83
  @signed_urls ||= false
79
84
  @no_template ||= false
85
+ @experiments ||= {}
80
86
  set_locations_and_hosts
81
87
  end
82
88
 
@@ -27,10 +27,9 @@ module ZendeskAppsSupport
27
27
 
28
28
  def validate(marketplace: true)
29
29
  [].tap do |errors|
30
- errors << Validations::Marketplace.call(self) if marketplace
31
-
32
30
  errors << Validations::Manifest.call(self)
33
31
  if has_manifest?
32
+ errors << Validations::Marketplace.call(self) if marketplace
34
33
  errors << Validations::Source.call(self)
35
34
  errors << Validations::Translations.call(self)
36
35
  errors << Validations::Requirements.call(self)
@@ -119,6 +118,7 @@ module ZendeskAppsSupport
119
118
  templates = manifest.no_template == true ? {} : compiled_templates(app_id, asset_url_prefix)
120
119
 
121
120
  app_settings = {
121
+ experiments: manifest.experiments,
122
122
  location: manifest.locations,
123
123
  noTemplate: manifest.no_template_locations,
124
124
  singleInstall: manifest.single_install?,
@@ -1,9 +1,11 @@
1
1
  module ZendeskAppsSupport
2
2
  module Validations
3
3
  module Marketplace
4
+ WHITELISTED_EXPERIMENTS = [].freeze
5
+
4
6
  class << self
5
7
  def call(package)
6
- [no_symlinks(package.root)].compact
8
+ [no_symlinks(package.root), *no_experiments(package.manifest)].compact
7
9
  end
8
10
 
9
11
  private
@@ -14,6 +16,13 @@ module ZendeskAppsSupport
14
16
  end
15
17
  nil
16
18
  end
19
+
20
+ def no_experiments(manifest)
21
+ invalid_experiments = manifest.enabled_experiments - WHITELISTED_EXPERIMENTS
22
+ invalid_experiments.map do |experiment|
23
+ ValidationError.new(:invalid_experiment, experiment: experiment)
24
+ end
25
+ end
17
26
  end
18
27
  end
19
28
  end
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.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-09-05 00:00:00.000000000 Z
14
+ date: 2016-10-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: 1.3.6
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.5.1
204
+ rubygems_version: 2.6.4
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Support to help you develop Zendesk Apps.