cm-admin 0.9.0 → 1.0.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/.github/ISSUE_TEMPLATE/bug_report.md +82 -0
- data/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
- data/Gemfile.lock +96 -9
- data/app/assets/config/cm_admin_manifest.js +1 -0
- data/app/assets/javascripts/cm_admin/application.js +5 -0
- data/app/{javascript/packs → assets/javascripts}/cm_admin/exports.js +0 -0
- data/app/{javascript/packs → assets/javascripts}/cm_admin/filters.js +20 -31
- data/app/{javascript/packs → assets/javascripts}/cm_admin/form_validation.js +0 -0
- data/app/{javascript/packs → assets/javascripts}/cm_admin/quick_search.js +16 -3
- data/app/assets/javascripts/cm_admin/scaffolds.js +44 -0
- data/app/assets/stylesheets/cm_admin/base/form.scss +115 -40
- data/app/assets/stylesheets/cm_admin/base/scaffold.scss +2 -0
- data/app/assets/stylesheets/cm_admin/components/_input.scss +12 -0
- data/app/controllers/cm_admin/resource_controller.rb +10 -7
- data/app/helpers/cm_admin/application_helper.rb +0 -3
- data/app/javascript/packs/cm_admin/application.js +4 -4
- data/app/javascript/packs/cm_admin/scaffolds.js +81 -0
- data/app/views/cm_admin/main/_nested_fields.html.slim +26 -9
- data/app/views/cm_admin/main/_nested_table_form.html.slim +9 -10
- data/app/views/cm_admin/main/_tabs.html.slim +1 -1
- data/app/views/layouts/cm_admin.html.slim +9 -4
- data/app/views/layouts/static.html.slim +3 -2
- data/bin/importmap +15 -0
- data/bin/webpack +8 -8
- data/bin/webpack-dev-server +9 -9
- data/cm_admin.gemspec +3 -0
- data/config/importmap.rb +12 -0
- data/config/webpack/development.js +1 -1
- data/config/webpack/environment.js +1 -1
- data/config/webpack/production.js +1 -1
- data/config/webpacker.yml +2 -2
- data/lib/cm_admin/configuration.rb +5 -2
- data/lib/cm_admin/engine.rb +36 -15
- data/lib/cm_admin/models/filter.rb +1 -1
- data/lib/cm_admin/models/form_field.rb +8 -2
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/version_manager.rb +21 -0
- data/lib/cm_admin/view_helpers/form_field_helper.rb +183 -35
- data/lib/cm_admin/view_helpers/page_info_helper.rb +4 -0
- data/lib/cm_admin.rb +7 -2
- data/lib/generators/cm_admin/templates/actiontext.scss +0 -1
- data/lib/tasks/webpack_install.rake +15 -13
- data/package-lock.json +42 -55
- data/tmp/cache/webpacker/last-compilation-digest-development +1 -1
- data/yarn.lock +6708 -6916
- metadata +43 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ba47b6a7c02c8edad75f7407f3c6c65cb2f59b44aea6952c7abbc174595ecc
|
4
|
+
data.tar.gz: 7216647324f0791c1090ae0f0fd9f252b2c1d53939553dfb4c9c390d99dc68b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f58b8468437f6785010ba74c00210332eabc56de6167503c91ca9df6c07a3ef6709f8b943f2de156aeea897564e17564aa19e70638ca08d28fb1fe212803c3
|
7
|
+
data.tar.gz: 1847f6e693831247dee15f416e537c39f1a6f3725e934774dbed4f76bf879ebfba16fd69324280594232638ce559092fb09b45bf4d22442a2e1ffb608b87bf02
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
name: 🐛 Bug report
|
3
|
+
about: Report a reproducible bug and help us improve.
|
4
|
+
title: '[Bug]: '
|
5
|
+
labels: 'bug'
|
6
|
+
assignees:
|
7
|
+
- anbublacky
|
8
|
+
- AdityaTiwari2102
|
9
|
+
---
|
10
|
+
|
11
|
+
<!-- Before creating a bug report, try disabling browser extensions to see if the bug is still present. -->
|
12
|
+
|
13
|
+
<!-- If you have added and/or updated any DSL related code try restarting the server. -->
|
14
|
+
|
15
|
+
### Describe the bug
|
16
|
+
|
17
|
+
<!-- A clear and concise description of what the bug is. -->
|
18
|
+
|
19
|
+
### Logs
|
20
|
+
<details>
|
21
|
+
<summary>Error logs</summary>
|
22
|
+
|
23
|
+
```
|
24
|
+
Place your error logs here
|
25
|
+
```
|
26
|
+
</details>
|
27
|
+
|
28
|
+
### To Reproduce
|
29
|
+
|
30
|
+
Steps to reproduce the behavior:
|
31
|
+
|
32
|
+
1. Add this configuration '...'
|
33
|
+
2. Go to '...'
|
34
|
+
3. Click on '....'
|
35
|
+
4. Scroll down to '....'
|
36
|
+
5. See error
|
37
|
+
|
38
|
+
### Expected behavior
|
39
|
+
|
40
|
+
<!-- A clear and concise description of what you expected to happen. -->
|
41
|
+
|
42
|
+
### Screenshots & recordings
|
43
|
+
|
44
|
+
<!-- If applicable, add screenshots to help explain your problem. -->
|
45
|
+
|
46
|
+
### System configuration
|
47
|
+
You can help us to understand your problem if you will share some very
|
48
|
+
useful information about your project environment (don't forget to
|
49
|
+
remove any confidential data if it exists).
|
50
|
+
|
51
|
+
**CM Admin version**:
|
52
|
+
|
53
|
+
**Rails version**:
|
54
|
+
<!-- Requirement is v6.0+ -->
|
55
|
+
|
56
|
+
**Ruby version**:
|
57
|
+
<!-- Requirement is v2.7+ -->
|
58
|
+
|
59
|
+
**OS, version**:
|
60
|
+
|
61
|
+
**Browser, version**:
|
62
|
+
|
63
|
+
### Additional context
|
64
|
+
|
65
|
+
<!-- Add any other context about the problem or helpful links here. -->
|
66
|
+
|
67
|
+
#### Impact
|
68
|
+
<!--
|
69
|
+
How much are you impacted by this issue?
|
70
|
+
Please set a level of Impact and Urgency
|
71
|
+
(Mark [x] inside the brackets)
|
72
|
+
-->
|
73
|
+
|
74
|
+
- [ ] High impact
|
75
|
+
- [ ] Medium impact
|
76
|
+
- [ ] Low impact
|
77
|
+
|
78
|
+
#### Urgency
|
79
|
+
|
80
|
+
- [ ] High urgency
|
81
|
+
- [ ] Medium urgency
|
82
|
+
- [ ] low urgency
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
name: 💡 Feature request
|
3
|
+
about: Request a feature that helps you built the platform better.
|
4
|
+
title: ''
|
5
|
+
labels: 'enhancement'
|
6
|
+
assignees:
|
7
|
+
- anbublacky
|
8
|
+
- AdityaTiwari2102
|
9
|
+
---
|
10
|
+
|
11
|
+
### Feature
|
12
|
+
<!-- A clear and concise description of what the feature is. -->
|
13
|
+
|
14
|
+
### Current workarounds
|
15
|
+
<!-- Is there a way to achieve this behavior at the moment through some hack? -->
|
16
|
+
|
17
|
+
### Screenshots or screen recordings
|
18
|
+
<!-- If applicable, add screenshots or recordings to help explain your problem. -->
|
19
|
+
|
20
|
+
### Additional context
|
21
|
+
<!-- Have you seen this behavior somewhere else where we can test it? -->
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,46 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cm-admin (0.
|
4
|
+
cm-admin (7.0.2)
|
5
5
|
caxlsx_rails
|
6
6
|
cocoon (~> 1.2.15)
|
7
7
|
csv-importer (~> 0.8.2)
|
8
|
+
importmap-rails
|
8
9
|
local_time (~> 2.1.0)
|
9
10
|
pagy (~> 4.11.0)
|
10
11
|
pundit (~> 2.2.0)
|
12
|
+
rails (>= 6.0)
|
11
13
|
slim (~> 4.1.0)
|
12
14
|
webpacker (~> 5.4.3)
|
13
15
|
|
14
16
|
GEM
|
15
17
|
remote: https://rubygems.org/
|
16
18
|
specs:
|
19
|
+
actioncable (7.0.3.1)
|
20
|
+
actionpack (= 7.0.3.1)
|
21
|
+
activesupport (= 7.0.3.1)
|
22
|
+
nio4r (~> 2.0)
|
23
|
+
websocket-driver (>= 0.6.1)
|
24
|
+
actionmailbox (7.0.3.1)
|
25
|
+
actionpack (= 7.0.3.1)
|
26
|
+
activejob (= 7.0.3.1)
|
27
|
+
activerecord (= 7.0.3.1)
|
28
|
+
activestorage (= 7.0.3.1)
|
29
|
+
activesupport (= 7.0.3.1)
|
30
|
+
mail (>= 2.7.1)
|
31
|
+
net-imap
|
32
|
+
net-pop
|
33
|
+
net-smtp
|
34
|
+
actionmailer (7.0.3.1)
|
35
|
+
actionpack (= 7.0.3.1)
|
36
|
+
actionview (= 7.0.3.1)
|
37
|
+
activejob (= 7.0.3.1)
|
38
|
+
activesupport (= 7.0.3.1)
|
39
|
+
mail (~> 2.5, >= 2.5.4)
|
40
|
+
net-imap
|
41
|
+
net-pop
|
42
|
+
net-smtp
|
43
|
+
rails-dom-testing (~> 2.0)
|
17
44
|
actionpack (7.0.3.1)
|
18
45
|
actionview (= 7.0.3.1)
|
19
46
|
activesupport (= 7.0.3.1)
|
@@ -21,12 +48,34 @@ GEM
|
|
21
48
|
rack-test (>= 0.6.3)
|
22
49
|
rails-dom-testing (~> 2.0)
|
23
50
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
51
|
+
actiontext (7.0.3.1)
|
52
|
+
actionpack (= 7.0.3.1)
|
53
|
+
activerecord (= 7.0.3.1)
|
54
|
+
activestorage (= 7.0.3.1)
|
55
|
+
activesupport (= 7.0.3.1)
|
56
|
+
globalid (>= 0.6.0)
|
57
|
+
nokogiri (>= 1.8.5)
|
24
58
|
actionview (7.0.3.1)
|
25
59
|
activesupport (= 7.0.3.1)
|
26
60
|
builder (~> 3.1)
|
27
61
|
erubi (~> 1.4)
|
28
62
|
rails-dom-testing (~> 2.0)
|
29
63
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
64
|
+
activejob (7.0.3.1)
|
65
|
+
activesupport (= 7.0.3.1)
|
66
|
+
globalid (>= 0.3.6)
|
67
|
+
activemodel (7.0.3.1)
|
68
|
+
activesupport (= 7.0.3.1)
|
69
|
+
activerecord (7.0.3.1)
|
70
|
+
activemodel (= 7.0.3.1)
|
71
|
+
activesupport (= 7.0.3.1)
|
72
|
+
activestorage (7.0.3.1)
|
73
|
+
actionpack (= 7.0.3.1)
|
74
|
+
activejob (= 7.0.3.1)
|
75
|
+
activerecord (= 7.0.3.1)
|
76
|
+
activesupport (= 7.0.3.1)
|
77
|
+
marcel (~> 1.0)
|
78
|
+
mini_mime (>= 1.1.0)
|
30
79
|
activesupport (7.0.3.1)
|
31
80
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
81
|
i18n (>= 1.6, < 2)
|
@@ -53,25 +102,45 @@ GEM
|
|
53
102
|
crass (1.0.6)
|
54
103
|
csv-importer (0.8.2)
|
55
104
|
virtus
|
105
|
+
date (3.3.3)
|
56
106
|
descendants_tracker (0.0.4)
|
57
107
|
thread_safe (~> 0.3, >= 0.3.1)
|
58
108
|
diff-lcs (1.4.4)
|
59
109
|
erubi (1.11.0)
|
110
|
+
globalid (1.0.0)
|
111
|
+
activesupport (>= 5.0)
|
60
112
|
htmlentities (4.3.4)
|
61
113
|
i18n (1.11.0)
|
62
114
|
concurrent-ruby (~> 1.0)
|
63
115
|
ice_nine (0.11.2)
|
116
|
+
importmap-rails (1.1.5)
|
117
|
+
actionpack (>= 6.0.0)
|
118
|
+
railties (>= 6.0.0)
|
64
119
|
json (2.6.2)
|
65
120
|
local_time (2.1.0)
|
66
|
-
loofah (2.19.
|
121
|
+
loofah (2.19.1)
|
67
122
|
crass (~> 1.0.2)
|
68
123
|
nokogiri (>= 1.5.9)
|
124
|
+
mail (2.8.0)
|
125
|
+
mini_mime (>= 0.1.1)
|
126
|
+
net-imap
|
127
|
+
net-pop
|
128
|
+
net-smtp
|
69
129
|
marcel (1.0.2)
|
70
130
|
method_source (1.0.0)
|
71
|
-
|
131
|
+
mini_mime (1.1.2)
|
72
132
|
minitest (5.16.2)
|
73
|
-
|
74
|
-
|
133
|
+
net-imap (0.3.3)
|
134
|
+
date
|
135
|
+
net-protocol
|
136
|
+
net-pop (0.1.2)
|
137
|
+
net-protocol
|
138
|
+
net-protocol (0.2.1)
|
139
|
+
timeout
|
140
|
+
net-smtp (0.3.3)
|
141
|
+
net-protocol
|
142
|
+
nio4r (2.5.8)
|
143
|
+
nokogiri (1.13.10-arm64-darwin)
|
75
144
|
racc (~> 1.4)
|
76
145
|
pagy (4.11.0)
|
77
146
|
parallel (1.22.1)
|
@@ -79,17 +148,31 @@ GEM
|
|
79
148
|
ast (~> 2.4.1)
|
80
149
|
pundit (2.2.0)
|
81
150
|
activesupport (>= 3.0.0)
|
82
|
-
racc (1.6.
|
151
|
+
racc (1.6.1)
|
83
152
|
rack (2.2.4)
|
84
153
|
rack-proxy (0.7.4)
|
85
154
|
rack
|
86
155
|
rack-test (2.0.2)
|
87
156
|
rack (>= 1.3)
|
157
|
+
rails (7.0.3.1)
|
158
|
+
actioncable (= 7.0.3.1)
|
159
|
+
actionmailbox (= 7.0.3.1)
|
160
|
+
actionmailer (= 7.0.3.1)
|
161
|
+
actionpack (= 7.0.3.1)
|
162
|
+
actiontext (= 7.0.3.1)
|
163
|
+
actionview (= 7.0.3.1)
|
164
|
+
activejob (= 7.0.3.1)
|
165
|
+
activemodel (= 7.0.3.1)
|
166
|
+
activerecord (= 7.0.3.1)
|
167
|
+
activestorage (= 7.0.3.1)
|
168
|
+
activesupport (= 7.0.3.1)
|
169
|
+
bundler (>= 1.15.0)
|
170
|
+
railties (= 7.0.3.1)
|
88
171
|
rails-dom-testing (2.0.3)
|
89
172
|
activesupport (>= 4.2.0)
|
90
173
|
nokogiri (>= 1.6)
|
91
|
-
rails-html-sanitizer (1.4.
|
92
|
-
loofah (~> 2.
|
174
|
+
rails-html-sanitizer (1.4.4)
|
175
|
+
loofah (~> 2.19, >= 2.19.1)
|
93
176
|
railties (7.0.3.1)
|
94
177
|
actionpack (= 7.0.3.1)
|
95
178
|
activesupport (= 7.0.3.1)
|
@@ -143,6 +226,7 @@ GEM
|
|
143
226
|
thor (1.2.1)
|
144
227
|
thread_safe (0.3.6)
|
145
228
|
tilt (2.0.10)
|
229
|
+
timeout (0.3.1)
|
146
230
|
tzinfo (2.0.4)
|
147
231
|
concurrent-ruby (~> 1.0)
|
148
232
|
unicode-display_width (2.3.0)
|
@@ -155,7 +239,10 @@ GEM
|
|
155
239
|
rack-proxy (>= 0.6.1)
|
156
240
|
railties (>= 5.2)
|
157
241
|
semantic_range (>= 2.3.0)
|
158
|
-
|
242
|
+
websocket-driver (0.7.5)
|
243
|
+
websocket-extensions (>= 0.1.0)
|
244
|
+
websocket-extensions (0.1.5)
|
245
|
+
zeitwerk (2.6.6)
|
159
246
|
|
160
247
|
PLATFORMS
|
161
248
|
ruby
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link_tree ../javascripts/cm_admin
|
File without changes
|
@@ -1,5 +1,21 @@
|
|
1
1
|
var currentRequest = null;
|
2
2
|
|
3
|
+
var CmFilter = {
|
4
|
+
// Generate or remove elements of the dropdown based on the search value.
|
5
|
+
dropdown_search: function(element) {
|
6
|
+
var filter = element.val().toUpperCase();
|
7
|
+
var dropdownElements = element.parents(':nth(1)').find('.list-area').children();
|
8
|
+
for (var i = 0; i < dropdownElements.length; i++) {
|
9
|
+
var txtValue = $(dropdownElements[i]).children().text();
|
10
|
+
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
11
|
+
$(dropdownElements[i]).css('display', 'flex');
|
12
|
+
} else {
|
13
|
+
$(dropdownElements[i]).css('display', 'none');
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
3
19
|
// Main method which will structure the existing filter values with the newly
|
4
20
|
// applied filter. Send and receive the value from the backend.
|
5
21
|
var getFilteredData = function(filterType, filterValue, filterColumn=null) {
|
@@ -40,7 +56,7 @@ var getFilteredData = function(filterType, filterValue, filterColumn=null) {
|
|
40
56
|
}
|
41
57
|
filterParams = jQuery.param(queryString)
|
42
58
|
var availableParams = searchParams + '&' + filterParams
|
43
|
-
queryString = getParamsAsObject(availableParams)
|
59
|
+
var queryString = getParamsAsObject(availableParams)
|
44
60
|
}
|
45
61
|
|
46
62
|
return currentRequest = $.ajax(url, {
|
@@ -259,7 +275,7 @@ $(document).on('click', '.apply-area', function(e) {
|
|
259
275
|
filterValueText.push($(checkedElements[i]).parent().text())
|
260
276
|
}
|
261
277
|
|
262
|
-
truncatedFilterValue = filterValueText[0]
|
278
|
+
var truncatedFilterValue = filterValueText[0]
|
263
279
|
if (filterValue.length > 1) {
|
264
280
|
truncatedFilterValue += ' + ' + (filterValue.length - 1) + ' more'
|
265
281
|
}
|
@@ -286,7 +302,7 @@ $(document).on('click', '.filter-chip-remove', function(e) {
|
|
286
302
|
|
287
303
|
var searchParams = window.location.search
|
288
304
|
if (searchParams.length > 0) {
|
289
|
-
queryString = getParamsAsObject(searchParams)
|
305
|
+
var queryString = getParamsAsObject(searchParams)
|
290
306
|
if (queryString['filters'][filterType] != undefined) {
|
291
307
|
delete(queryString['filters'][filterType][filterColumn])
|
292
308
|
var queryParam = jQuery.param(queryString)
|
@@ -317,31 +333,4 @@ $(document).on('click', '[data-behaviour="selected-chip"]', function(e) {
|
|
317
333
|
$(selectElement).parent().siblings(':first').addClass('search-area').removeClass('search-with-chips')
|
318
334
|
$(selectElement).parent().siblings(':last').removeClass('active')
|
319
335
|
}
|
320
|
-
})
|
321
|
-
|
322
|
-
CmFilter = {
|
323
|
-
// Generate or remove elements of the dropdown based on the search value.
|
324
|
-
dropdown_search: function(element) {
|
325
|
-
var filter = element.val().toUpperCase();
|
326
|
-
var dropdownElements = element.parents(':nth(1)').find('.list-area').children();
|
327
|
-
for (var i = 0; i < dropdownElements.length; i++) {
|
328
|
-
txtValue = $(dropdownElements[i]).children().text();
|
329
|
-
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
330
|
-
$(dropdownElements[i]).css('display', 'flex');
|
331
|
-
} else {
|
332
|
-
$(dropdownElements[i]).css('display', 'none');
|
333
|
-
}
|
334
|
-
}
|
335
|
-
},
|
336
|
-
quick_input_search: function(element) {
|
337
|
-
var filter = element.val().toUpperCase();
|
338
|
-
var searchElements = element.parents(':nth(3)').find('.list-area').children();
|
339
|
-
searchElements.removeClass('visible').addClass('hidden')
|
340
|
-
for (var i = 0; i < searchElements.length; i++) {
|
341
|
-
txtValue = $(searchElements[i]).children().text();
|
342
|
-
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
343
|
-
$(searchElements[i]).removeClass('hidden').addClass('visible');
|
344
|
-
}
|
345
|
-
}
|
346
|
-
}
|
347
|
-
}
|
336
|
+
})
|
File without changes
|
@@ -1,3 +1,17 @@
|
|
1
|
+
var CmFilter = {
|
2
|
+
quick_input_search: function(element) {
|
3
|
+
var filter = element.val().toUpperCase();
|
4
|
+
var searchElements = element.parents(':nth(3)').find('.list-area').children();
|
5
|
+
searchElements.removeClass('visible').addClass('hidden')
|
6
|
+
for (var i = 0; i < searchElements.length; i++) {
|
7
|
+
var txtValue = $(searchElements[i]).children().text();
|
8
|
+
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
9
|
+
$(searchElements[i]).removeClass('hidden').addClass('visible');
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
1
15
|
$(document).on("keydown", function(e) {
|
2
16
|
if (e.keyCode == 75 && e.metaKey) {
|
3
17
|
$('#quickSearchModal').modal('show')
|
@@ -12,7 +26,7 @@ $(document).on('keydown', function(e){
|
|
12
26
|
if(e.which === 40){
|
13
27
|
if(liSelected){
|
14
28
|
liSelected.removeClass('active-item');
|
15
|
-
next = liSelected.next();
|
29
|
+
var next = liSelected.next();
|
16
30
|
if(next.length > 0){
|
17
31
|
liSelected = next.addClass('active-item');
|
18
32
|
selected = next.text();
|
@@ -44,8 +58,7 @@ $(document).on('keydown', function(e){
|
|
44
58
|
}
|
45
59
|
}
|
46
60
|
if(liSelected && e.which === 13) {
|
47
|
-
|
48
|
-
href = liSelected.attr('href')
|
61
|
+
var href = liSelected.attr('href')
|
49
62
|
window.location = href
|
50
63
|
}
|
51
64
|
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import jQuery from 'jquery';
|
2
|
+
window.jQuery = jQuery // <- "select2" will check this
|
3
|
+
window.$ = jQuery
|
4
|
+
|
5
|
+
// This is a hack to fix 'process is not defined'
|
6
|
+
// Ref article: https://adambien.blog/roller/abien/entry/uncaught_referenceerror_process_is_not
|
7
|
+
// Based on this filter dropdown works.
|
8
|
+
window.process = {
|
9
|
+
env: {
|
10
|
+
NODE_ENV: 'development'
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
import 'moment'
|
15
|
+
import 'bootstrap'
|
16
|
+
import '@popperjs/core'
|
17
|
+
import 'flatpickr'
|
18
|
+
import 'jgrowl'
|
19
|
+
jqueryJgrowl()
|
20
|
+
import Select2 from "select2"
|
21
|
+
Select2()
|
22
|
+
|
23
|
+
// import '@nathanvda/cocoon'
|
24
|
+
import 'daterangepicker'
|
25
|
+
import '@fortawesome/fontawesome-free'
|
26
|
+
import jqueryJgrowl from 'jgrowl';
|
27
|
+
|
28
|
+
|
29
|
+
flatpickr("[data-behaviour='date-only']", {
|
30
|
+
dateFormat: "d-m-Y"
|
31
|
+
})
|
32
|
+
flatpickr("[data-behaviour='date-time']", {
|
33
|
+
enableTime: true
|
34
|
+
})
|
35
|
+
flatpickr("[data-behaviour='filter'][data-filter-type='date']", {
|
36
|
+
mode: 'range'
|
37
|
+
})
|
38
|
+
$('.select-2').select2();
|
39
|
+
$(document).on('turbolinks:load', function () {
|
40
|
+
$('.select-2').select2();
|
41
|
+
flatpickr("[data-behaviour='date-only']", {
|
42
|
+
dateFormat: "d-m-Y"
|
43
|
+
})
|
44
|
+
})
|
@@ -33,6 +33,121 @@
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
|
36
|
+
//cocoon field styles
|
37
|
+
.fields-group {
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
margin: 16px 0;
|
41
|
+
.field-item {
|
42
|
+
margin: 0 5px;
|
43
|
+
label {
|
44
|
+
@include font($size: $t4-text, $color: $primary-text-clr, $weight: bold);
|
45
|
+
margin-bottom: 4px;
|
46
|
+
}
|
47
|
+
input {
|
48
|
+
width: 100%;
|
49
|
+
padding: 5px 10px;
|
50
|
+
border: 1px solid #c1c7d0;
|
51
|
+
border-radius: $radius-2;
|
52
|
+
&:focus {
|
53
|
+
border-color: #66afe9 !important;
|
54
|
+
outline: 0 !important;
|
55
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
.field-remove {
|
60
|
+
margin-top: 25px;
|
61
|
+
a {
|
62
|
+
@include font($size: $t1-text, $color: #ff5656);
|
63
|
+
@include transition-linear;
|
64
|
+
&:hover {
|
65
|
+
transform: scale(1.1);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
.add-field-btn {
|
72
|
+
font-size: $t4-text;
|
73
|
+
margin: 10px 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
// Nested form styles
|
77
|
+
.nested-field-wrapper {
|
78
|
+
.nested-field-label {
|
79
|
+
@include font($size: $t4-text, $color: $primary-text-clr);
|
80
|
+
line-height: 22px;
|
81
|
+
margin: 0 0 4px;
|
82
|
+
span {
|
83
|
+
color: $ink-lightest-clr;
|
84
|
+
margin-left: 4px;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
.nested-single-field {
|
88
|
+
display: grid;
|
89
|
+
grid-template-columns: 1fr 32px;
|
90
|
+
align-items: center;
|
91
|
+
width: 352px;
|
92
|
+
margin-bottom: 8px;
|
93
|
+
.field-remove-action {
|
94
|
+
font-size: $t3-text;
|
95
|
+
text-align: center;
|
96
|
+
a {
|
97
|
+
color: $primary-text-clr;
|
98
|
+
&:hover {
|
99
|
+
color: $primary-text-clr;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
// Nested form Accordion styles
|
107
|
+
.nested-form-accordion {
|
108
|
+
.accordion-item {
|
109
|
+
margin-bottom: 8px;
|
110
|
+
border: 1px solid $grey-light-clr;
|
111
|
+
border-radius: $radius-4;
|
112
|
+
}
|
113
|
+
.accordion-item:not(:first-of-type) {
|
114
|
+
border-top: 1px solid $grey-light-clr;
|
115
|
+
}
|
116
|
+
.accordion-item:first-of-type {
|
117
|
+
margin-top: 4px;
|
118
|
+
border-radius: $radius-4;
|
119
|
+
}
|
120
|
+
.accordion-item:last-of-type {
|
121
|
+
margin-bottom: 0;
|
122
|
+
border-radius: $radius-4;
|
123
|
+
}
|
124
|
+
.accordion-header {
|
125
|
+
position: relative;
|
126
|
+
display: flex;
|
127
|
+
.accordion-delete-btn {
|
128
|
+
position: absolute;
|
129
|
+
top: 14px;
|
130
|
+
right: 48px;
|
131
|
+
z-index: 9;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
.accordion-button {
|
135
|
+
border-radius: $radius-4;
|
136
|
+
&:focus {
|
137
|
+
border-color: transparent;
|
138
|
+
box-shadow: none;
|
139
|
+
}
|
140
|
+
&:not(.collapsed) {
|
141
|
+
color: inherit;
|
142
|
+
background-color: transparent;
|
143
|
+
box-shadow: none;
|
144
|
+
}
|
145
|
+
&:not(.collapsed)::after {
|
146
|
+
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
36
151
|
//Old form code
|
37
152
|
.form-wrapper {
|
38
153
|
// margin-top: 60px;
|
@@ -148,43 +263,3 @@
|
|
148
263
|
}
|
149
264
|
}
|
150
265
|
}
|
151
|
-
|
152
|
-
//cocoon field styles
|
153
|
-
.fields-group {
|
154
|
-
display: flex;
|
155
|
-
align-items: center;
|
156
|
-
margin: 16px 0;
|
157
|
-
.field-item {
|
158
|
-
margin: 0 5px;
|
159
|
-
label {
|
160
|
-
@include font($size: $t4-text, $color: $primary-text-clr, $weight: bold);
|
161
|
-
margin-bottom: 4px;
|
162
|
-
}
|
163
|
-
input {
|
164
|
-
width: 100%;
|
165
|
-
padding: 5px 10px;
|
166
|
-
border: 1px solid #c1c7d0;
|
167
|
-
border-radius: $radius-2;
|
168
|
-
&:focus {
|
169
|
-
border-color: #66afe9 !important;
|
170
|
-
outline: 0 !important;
|
171
|
-
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
}
|
175
|
-
.field-remove {
|
176
|
-
margin-top: 25px;
|
177
|
-
a {
|
178
|
-
@include font($size: $t1-text, $color: #ff5656);
|
179
|
-
@include transition-linear;
|
180
|
-
&:hover {
|
181
|
-
transform: scale(1.1);
|
182
|
-
}
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
186
|
-
|
187
|
-
.add-field-btn {
|
188
|
-
font-size: $t4-text;
|
189
|
-
margin: 10px 0;
|
190
|
-
}
|
@@ -88,6 +88,7 @@ a {
|
|
88
88
|
width: 480px;
|
89
89
|
}
|
90
90
|
}
|
91
|
+
|
91
92
|
.input-wrapper.disabled {
|
92
93
|
input:disabled {
|
93
94
|
background-color: $grey-lightest-clr;
|
@@ -96,6 +97,7 @@ a {
|
|
96
97
|
color: $ink-lightest-clr;
|
97
98
|
}
|
98
99
|
}
|
100
|
+
|
99
101
|
.nested-fields .select2 {
|
100
102
|
width: 320px !important;
|
101
103
|
}
|
@@ -182,6 +182,18 @@ input.cm-checkbox[type="checkbox"] {
|
|
182
182
|
}
|
183
183
|
|
184
184
|
//Radio button styles
|
185
|
+
.cm-radio-section {
|
186
|
+
width: 100%;
|
187
|
+
float: left;
|
188
|
+
.cm-radio-label {
|
189
|
+
float: left;
|
190
|
+
padding-left: 10px;
|
191
|
+
}
|
192
|
+
.cm-radio-tag {
|
193
|
+
float: left;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
185
197
|
input.cm-radio[type="radio"] {
|
186
198
|
position: relative;
|
187
199
|
display: inline-block;
|