zuora_connect_ui 0.11.10 → 0.12.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
  SHA256:
3
- metadata.gz: b814d8ac542159f70adac2108817708c5683225157c53383cde242f973b91d87
4
- data.tar.gz: 306c03c601123b736c92f374526f0cb8ec7da13f41d8b449087e223b4ff3f686
3
+ metadata.gz: faa039a8e3a2c5c8677899d9b3efa7621afde9061f3c73cc6e43c8fcafe154d1
4
+ data.tar.gz: b918e77cfd652de7b612014509d819f5ac211b3cb379eac84a6cc5b90b1c40c0
5
5
  SHA512:
6
- metadata.gz: d16cc771c62d344017a08cfb1435b097ff1fda7fd30b0de4468722918517f60efb03e671067dc807b02ec1d059a6c841a1059012b6a56566df6487a5b85b8339
7
- data.tar.gz: 1961b81766f8c652a9d61f64f5a2ed195a82251cee7ae61ec23c2536e44edc6fa19c83555f2aa1427169ef25128d475126b3a8bacf42a3a6f9be3229c9452143
6
+ metadata.gz: e9238494ff53bdcc8b66e2ae693072f6db3376f109f3b78644ffd397061adc6fb447d8e43149d46044b04165120ac5ddf4419197fbf564d23efbb213d3818de4
7
+ data.tar.gz: f2fe8a38cea09e962c36e1de8437bea217920ca306d22d461ad3d87ea7f617080e947497277dc9e18d1d70055fcb55256773c67ce32b32ad165e1c3b7bc9ae21
@@ -6,44 +6,5 @@ module ZuoraConnectUi
6
6
  def zuo_parameterize(string)
7
7
  string.parameterize(separator: '_')
8
8
  end
9
-
10
- def zuo_include_tag
11
- script_tag(type: 'module', src: anjuna(ANJUNA_VERSION, true)) +
12
- script_tag(nomodule: '', src: anjuna(ANJUNA_VERSION, false)) +
13
- script_tag(type: 'module', src: charts(ANJUNA_VERSION, true)) +
14
- script_tag(nomodule: '', src: charts(ANJUNA_VERSION, false)) +
15
- link_tag(href: theme(THEME_VERSION, 'application'), rel: 'stylesheet') +
16
- link_tag(href: theme(THEME_VERSION, 'theme'), rel: 'stylesheet') +
17
- link_tag(href: theme(THEME_VERSION, 'icons'), rel: 'stylesheet')
18
- end
19
-
20
- def script_tag(attrs)
21
- attr_map = attrs.map { |key, value| " #{key}=\"#{value}\"" }
22
-
23
- "<script#{attr_map.join('')}></script>".html_safe
24
- end
25
-
26
- def anjuna(version, esm)
27
- "https://cdn.zuora.com/@anjuna/core@#{version}" \
28
- "/anjuna-core/anjuna-core#{'.esm' if esm}.js"
29
- end
30
-
31
- def charts(version, esm)
32
- "https://cdn.zuora.com/@anjuna/charts@#{version}" \
33
- "/anjuna-charts/anjuna-charts#{'.esm' if esm}.js"
34
- end
35
-
36
- def link_tag(attrs)
37
- attr_map = attrs.map { |key, value| " #{key}=\"#{value}\"" }
38
-
39
- "<link#{attr_map.join('')}>".html_safe
40
- end
41
-
42
- def theme(version, file)
43
- "https://cdn.zuora.com/@anjuna/theme@#{version}/css/#{file}.css"
44
- end
45
-
46
- ANJUNA_VERSION = '1.2.14'
47
- THEME_VERSION = '1.2.14'
48
9
  end
49
10
  end
@@ -3,5 +3,42 @@
3
3
  module ZuoraConnectUi
4
4
  # Helper methods for including CDN links in views
5
5
  module AssetHelper
6
+ ANJUNA_VERSION = '1.2.14'
7
+ ANJUNA_CORE_URL = "https://cdn.zuora.com/@anjuna/core@#{ANJUNA_VERSION}/anjuna-core/anjuna-core.js"
8
+ ANJUNA_CHARTS_URL = "https://cdn.zuora.com/@anjuna/charts@#{ANJUNA_VERSION}/anjuna-charts/anjuna-charts.js"
9
+
10
+ def zuo_include_tag
11
+ anjuna_core + anjuna_charts + anjuna_theme
12
+ end
13
+
14
+ private
15
+
16
+ def to_esm(url)
17
+ url.gsub('.js', '.esm.js')
18
+ end
19
+
20
+ # NOTE(hartley): nomodule was added as an explict boolean attribute in Rails
21
+ # 6.1, meaning 'nomodule: true' should be used once minimum version is 6.1
22
+ # However, for consistency with older versions we have to specify 'nomodule'
23
+ # as the value
24
+ def anjuna_core
25
+ tag.script(type: 'module', src: to_esm(ANJUNA_CORE_URL)) +
26
+ tag.script(nomodule: 'nomodule', src: ANJUNA_CORE_URL)
27
+ end
28
+
29
+ def anjuna_charts
30
+ tag.script(type: 'module', src: to_esm(ANJUNA_CHARTS_URL)) +
31
+ tag.script(nomodule: 'nomodule', src: ANJUNA_CHARTS_URL)
32
+ end
33
+
34
+ def anjuna_theme
35
+ tag.link(href: anjuna_theme_url('application'), rel: 'stylesheet') +
36
+ tag.link(href: anjuna_theme_url('theme'), rel: 'stylesheet') +
37
+ tag.link(href: anjuna_theme_url('icons'), rel: 'stylesheet')
38
+ end
39
+
40
+ def anjuna_theme_url(file)
41
+ "https://cdn.zuora.com/@anjuna/theme@#{ANJUNA_VERSION}/css/#{file}.css"
42
+ end
6
43
  end
7
44
  end
@@ -0,0 +1,14 @@
1
+ <% layout_id = "HTTP_ZUORA_LAYOUT_FETCH_TEMPLATE_ID" %>
2
+ <% ui_path = "HTTP_ZUORA_UI_PATH" %>
3
+
4
+ <% if request.headers[layout_id].present? || (!request.headers[ui_path].present? && !Rails.env.development?) %>
5
+ <%= yield %>
6
+ <% else %>
7
+ <z-unified-nav-for-spas>
8
+ <div slot="breadcrumbContent">
9
+ <%= yield %>
10
+ </div>
11
+ </z-unified-nav-for-spas>
12
+ <script type="text/javascript" src="//cdn.zuora.com/@platform-ui/nav/bootstrap.js"></script>
13
+ <% end %>
14
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZuoraConnectUi
4
- VERSION = '0.11.10'
4
+ VERSION = '0.12.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.10
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.0'
75
+ version: '5.1'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '5.0'
82
+ version: '5.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: select2-rails
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -358,6 +358,7 @@ files:
358
358
  - app/views/partials/_row_actions.html.erb
359
359
  - app/views/partials/_table.html.erb
360
360
  - app/views/peek/views/_connect.html.erb
361
+ - app/views/zuora_connect_ui/_nav.html.erb
361
362
  - config/initializers/oj.rb
362
363
  - lib/peek/views/connect.rb
363
364
  - lib/zuora_connect_ui.rb