zuora_connect_ui 0.11.8 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/zuora_connect_ui/app.js.erb +1 -1
- data/app/helpers/zuora_connect_ui/application_helper.rb +0 -39
- data/app/helpers/zuora_connect_ui/asset_helper.rb +37 -0
- data/app/views/partials/_table.html.erb +2 -2
- data/app/views/zuora_connect_ui/_nav.html.erb +14 -0
- data/lib/zuora_connect_ui/version.rb +1 -1
- data/lib/zuora_connect_ui.rb +9 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af05f9c154c0a34817597e9adf7229897d218a74dc31e8f3913701224c608453
|
4
|
+
data.tar.gz: fc815683a22743e2f346cb57f1f7072f54c4ff3c2f7fcdc089e08b82ce6901bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e4141390d9ed416295554014ae6529bc1bce7dc0cdca4d2ea8e6f99410ef20f61a7ce1c8c46aee57d115f05473f5a2bd908a08331f1751776ba42d1c452128e
|
7
|
+
data.tar.gz: 0ecfba913b5f1a6d2ddf2966b1fcf325b90465692dc32faa85fd8c22bc6c011946a136fd4194f77c980738e38ae9ce9389b0bd8a0288c10e461fd071df10fb12
|
@@ -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
|
@@ -75,7 +75,7 @@
|
|
75
75
|
'<%= table_name %>',
|
76
76
|
{
|
77
77
|
columns: <%= raw columns.to_json %>,
|
78
|
-
filters: <%=
|
78
|
+
filters: <%= json_escape table_filters.to_json.html_safe %>,
|
79
79
|
view: '<%= table_views.select { |k, v| v == true }.first[0].to_s %>',
|
80
80
|
size: <%= initial_size %>,
|
81
81
|
sort: <%= raw sort %>
|
@@ -258,7 +258,7 @@
|
|
258
258
|
'<%= table_name %>',
|
259
259
|
{ view, size },
|
260
260
|
columns,
|
261
|
-
<%=
|
261
|
+
<%= json_escape table_filters.to_json.html_safe %>
|
262
262
|
);
|
263
263
|
|
264
264
|
}
|
@@ -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-v2>
|
8
|
+
<div slot="breadcrumbContent">
|
9
|
+
<%= yield %>
|
10
|
+
</div>
|
11
|
+
</z-unified-nav-v2>
|
12
|
+
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.zuora.com/@platform-ui/nav-v2/main.js"></script>
|
13
|
+
<% end %>
|
14
|
+
|
data/lib/zuora_connect_ui.rb
CHANGED
@@ -11,4 +11,13 @@ require 'peek/views/connect'
|
|
11
11
|
|
12
12
|
# UI for Connect Applications
|
13
13
|
module ZuoraConnectUi
|
14
|
+
class << self
|
15
|
+
def app_parent_name
|
16
|
+
if Rails::VERSION::MAJOR >= 6
|
17
|
+
Rails.application.class.module_parent_name
|
18
|
+
else
|
19
|
+
Rails.application.class.parent_name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
14
23
|
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.
|
4
|
+
version: 0.12.1
|
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-
|
11
|
+
date: 2021-10-29 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.
|
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.
|
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
|