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: 211dac538bdde6ed7cb8e52575ce6607a11c1c23
4
- data.tar.gz: 92ad7e2315fee0bd2edae2624d01b3ff211409ff
3
+ metadata.gz: e8b88b2b10b1230148fdb7dd2ec8d1e74bae0cb4
4
+ data.tar.gz: b888261f0eb7dcadb5bb8d2b06352a80a5f7c47e
5
5
  SHA512:
6
- metadata.gz: ee33e973b2256d9dcb8e3e186500b990a6a164a071b28e83911271fa04148ef8d1a722ed15461aeb62c575a373630129e4feb71ee119d8401b16a7898f5772cc
7
- data.tar.gz: b40e5b4c1e50f13f7062aea6bd2d0d58db36d88ed084fd18b5b28c5e64adc5c0e2347f09ecae3ce9a2d77d756994e278b3d71ac2ddc812e47ec75f341f02dd33
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 macros targets views ticket_fields triggers user_fields).freeze
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 << invalid_user_fields(requirements)
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 invalid_user_fields(requirements)
55
+ def invalid_custom_fields(requirements)
56
56
  user_fields = requirements['user_fields']
57
- return unless user_fields
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 |identifier, fields|
60
- next if fields.include? 'key'
61
- errors << ValidationError.new(:missing_required_fields, field: 'key', identifier: identifier)
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.3.9
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-02-01 00:00:00.000000000 Z
14
+ date: 2017-03-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n