gitlab_support_readiness 1.0.98 → 1.0.100

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e486d9f6b43546f5073304d53ef0c734283094c406ed2404caf05668d0571ab1
4
- data.tar.gz: 1cd5d00382324ceaf28d8f919eeb522e46ba1c0782aa6cb6fb1ac16630516609
3
+ metadata.gz: bd668f8279a038f07a29196b03ca2508735409f05d5f37ac21ddedd696f03d45
4
+ data.tar.gz: 3a654bd592244b2f4f590f5eacb237178338ca95bb95552797f50c112164b87f
5
5
  SHA512:
6
- metadata.gz: 0fa52abd690bce0672c7a30685ddfac93053c784345b90ae73c3fa136827cddbe4e87ee31066fc38a1d6ff33c0e8ec2fa9872c156d6cde59fd41f80c2a43530b
7
- data.tar.gz: fcbf5633e740a1dcc1c4a3aa730a954ce0e3ddde3fe738cbe9546ef5549c2f1140b21c25863972a1e1b7a0955a7e3070702f4c38564619c69b0b3f0dbafde488
6
+ metadata.gz: 931ae18f681cb58209121d7fd288d53be5a27d488e0b1f84a8fdb74aaa63e2429c0f19cc9cee198a9ef70b927350ff54c000b475bef34ff9426eb63631647530
7
+ data.tar.gz: 174bd0322a0b07654678e58b6ef4ac7eb54e8113e824d7295758c4f5dd531ca6a2caa5cbea0e2aa317400eb1a2c5d6cb673bbb26d0d3874fe37337e0ab2c6dad
@@ -20,6 +20,7 @@ module Readiness
20
20
  # @param verbose [Boolean] Whether you want a detailed report or not
21
21
  # @return [Hash]
22
22
  def self.compare(zendesk_client, location = 'data', verbose = false)
23
+ @zendesk_client = zendesk_client
23
24
  @locales = Zendesk::Locales.list(zendesk_client)
24
25
  @from_repo = gather(location)
25
26
  @from_zendesk = Zendesk::DynamicContent.list(zendesk_client)
@@ -183,11 +184,14 @@ module Readiness
183
184
  # pp repo.count
184
185
  # # => 2
185
186
  def self.gather(location)
187
+ @ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
188
+ @ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
186
189
  @errors = []
187
190
  @location = location
188
191
  array = []
189
192
  Dir["#{@location}/*.yaml"].each do |f|
190
193
  object = YAML.safe_load_file(f)
194
+ object = convert_names_to_ids(object)
191
195
  data = {
192
196
  item: Zendesk::DynamicContent.new(object),
193
197
  variants: object['variants'].map { |v| Zendesk::DynamicContentVariants.new(v) }
@@ -199,6 +203,24 @@ module Readiness
199
203
  array
200
204
  end
201
205
 
206
+ ##
207
+ # Converts various user Strings to the proper ID value
208
+ #
209
+ # @author Jason Colyer
210
+ # @since 1.0.100
211
+ # @param content [Hash] The dynamic content information from the YAML file
212
+ # @return [Hash]
213
+ def self.convert_names_to_ids(dynamic_content)
214
+ dynamic_content['variants'].each_with_index do |v, i|
215
+ if v['content'] =~ /\[Form\:\ .*\]/
216
+ name = v['content'].split('[Form: ').last.split(']').first
217
+ ticket_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, name, @ticket_forms)
218
+ dynamic_content['variants'][i]['content'] = v['content'].gsub("[Form: #{ticket_form.name}]", ticket_form.id.to_s)
219
+ end
220
+ end
221
+ dynamic_content
222
+ end
223
+
202
224
  ##
203
225
  # Outputs an error report and exits with a status code of 1
204
226
  #
@@ -271,6 +271,10 @@ module Readiness
271
271
  'Quarter',
272
272
  'Quick Start with HA (less than 10,000 users)',
273
273
  'Quick Start without HA, less than 500 users',
274
+ 'Success Essentials - Monthly',
275
+ 'Success Essentials - 3 Year',
276
+ 'Success Essentials - 2 Year',
277
+ 'Success Essentials - 1 Year',
274
278
  'Training LMS Settlement Revenue',
275
279
  'Training Workshop',
276
280
  'Training Workshop | OneTime',
@@ -640,11 +644,7 @@ module Readiness
640
644
  'Self-Managed - Success Plan Services - 1 Year',
641
645
  'Self-Managed - Success Plan Services - 2 Year',
642
646
  'Self-Managed - Success Plan Services - 3 Year',
643
- 'Self-Managed - Success Plan Services - Monthly',
644
- 'Success Essentials - Monthly',
645
- 'Success Essentials - 3 Year',
646
- 'Success Essentials - 2 Year',
647
- 'Success Essentials - 1 Year'
647
+ 'Self-Managed - Success Plan Services - Monthly'
648
648
  ]
649
649
  end
650
650
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.98
4
+ version: 1.0.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport