zendesk_apps_support 3.1.3 → 3.1.4

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: 0109ce4105d60dea50f5b3a1fd4ef1be8f846f97
4
- data.tar.gz: ed2fbeaef6580326d51ffe0168f509962b3a3353
3
+ metadata.gz: 0135f4e989070c7aed5d46bfeea4b70d6b8db5cd
4
+ data.tar.gz: 9f0f660725a7a3d29e0c55472276c23e8767505d
5
5
  SHA512:
6
- metadata.gz: 8c9adc260e3f74ae811b728a05988a42c81542c96bbb1c004f524b61d99f9cac393bb3ce1bf9660b167e0042e79fdc3e0c7648587cc5b84adbc1d1ea754736b4
7
- data.tar.gz: 69aa0c73c61277e9d2816cd39884fbf0f5435c3736b49f92d67c19f877a44487c83b60f6b13bc45b3b5bfab0a987396cb5da1dd0b77bc54e5aeb257ba181634f
6
+ metadata.gz: c82edf95d8a62192e522af3dd43dc33ba2c1ac5fdc78d38b3256166b58d0dbc51772bb3321c7b98664c740fb64a0b90037b00af4d8cf859c1f40f1eab1af923e
7
+ data.tar.gz: 83b3fc838adeb1c6203405c6fd41fd76777d764b3ee7d40603bc0edc75a22b9e8732d4f07dff6629d38694ed702b9ed1cdaeb266e29b4488aec8e515f8cb1039
@@ -46,7 +46,7 @@ parts:
46
46
  value: "Symlinks are not allowed in the zip file"
47
47
  - translation:
48
48
  key: "txt.apps.admin.error.app_build.invalid_experiment"
49
- title: "App builder job: experiment has been specifed that is not publically available or otherwise invalid"
49
+ title: "App builder job: an experiment has been specifed that is not publically available or otherwise invalid. https://en.wikipedia.org/wiki/Manifest_file"
50
50
  value: "Manifest specifies unknown or unavailable experiment: %{experiment}"
51
51
  - translation:
52
52
  key: "txt.apps.admin.error.app_build.missing_requirements"
@@ -19,6 +19,7 @@ var app = ZendeskApps.defineApp(<%= iframe_only ? 'null' : 'source' %>)
19
19
  .reopen({
20
20
  appName: <%= name.to_json %>,
21
21
  appVersion: <%= version.to_json %>,
22
+ locationIcons: <%= location_icons.to_json %>,
22
23
  assetUrlPrefix: <%= asset_url_prefix.to_json %>,
23
24
  appClassName: <%= app_class_name.to_json %>,
24
25
  author: {
@@ -3,8 +3,14 @@ module ZendeskAppsSupport
3
3
  extend ZendeskAppsSupport::Finders
4
4
  attr_reader :id, :name, :orderable, :product_code
5
5
 
6
+ def self.unique_ids
7
+ @ids ||= Set.new
8
+ end
9
+
6
10
  def initialize(attrs)
7
11
  @id = attrs.fetch(:id)
12
+ raise 'Duplicate id' if Location.unique_ids.include? @id
13
+ Location.unique_ids.add @id
8
14
  @name = attrs.fetch(:name)
9
15
  @orderable = attrs.fetch(:orderable)
10
16
  @product_code = attrs.fetch(:product_code)
@@ -27,7 +33,8 @@ module ZendeskAppsSupport
27
33
  Location.new(id: 5, orderable: true, name: 'user_sidebar', product_code: Product::SUPPORT.code),
28
34
  Location.new(id: 6, orderable: true, name: 'organization_sidebar', product_code: Product::SUPPORT.code),
29
35
  Location.new(id: 7, orderable: false, name: 'background', product_code: Product::SUPPORT.code),
30
- Location.new(id: 8, orderable: true, name: 'chat_sidebar', product_code: Product::CHAT.code)
36
+ Location.new(id: 8, orderable: true, name: 'chat_sidebar', product_code: Product::CHAT.code),
37
+ Location.new(id: 9, orderable: false, name: 'modal', product_code: Product::SUPPORT.code)
31
38
  ].freeze
32
39
  end
33
40
  end
@@ -68,7 +68,7 @@ module ZendeskAppsSupport
68
68
  end
69
69
 
70
70
  def enabled_experiments
71
- (experiments || {}).select { |k, v| v }.keys
71
+ (experiments || {}).select { |_k, v| v }.keys
72
72
  end
73
73
 
74
74
  def initialize(manifest_text)
@@ -15,6 +15,8 @@ module ZendeskAppsSupport
15
15
  DEFAULT_SCSS = File.read(File.expand_path('../assets/default_styles.scss', __FILE__))
16
16
  SRC_TEMPLATE = Erubis::Eruby.new(File.read(File.expand_path('../assets/src.js.erb', __FILE__)))
17
17
 
18
+ LOCATIONS_WITH_ICONS = ['top_bar', 'nav_bar']
19
+
18
20
  attr_reader :lib_root, :root, :warnings
19
21
 
20
22
  def initialize(dir, is_cached = true)
@@ -131,6 +133,7 @@ module ZendeskAppsSupport
131
133
  source: source,
132
134
  app_settings: app_settings,
133
135
  asset_url_prefix: asset_url_prefix,
136
+ location_icons: location_icons,
134
137
  app_class_name: app_class_name,
135
138
  author: manifest.author,
136
139
  translations: runtime_translations(translations_for(locale)),
@@ -278,6 +281,30 @@ module ZendeskAppsSupport
278
281
  read_file('app.js')
279
282
  end
280
283
 
284
+ def location_icons
285
+ {}.tap do |location_icons|
286
+ manifest.locations.each do |host, locations_for_host|
287
+ next unless [Product::SUPPORT.name].include?(host)
288
+
289
+ locations_for_host.keys.each do |location|
290
+ next unless LOCATIONS_WITH_ICONS.include?(location)
291
+ location_icons[host] ||= {}
292
+ location_icons[host][location] = if (has_file?("assets/icon_#{location}.svg"))
293
+ { 'svg' => "icon_#{location}.svg" }
294
+ elsif (has_file?("assets/icon_#{location}_inactive.png"))
295
+ {
296
+ 'inactive' => "icon_#{location}_inactive.png",
297
+ 'active' => has_file?("assets/icon_#{location}_active.png") ? "icon_#{location}_active.png" : "icon_#{location}_inactive.png",
298
+ 'hover' => has_file?("assets/icon_#{location}_hover.png") ? "icon_#{location}_hover.png" : "icon_#{location}_inactive.png"
299
+ }
300
+ else
301
+ {}
302
+ end
303
+ end
304
+ end
305
+ end
306
+ end
307
+
281
308
  def commonjs_modules
282
309
  return {} unless has_lib_js?
283
310
 
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  module ZendeskAppsSupport
2
3
  module Validations
3
4
  module Marketplace
4
- WHITELISTED_EXPERIMENTS = [].freeze
5
+ WHITELISTED_EXPERIMENTS = ['hashParams'].freeze
5
6
 
6
7
  class << self
7
8
  def call(package)
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.1.3
4
+ version: 3.1.4
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: 2016-10-19 00:00:00.000000000 Z
14
+ date: 2016-10-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n