zuora_connect_ui 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +45 -0
- data/app/assets/javascripts/zuora_connect_ui/datatable.js +9 -2
- data/app/assets/stylesheets/zuora_connect_ui/datatables.scss +5 -0
- data/app/helpers/datatable_helper.rb +1 -0
- data/app/helpers/zuora_connect_ui/application_helper.rb +1 -1
- data/app/views/partials/_row_actions.html.erb +6 -8
- data/app/views/partials/_table.html.erb +9 -4
- data/lib/zuora_connect_ui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d5ca8164ff72904c292a9ab04f5d468e8d0fcda13ecddf12f79ca08ef9b5e42
|
|
4
|
+
data.tar.gz: 64b91976e4b354b4138a9c61bdd9b001b82fdc8aa94c7ee03c642a233c78ac54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54707f9e36c36af95f33fa345b5bfe5ae8e349a33d5d681175017300a84f49ce1ce8db39a20b3a7a19c34b387102804143fa4836a619ab8aad7adffeb26a4856
|
|
7
|
+
data.tar.gz: cbb57d1a315a891439fcf045e8ff36e3fa12c79708d02b1ea6b5b498c4cdbd70e4883165997f031674584fcc52bfc9169b280ccd4d3c73f30516e9b020bdca4b
|
data/README.md
CHANGED
|
@@ -139,6 +139,51 @@ Partial: `partials/row_actions'
|
|
|
139
139
|
<% end %>
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
### Table
|
|
143
|
+
|
|
144
|
+
#### Classes
|
|
145
|
+
|
|
146
|
+
| Class | Description |
|
|
147
|
+
| ---------------- | --------------------------------------------- |
|
|
148
|
+
| `.zuo-table` | Base table class |
|
|
149
|
+
| `.zuo-table__th` | Header cell class (for `th`-like container) |
|
|
150
|
+
| `.zuo-table__tr` | Content cell class (for `td`-like container) |
|
|
151
|
+
|
|
152
|
+
#### Example
|
|
153
|
+
|
|
154
|
+
```erb
|
|
155
|
+
<table class="zuo-table">
|
|
156
|
+
<tr>
|
|
157
|
+
<th class="zuo-table__th">Description</th>
|
|
158
|
+
<th class="zuo-table__th">Status</th>
|
|
159
|
+
<th class="zuo-table__th">Priority</th>
|
|
160
|
+
<th class="zuo-table__th">Action</th>
|
|
161
|
+
</tr>
|
|
162
|
+
<% @notifications.each do |n|%>
|
|
163
|
+
<tr>
|
|
164
|
+
<td class="zuo-table__td"><%= n.metadata["description"]%></td>
|
|
165
|
+
<td class="zuo-table__td"><%= n.status %></td>
|
|
166
|
+
<td class="zuo-table__td"><%= n.priority %></td>
|
|
167
|
+
<td class="zuo-table__td">
|
|
168
|
+
<anj-button href="<%= tools_promos_path %>" shape="circle" context="icon" data-remote="true">
|
|
169
|
+
<i class="z-icon-search"></i>
|
|
170
|
+
</anj-button>
|
|
171
|
+
<anj-button href="<%= tools_promos_path %>" shape="circle" context="icon" data-remote="true">
|
|
172
|
+
<i class="z-icon-pencil"></i>
|
|
173
|
+
</anj-button>
|
|
174
|
+
<anj-button href="<%= tools_promos_path %>" shape="circle" context="icon" data-remote="true">
|
|
175
|
+
<i class="z-icon-trash"></i>
|
|
176
|
+
</anj-button>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
<% end %>
|
|
180
|
+
</table>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Datatable
|
|
184
|
+
|
|
185
|
+
See [datatable.md](doc/datatable.md)
|
|
186
|
+
|
|
142
187
|
## Components
|
|
143
188
|
|
|
144
189
|
Component's labels must come directly after their input, and have `for` html attribute corresponding to their input.
|
|
@@ -11,20 +11,27 @@ $('a[data-toggle="tab"]').on("shown.bs.tab", function(e) {
|
|
|
11
11
|
|
|
12
12
|
const zStorage = (function() {
|
|
13
13
|
const stores = {};
|
|
14
|
+
let warning = false;
|
|
15
|
+
|
|
16
|
+
function logWarning(error) {
|
|
17
|
+
if (warning) return;
|
|
18
|
+
console.warn('Table State cannot be saved in Safari');
|
|
19
|
+
warning = true;
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
return {
|
|
16
23
|
set(key, value, table) {
|
|
17
24
|
if (!stores.hasOwnProperty(table)) {
|
|
18
25
|
stores[table] = new idbKeyval.Store(APP_NAME, table + "_table");
|
|
19
26
|
}
|
|
20
|
-
return idbKeyval.set(key, value, stores[table]);
|
|
27
|
+
return idbKeyval.set(key, value, stores[table]).catch(logWarning);
|
|
21
28
|
},
|
|
22
29
|
|
|
23
30
|
get(key, table) {
|
|
24
31
|
if (!stores.hasOwnProperty(table)) {
|
|
25
32
|
stores[table] = new idbKeyval.Store(APP_NAME, table + "_table");
|
|
26
33
|
}
|
|
27
|
-
return idbKeyval.get(key, stores[table]);
|
|
34
|
+
return idbKeyval.get(key, stores[table]).catch(logWarning);
|
|
28
35
|
}
|
|
29
36
|
};
|
|
30
37
|
})();
|
|
@@ -83,6 +83,10 @@ div.dataTables_processing {
|
|
|
83
83
|
border: none;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
.table-scroll-wrapper {
|
|
87
|
+
overflow-x: auto;
|
|
88
|
+
}
|
|
89
|
+
|
|
86
90
|
table.dataTable {
|
|
87
91
|
width: 100%;
|
|
88
92
|
margin-top: 0px !important;
|
|
@@ -128,6 +132,7 @@ table.dataTable {
|
|
|
128
132
|
|
|
129
133
|
> td {
|
|
130
134
|
@extend .zuo-table__td;
|
|
135
|
+
white-space: nowrap;
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -20,6 +20,7 @@ module DatatableHelper
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def render_datatable(object, table_url, columns: nil, table_name: nil, aoData: [], initial_size: 25, table_views: { table: true, grid: false }, table_filters: [], table_actions: nil, sort: [[0, 'asc']])
|
|
23
|
+
warn("DEPRECATION WARNING: render_datatable will be removed soon (use render partial: 'partials/table' instead)")
|
|
23
24
|
if table_name.nil?
|
|
24
25
|
table_name = object.to_s.pluralize.underscore.tr('/', '_')
|
|
25
26
|
end
|
|
@@ -16,7 +16,7 @@ module ZuoraConnectUi
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
JAVASCRIPT_INCLUDE = %w[
|
|
19
|
-
https://cdn.zuora.com/anjuna/1.0.0-alpha.
|
|
19
|
+
https://cdn.zuora.com/anjuna/1.0.0-alpha.11/core/anjuna-core.js
|
|
20
20
|
].map { |link| '<script src="' + link + '"></script>' }.join("\n").html_safe
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
<span class="z-icon-hamburger
|
|
4
|
-
</
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</ul>
|
|
8
|
-
</div>
|
|
1
|
+
<anj-dropdown>
|
|
2
|
+
<anj-button shape="circle" context="icon" data-remote="true" slot="dropdown-toggle">
|
|
3
|
+
<span class="z-icon-hamburger"></span>
|
|
4
|
+
</anj-button>
|
|
5
|
+
<%= yield %>
|
|
6
|
+
</anj-dropdown>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
<%
|
|
2
|
-
<%
|
|
3
|
-
<%
|
|
1
|
+
<% aoData = [] unless local_assigns.key? :aoData %>
|
|
2
|
+
<% initial_size = 25 unless local_assigns.key? :initial_size %>
|
|
3
|
+
<% table_views = { table: true, grid: false } unless local_assigns.key? :table_views %>
|
|
4
|
+
<% table_filters = [] unless local_assigns.key? :table_filters %>
|
|
5
|
+
<% sort = [[0, 'asc']] unless local_assigns.key? :table_filters %>
|
|
6
|
+
<% defer_loading = false unless local_assigns.key? :defer_loading %>
|
|
7
|
+
<% quick_loading = false unless local_assigns.key? :quick_loading %>
|
|
8
|
+
<% debug = false unless local_assigns.key? :debug %>
|
|
4
9
|
|
|
5
10
|
<div id="<%= table_name %>_content">
|
|
6
11
|
<div class="table-header">
|
|
@@ -115,7 +120,7 @@
|
|
|
115
120
|
}, 4000);
|
|
116
121
|
|
|
117
122
|
var <%= table_name %> = $('#<%= table_name %>').dataTable({
|
|
118
|
-
"sDom": "
|
|
123
|
+
"sDom": "<'table-scroll-wrapper't><'grid_view'><'table-footer'i<'#<%= table_name %>_select_container.select_container'>p>",
|
|
119
124
|
"pagingType": "<%= quick_loading ? 'simple' : 'full_numbers' %>",
|
|
120
125
|
"language" : {
|
|
121
126
|
"paginate" : {
|
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.6.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: 2019-
|
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bootstrap-sass
|