Skip to content

Commit 5516c54

Browse files
enforce cov2 limits in req validation
1 parent b00ba66 commit 5516c54

File tree

7 files changed

+730
-2
lines changed

7 files changed

+730
-2
lines changed

config/locales/translations/zendesk_apps_support.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,70 @@ parts:
105105
title: "App builder job: requirements file contains too many custom objects requirements. Leave requirements.json as is (do not localize)"
106106
value: "The requirements.json file contains too many custom objects requirements. The current limit is %{max} requirements. This app has %{count} requirements."
107107
screenshot: "https://drive.google.com/open?id=18yac8rV7kMe5qm49ERVFVCA7WOZl8vcP"
108+
- translation:
109+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_v2_requirements"
110+
title: "App builder job: requirements file contains too many custom objects v2 requirements. The maximum number of custom objects per account is 50. Leave requirements.json as is (do not translate)"
111+
value: "The requirements.json file contains too many custom objects v2 requirements. The current limit is %{max} custom objects per account. This app has %{count} custom objects per account."
112+
screenshot: "https://drive.google.com/file/d/1eFZWrESblrmgJxp8ls0rk1RPkDxJ0w-4/view?usp=sharing"
113+
- translation:
114+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_v2_fields"
115+
title: "App builder job: requirements file contains too many custom object fields. The maximum number of custom object fields per object is 10. Leave requirements.json as is (do not translate)"
116+
value: "The requirements.json file contains too many custom object fields. The current limit is %{max} fields per custom object. This app has %{count} fields for object %{object_key}."
117+
screenshot: "https://drive.google.com/file/d/1mEiQLJxTb-lFFnVt96n051w4BnxJOZID/view?usp=sharing"
118+
- translation:
119+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_v2_triggers"
120+
title: "App builder job: requirements file contains too many custom object triggers. The maximum number of custom object triggers per object is 100. Leave requirements.json as is (do not translate)"
121+
value: "The requirements.json file contains too many custom object triggers. The current limit is %{max} triggers per custom object. This app has %{count} triggers for object %{object_key}."
122+
screenshot: "https://drive.google.com/file/d/1JTEmjrUTq7Bsxoy36Syj-vhbkG8W_68D/view?usp=sharing"
123+
- translation:
124+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_v2_trigger_conditions"
125+
title: "App builder job: requirements file contains too many custom object trigger conditions. The maximum number of conditions allowed per trigger is 50. Leave requirements.json as is (do not translate)"
126+
value: "The requirements.json file contains too many custom object trigger conditions. The current limit is %{max} conditions per trigger. This app has %{count} conditions for trigger %{trigger_title}."
127+
screenshot: "https://drive.google.com/file/d/1szSaYRTeIcHux5nMJg3Yxyct1Obxa-wv/view?usp=sharing"
128+
- translation:
129+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_v2_trigger_actions"
130+
title: "App builder job: requirements file contains too many custom object trigger actions. The maximum number of actions allowed per trigger is 25. Leave requirements.json as is (do not translate)"
131+
value: "The requirements.json file contains too many custom object trigger actions. The current limit is %{max} actions per trigger. This app has %{count} actions for trigger %{trigger_title}."
132+
screenshot: "https://drive.google.com/file/d/18jXaM7_OnPqHAg6jAxJrTrgX1v_H156_/view?usp=sharing"
133+
- translation:
134+
key: "txt.apps.admin.error.app_build.excessive_cov2_dropdown_fields_per_object"
135+
title: "App builder job: requirements file contains too many custom object fields of type dropdown. The maximum number of fields of type dropdown per object is 5. Leave requirements.json as is (do not translate)"
136+
value: "The requirements.json file contains too many custom object fields of type dropdown. The current limit is %{max} fields per object. This app has %{count} fields of type dropdown for object %{object_key}."
137+
screenshot: "https://drive.google.com/file/d/1hILvdZQXZCtkQVupYXedPbnD_rNN4nwH/view?usp=sharing"
138+
- translation:
139+
key: "txt.apps.admin.error.app_build.excessive_cov2_multiselect_fields_per_object"
140+
title: "App builder job: requirements file contains too many custom object fields of type multiselect. The maximum number of fields of type multiselect per object is 5. Leave requirements.json as is (do not translate)"
141+
value: "The requirements.json file contains too many custom object fields of type multiselect. The current limit is %{max} fields per object. This app has %{count} fields of type multiselect for object %{object_key}."
142+
screenshot: "https://drive.google.com/file/d/1RJgWEKXv7Zkt7V2Vh3QZyl55W9QOC6Z9/view?usp=sharing"
143+
- translation:
144+
key: "txt.apps.admin.error.app_build.excessive_cov2_field_options"
145+
title: "App builder job: requirements file contains too many options for custom object field of type dropdown or multiselect. The maximum number of options of type dropdown or multiselect per field is 10. Leave requirements.json as is (do not translate)"
146+
value: "The requirements.json file contains too many options for custom object field %{field_key}. The current limit is %{max} options per field. This app has %{count} options for field %{field_key} in object %{object_key}."
147+
screenshot: "https://drive.google.com/file/d/1ipP9khKzDdaDxWgKT1WyBG2D2c8HPc0P/view?usp=sharing"
148+
- translation:
149+
key: "txt.apps.admin.error.app_build.excessive_cov2_relationship_filter_conditions"
150+
title: "App builder job: requirements file contains too many conditions in relationship filter for lookup fields. The maximum number of conditions allowed in the relationship filter per field is 20. Leave requirements.json as is (do not translate)"
151+
value: "The requirements.json file contains too many conditions in relationship filter for custom object field %{field_key}. The current limit is %{max} conditions per field. This app has %{count} conditions for field %{field_key} in object %{object_key}."
152+
"screenshot": "https://drive.google.com/file/d/13J6GIkq3CXGqRwV5KRHouXulRVuwQnNi/view?usp=sharing"
153+
key: "txt.apps.admin.error.app_build.missing_cov2_object_schema_key"
154+
title: "App builder job: requirements file is missing a custom object schema key. These are the required keys: (key, title, title_pluralized, include_in_list_view). Leave requirements.json as is (do not translate)"
155+
value: "The requirements.json file is missing custom object schema key for object %{object_key}. The following key is required: %{missing_key}."
156+
"screenshot": "https://drive.google.com/file/d/15iZemfkt14z96W4zmDHw1kodU70UxMYs/view?usp=sharing"
157+
- translation:
158+
key: "txt.apps.admin.error.app_build.missing_cov2_field_schema_key"
159+
title: "App builder job: requirements file is missing a custom object field schema key. These are the required keys: (key, title, type, object_key). Leave requirements.json as is (do not translate)"
160+
value: "The requirements.json file is missing custom object field schema key for field %{field_key} and object %{object_key}. The following key is required: %{missing_key}."
161+
"screenshot": "https://drive.google.com/file/d/1ygm89vlBBD72Pc4gS8TW2arYRcaxdvIY/view?usp=sharing"
162+
- translation:
163+
key: "txt.apps.admin.error.app_build.missing_cov2_trigger_schema_key"
164+
title: "App builder job: requirements file is missing a custom object trigger schema key. These are the required keys: (title, actions, conditions, object_key). Leave requirements.json as is (do not translate)"
165+
value: "The requirements.json file is missing custom object trigger schema key for trigger %{trigger_title} and object %{object_key}. The following key is required: %{missing_key}."
166+
"screenshot": "https://drive.google.com/file/d/1XpwG7mxPTaI-My3fG2xGyxdEfE3LbECt/view?usp=sharing"
167+
- translation:
168+
key: "txt.apps.admin.error.app_build.empty_cov2_trigger_conditions"
169+
title: "App builder job: requirements file contains an empty conditions array for custom object trigger. Leave requirements.json as is (do not translate)"
170+
value: "The requirements.json file contains an empty conditions array for custom object trigger %{trigger_title} in object %{object_key}."
171+
"screenshot": "https://drive.google.com/file/d/1dU534_37__yrqX9lQujjgTJeCV5Y5FIp/view?usp=sharing"
108172
- translation:
109173
key: "txt.apps.admin.error.app_build.missing_required_fields"
110174
title: "App builder job: required key missing in requirements, e.g. \"title\" is required in \"my_custom_email_target\""

lib/zendesk_apps_support.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module Validations
3232
autoload :Requests, 'zendesk_apps_support/validations/requests'
3333
autoload :Banner, 'zendesk_apps_support/validations/banner'
3434
autoload :Svg, 'zendesk_apps_support/validations/svg'
35+
autoload :CustomObjectsV2, 'zendesk_apps_support/validations/custom_objects_v2'
3536
end
3637

3738
class Manifest

lib/zendesk_apps_support/app_requirement.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class AppRequirement
66
CUSTOM_OBJECTS_KEY = 'custom_objects'
77
CUSTOM_OBJECTS_TYPE_KEY = 'custom_object_types'
88
CUSTOM_OBJECTS_RELATIONSHIP_TYPE_KEY = 'custom_object_relationship_types'
9+
CUSTOM_OBJECTS_V2_KEY = 'custom_objects_v2'
910
TYPES = %w[automations channel_integrations custom_objects macros targets views ticket_fields
10-
triggers user_fields organization_fields webhooks].freeze
11+
triggers user_fields organization_fields webhooks custom_objects_v2].freeze
1112
end
1213
end

0 commit comments

Comments
 (0)