zendesk_apps_support 4.7.0 → 4.8.0

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
  SHA1:
3
- metadata.gz: e5f380d93312cbad637e1308b61fd50c5ee5e99f
4
- data.tar.gz: 735b32435835edbfb61f5fc9fefbf3dceef504bb
3
+ metadata.gz: 71399707e0ecd6f966325f38b0775dd0152aac95
4
+ data.tar.gz: 63ac9ddf5049f9e97e3e319c9f3e5de2d6649539
5
5
  SHA512:
6
- metadata.gz: 1b34a05f19120bc943742eeb50f59d6a13e2b92fd506225ed0bc6fb849c18218e75680f02d71bdbf94fa9a4daae2b206bf888eb7113d975e0239af66c5938c6e
7
- data.tar.gz: 8d77191fd9e3ac310a255c45af6dc899070794f12edeeecf2f3038ea2123b73284b2c98589aafc18c3e5d74faa786ba0e6cabe15b3351da3b9cf1030409568c9
6
+ metadata.gz: ff45c5c0237796b3097d0d58406ea875a42bb2752cc20697d982b0ee5d698d4a3a42447c0f5b4bba81ecec78e817a472c1996af8d9eb07591e5092b69ff30818
7
+ data.tar.gz: 1ef5e2c7b2dc0bbb777badc4bc81acbdf9ba42977e559e41d21ebaeb6dedb0b2733ee902b109da93ca9410ac72a81d03416fcbc65661f18d1fe6371854e7e887
@@ -21,6 +21,7 @@ var app = ZendeskApps.defineApp(<%= iframe_only ? 'null' : 'source' %>)
21
21
  appVersion: <%= version.to_json %>,
22
22
  locationIcons: <%= location_icons.to_json %>,
23
23
  assetUrlPrefix: <%= asset_url_prefix.to_json %>,
24
+ logoAssetHash: <%= logo_asset_hash.to_json %>,
24
25
  appClassName: <%= app_class_name.to_json %>,
25
26
  author: {
26
27
  name: <%= author['name'].to_json %>,
@@ -126,6 +126,7 @@ module ZendeskAppsSupport
126
126
  source: source,
127
127
  app_class_properties: manifest.app_class_properties,
128
128
  asset_url_prefix: asset_url_prefix,
129
+ logo_asset_hash: generate_logo_hash(manifest.products),
129
130
  location_icons: location_icons,
130
131
  app_class_name: app_class_name,
131
132
  author: manifest.author,
@@ -248,6 +249,15 @@ module ZendeskAppsSupport
248
249
 
249
250
  private
250
251
 
252
+ def generate_logo_hash(products)
253
+ {}.tap do |logo_hash|
254
+ products.each do |product|
255
+ product_directory = products.count > 1 ? "#{product.name.downcase}/" : ''
256
+ logo_hash[product.name.downcase] = "#{product_directory}logo-small.png"
257
+ end
258
+ end
259
+ end
260
+
251
261
  def has_valid_manifest?(errors)
252
262
  has_manifest? && errors.flatten.empty?
253
263
  end
@@ -289,34 +299,35 @@ module ZendeskAppsSupport
289
299
 
290
300
  host = location_options.location.product.name
291
301
  location = location_options.location.name
292
- location_icons[host][location] = build_location_icons_hash(location)
302
+ product_directory = manifest.products.count > 1 ? "#{host}/" : ''
303
+ location_icons[host][location] = build_location_icons_hash(location, product_directory)
293
304
  end
294
305
  end
295
306
  end
296
307
 
297
- def build_location_icons_hash(location)
308
+ def build_location_icons_hash(location, product_directory)
298
309
  inactive_png = "icon_#{location}_inactive.png"
299
- if has_file?("assets/icon_#{location}.svg")
300
- build_svg_icon_hash(location)
301
- elsif has_file?("assets/#{inactive_png}")
302
- build_png_icons_hash(location)
310
+ if has_file?("assets/#{product_directory}icon_#{location}.svg")
311
+ build_svg_icon_hash(location, product_directory)
312
+ elsif has_file?("assets/#{product_directory}#{inactive_png}")
313
+ build_png_icons_hash(location, product_directory)
303
314
  else
304
315
  {}
305
316
  end
306
317
  end
307
318
 
308
- def build_svg_icon_hash(location)
319
+ def build_svg_icon_hash(location, product_directory)
309
320
  cache_busting_param = "?#{Time.now.to_i}" unless @is_cached
310
- { 'svg' => "icon_#{location}.svg#{cache_busting_param}" }
321
+ { 'svg' => "#{product_directory}icon_#{location}.svg#{cache_busting_param}" }
311
322
  end
312
323
 
313
- def build_png_icons_hash(location)
314
- inactive_png = "icon_#{location}_inactive.png"
324
+ def build_png_icons_hash(location, product_directory)
325
+ inactive_png = "#{product_directory}icon_#{location}_inactive.png"
315
326
  {
316
327
  'inactive' => inactive_png
317
328
  }.tap do |icon_state_hash|
318
329
  %w(active hover).each do |state|
319
- specific_png = "icon_#{location}_#{state}.png"
330
+ specific_png = "#{product_directory}icon_#{location}_#{state}.png"
320
331
  selected_png = has_file?("assets/#{specific_png}") ? specific_png : inactive_png
321
332
  icon_state_hash[state] = selected_png
322
333
  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: 4.7.0
4
+ version: 4.8.0
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: 2018-01-09 00:00:00.000000000 Z
14
+ date: 2018-01-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  version: 1.3.6
275
275
  requirements: []
276
276
  rubyforge_project:
277
- rubygems_version: 2.6.13
277
+ rubygems_version: 2.6.8
278
278
  signing_key:
279
279
  specification_version: 4
280
280
  summary: Support to help you develop Zendesk Apps.