zendesk_apps_support 3.3.9 → 3.4.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8b88b2b10b1230148fdb7dd2ec8d1e74bae0cb4
|
|
4
|
+
data.tar.gz: b888261f0eb7dcadb5bb8d2b06352a80a5f7c47e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50481009c0f0ece60fe751c982bc3e45939282cf42c295d35f1fa11a3c276df236a891c2abad6e7a85231530413525d1c87555231fc4508d470a710f4479016b
|
|
7
|
+
data.tar.gz: 423080573059c18a3493dd0859a2c0fa90eff605921fafcbe48abae053439eec9a6eec514902c819a03e01d13a61e71682c88365ad16bc1c67de3b822864dc39
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module ZendeskAppsSupport
|
|
3
3
|
class AppRequirement
|
|
4
|
-
TYPES = %w(automations channel_integrations
|
|
4
|
+
TYPES = %w(automations channel_integrations
|
|
5
|
+
macros targets views ticket_fields triggers
|
|
6
|
+
user_fields organization_fields).freeze
|
|
5
7
|
end
|
|
6
8
|
end
|
|
@@ -24,7 +24,7 @@ module ZendeskAppsSupport
|
|
|
24
24
|
errors << invalid_requirements_types(requirements)
|
|
25
25
|
errors << excessive_requirements(requirements)
|
|
26
26
|
errors << invalid_channel_integrations(requirements)
|
|
27
|
-
errors <<
|
|
27
|
+
errors << invalid_custom_fields(requirements)
|
|
28
28
|
errors << missing_required_fields(requirements)
|
|
29
29
|
errors.flatten!
|
|
30
30
|
errors.compact!
|
|
@@ -52,13 +52,16 @@ module ZendeskAppsSupport
|
|
|
52
52
|
ValidationError.new(:excessive_requirements, max: MAX_REQUIREMENTS, count: count) if count > MAX_REQUIREMENTS
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
def
|
|
55
|
+
def invalid_custom_fields(requirements)
|
|
56
56
|
user_fields = requirements['user_fields']
|
|
57
|
-
|
|
57
|
+
organization_fields = requirements['organization_fields']
|
|
58
|
+
return if user_fields.nil? && organization_fields.nil?
|
|
58
59
|
[].tap do |errors|
|
|
59
|
-
user_fields.each do |
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
[user_fields, organization_fields].compact.each do |field_group|
|
|
61
|
+
field_group.each do |identifier, fields|
|
|
62
|
+
next if fields.include? 'key'
|
|
63
|
+
errors << ValidationError.new(:missing_required_fields, field: 'key', identifier: identifier)
|
|
64
|
+
end
|
|
62
65
|
end
|
|
63
66
|
end
|
|
64
67
|
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.
|
|
4
|
+
version: 3.4.1
|
|
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: 2017-
|
|
14
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: i18n
|