zendesk_apps_support 4.52.2 → 4.52.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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fdb79defcd719ff8ec156461ccd2e24ea5d3f102491d3a1a256f68e1e4695444
|
|
4
|
+
data.tar.gz: 0d2c5fd881da162132807b9e76476021bd567c9782b207526286d60600c2d66b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79f8e20b80f998892863f07c3d3dd70dff63c2b192f2c98ec23dafe8b80ccf4c10d038410fb81f18c7752912bd8ef249288da5d47af5fdbcfceeac9b85e300a4
|
|
7
|
+
data.tar.gz: 7bd42830f4a87bfbc9b4662060c68f9e51bef7ab57c674737e69078f1a6e90f029ac6631746ee5d5db475b302f965b185def1d76104b6796abb98aa814d98115
|
data/config/locales/en.yml
CHANGED
|
@@ -264,6 +264,10 @@ en:
|
|
|
264
264
|
leaf %{leaf} from %{file}
|
|
265
265
|
missing_required_key_for_product: 'Missing required key from %{file}
|
|
266
266
|
for %{product}: %{missing_key}'
|
|
267
|
+
value_too_long: "%{field} in %{file} is too long (maximum is %{max_length}
|
|
268
|
+
characters)"
|
|
269
|
+
value_too_long_for_product: "%{field} in %{file} for %{product} is too
|
|
270
|
+
long (maximum is %{max_length} characters)"
|
|
267
271
|
products_do_not_match_manifest_products: Products in manifest (%{manifest_products})
|
|
268
272
|
do not match products in translations (%{translation_products})
|
|
269
273
|
insecure_token_parameter_in_manifest: 'Make sure to set secure to true
|
|
@@ -577,6 +577,16 @@ parts:
|
|
|
577
577
|
key: "txt.apps.admin.error.app_build.translation.missing_required_key_for_product"
|
|
578
578
|
title: "App builder job: required key missing from translation file for a specific product"
|
|
579
579
|
value: "Missing required key from %{file} for %{product}: %{missing_key}"
|
|
580
|
+
- translation:
|
|
581
|
+
key: "txt.apps.admin.error.app_build.translation.value_too_long"
|
|
582
|
+
title: "App builder job: a marketplace field in the translation file exceeds its maximum length"
|
|
583
|
+
value: "%{field} in %{file} is too long (maximum is %{max_length} characters)"
|
|
584
|
+
screenshot: "https://drive.google.com/file/d/1nKER2kvLQPWvSpX5A5mB_m6kEQijsf4k/view?usp=sharing"
|
|
585
|
+
- translation:
|
|
586
|
+
key: "txt.apps.admin.error.app_build.translation.value_too_long_for_product"
|
|
587
|
+
title: "App builder job: a marketplace field in the translation file exceeds its maximum length for a specific product"
|
|
588
|
+
value: "%{field} in %{file} for %{product} is too long (maximum is %{max_length} characters)"
|
|
589
|
+
screenshot: "https://drive.google.com/file/d/1qS48IvA8vEYABmNcgssay8D9wCOGrpJy/view?usp=sharing"
|
|
580
590
|
- translation:
|
|
581
591
|
key: "txt.apps.admin.error.app_build.translation.products_do_not_match_manifest_products"
|
|
582
592
|
title: "App builder job: products specified in translation file don't match products in manifest"
|
|
@@ -7,6 +7,10 @@ module ZendeskAppsSupport
|
|
|
7
7
|
module Translations
|
|
8
8
|
TRANSLATIONS_PATH = %r{^translations/(.*)\.json$}
|
|
9
9
|
VALID_LOCALE = /^[a-z]{2,3}(-\w{2,3})?$/
|
|
10
|
+
MAX_MARKETPLACE_CONTENT_LENGTHS = {
|
|
11
|
+
'long_description' => 10_000,
|
|
12
|
+
'installation_instructions' => 10_000
|
|
13
|
+
}.freeze
|
|
10
14
|
|
|
11
15
|
class TranslationFormatError < StandardError
|
|
12
16
|
end
|
|
@@ -90,9 +94,34 @@ module ZendeskAppsSupport
|
|
|
90
94
|
skip_marketplace_strings
|
|
91
95
|
)
|
|
92
96
|
end
|
|
97
|
+
errors.concat(validate_marketplace_content_lengths(json, file.relative_path, present_product_keys))
|
|
93
98
|
errors.compact
|
|
94
99
|
end
|
|
95
100
|
|
|
101
|
+
def validate_marketplace_content_lengths(json, file_path, present_product_keys)
|
|
102
|
+
return [] unless json['app'].is_a?(Hash)
|
|
103
|
+
|
|
104
|
+
sections = if present_product_keys.empty?
|
|
105
|
+
[[nil, json['app']]]
|
|
106
|
+
else
|
|
107
|
+
present_product_keys.map { |product| [product, json['app'][product]] }
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
sections.flat_map do |product, content|
|
|
111
|
+
next [] unless content.is_a?(Hash)
|
|
112
|
+
|
|
113
|
+
MAX_MARKETPLACE_CONTENT_LENGTHS.filter_map do |key, max_length|
|
|
114
|
+
value = content[key]
|
|
115
|
+
value = value['value'] if value.is_a?(Hash)
|
|
116
|
+
next unless value.is_a?(String) && value.length > max_length
|
|
117
|
+
|
|
118
|
+
error_key = product ? 'translation.value_too_long_for_product' : 'translation.value_too_long'
|
|
119
|
+
data = { file: file_path, field: key, max_length: max_length, product: product&.capitalize }.compact
|
|
120
|
+
ValidationError.new(error_key, data)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
96
125
|
def validate_top_level_required_keys(json, file_path, skip_marketplace_strings)
|
|
97
126
|
keys = json['app'].is_a?(Hash) ? json['app'].keys : []
|
|
98
127
|
missing_keys = get_missing_keys(keys, skip_marketplace_strings)
|
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: 4.52.
|
|
4
|
+
version: 4.52.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: 2026-
|
|
14
|
+
date: 2026-11-04 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: i18n
|