headmin 0.3.3 → 0.4.1

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.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +27 -0
  3. data/.gitignore +14 -0
  4. data/.nvmrc +1 -0
  5. data/CHANGELOG.md +24 -0
  6. data/Gemfile +7 -4
  7. data/Gemfile.lock +171 -3
  8. data/README.md +9 -1
  9. data/Rakefile +1 -7
  10. data/app/assets/javascripts/headmin/config/i18n.js +9 -9
  11. data/app/assets/javascripts/headmin/controllers/autocomplete_controller.js +318 -0
  12. data/app/assets/javascripts/headmin/controllers/blocks_controller.js +74 -79
  13. data/app/assets/javascripts/headmin/controllers/date_range_controller.js +24 -24
  14. data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +23 -25
  15. data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +237 -237
  16. data/app/assets/javascripts/headmin/controllers/filter_controller.js +44 -44
  17. data/app/assets/javascripts/headmin/controllers/filters_controller.js +57 -61
  18. data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +29 -29
  19. data/app/assets/javascripts/headmin/controllers/hello_controller.js +3 -3
  20. data/app/assets/javascripts/headmin/controllers/notification_controller.js +7 -6
  21. data/app/assets/javascripts/headmin/controllers/popup_controller.js +57 -51
  22. data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +36 -9
  23. data/app/assets/javascripts/headmin/controllers/repeater_controller.js +122 -125
  24. data/app/assets/javascripts/headmin/controllers/select_controller.js +40 -39
  25. data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +88 -77
  26. data/app/assets/javascripts/headmin/controllers/table_controller.js +115 -116
  27. data/app/assets/javascripts/headmin/index.js +38 -35
  28. data/app/assets/javascripts/headmin.js +309 -42
  29. data/app/assets/stylesheets/headmin/forms/autocomplete.scss +21 -0
  30. data/app/assets/stylesheets/headmin/forms/file.scss +46 -0
  31. data/app/assets/stylesheets/headmin/forms/repeater.scss +62 -0
  32. data/app/assets/stylesheets/headmin/forms/search.scss +12 -0
  33. data/app/assets/stylesheets/headmin/forms.scss +11 -0
  34. data/app/assets/stylesheets/headmin/general.scss +14 -0
  35. data/app/assets/stylesheets/headmin/overrides/bootstrap.scss +5 -3
  36. data/app/assets/stylesheets/headmin/overrides/redactorx.scss +74 -0
  37. data/app/assets/stylesheets/headmin/popup.scss +1 -0
  38. data/app/assets/stylesheets/headmin/syntax.scss +36 -349
  39. data/app/assets/stylesheets/headmin/table.scss +1 -1
  40. data/app/assets/stylesheets/headmin/utilities/buttons.scss +19 -0
  41. data/app/assets/stylesheets/headmin/utilities/dropzone.scss +72 -0
  42. data/app/assets/stylesheets/headmin/utilities.scss +2 -68
  43. data/app/assets/stylesheets/headmin.css +209 -205
  44. data/app/assets/stylesheets/headmin.scss +1 -1
  45. data/app/helpers/headmin/admin_helper.rb +0 -1
  46. data/app/helpers/headmin/form_helper.rb +2 -8
  47. data/app/models/concerns/headmin/blockable.rb +1 -1
  48. data/app/models/concerns/headmin/field.rb +1 -0
  49. data/app/models/concerns/headmin/form/autocompletable.rb +38 -0
  50. data/app/models/concerns/headmin/form/hintable.rb +19 -0
  51. data/app/models/concerns/headmin/form/input_groupable.rb +23 -0
  52. data/app/models/concerns/headmin/form/labelable.rb +33 -0
  53. data/app/models/concerns/headmin/form/listable.rb +28 -0
  54. data/app/models/concerns/headmin/form/placeholderable.rb +13 -0
  55. data/app/models/concerns/headmin/form/validatable.rb +40 -0
  56. data/app/models/concerns/headmin/form/wrappable.rb +21 -0
  57. data/app/models/headmin/.DS_Store +0 -0
  58. data/app/models/headmin/blocks_view.rb +15 -0
  59. data/app/models/headmin/form/blocks_view.rb +29 -0
  60. data/app/models/headmin/form/checkbox_view.rb +52 -0
  61. data/app/models/headmin/form/date_range_view.rb +25 -0
  62. data/app/models/headmin/form/date_view.rb +45 -0
  63. data/app/models/headmin/form/email_view.rb +48 -0
  64. data/app/models/headmin/form/file_view.rb +116 -0
  65. data/app/models/headmin/form/flatpickr_range_view.rb +102 -0
  66. data/app/models/headmin/form/flatpickr_view.rb +37 -0
  67. data/app/models/headmin/form/hidden_view.rb +10 -0
  68. data/app/models/headmin/form/hint_view.rb +6 -0
  69. data/app/models/headmin/form/input_group_view.rb +19 -0
  70. data/app/models/headmin/form/label_view.rb +24 -0
  71. data/app/models/headmin/form/number_view.rb +49 -0
  72. data/app/models/headmin/form/password_view.rb +44 -0
  73. data/app/models/headmin/form/redactorx_view.rb +59 -0
  74. data/app/models/headmin/form/search_view.rb +48 -0
  75. data/app/models/headmin/form/select_view.rb +62 -0
  76. data/app/models/headmin/form/switch_view.rb +23 -0
  77. data/app/models/headmin/form/text_view.rb +48 -0
  78. data/app/models/headmin/form/textarea_view.rb +44 -0
  79. data/app/models/headmin/form/url_view.rb +48 -0
  80. data/app/models/headmin/form/wrapper_view.rb +19 -0
  81. data/app/models/headmin/form/wysiwyg_view.rb +17 -0
  82. data/app/models/headmin/{thumbnail.rb → thumbnail_view.rb} +6 -1
  83. data/app/models/view_model.rb +58 -0
  84. data/app/views/headmin/_blocks.html.erb +13 -9
  85. data/app/views/headmin/_heading.html.erb +7 -1
  86. data/app/views/headmin/_thumbnail.html.erb +1 -37
  87. data/app/views/headmin/forms/_autocomplete.html.erb +11 -0
  88. data/app/views/headmin/forms/_blocks.html.erb +16 -17
  89. data/app/views/headmin/forms/_checkbox.html.erb +24 -29
  90. data/app/views/headmin/forms/_datalist.html.erb +3 -0
  91. data/app/views/headmin/forms/_date.html.erb +24 -24
  92. data/app/views/headmin/forms/_date_range.html.erb +19 -21
  93. data/app/views/headmin/forms/_email.html.erb +27 -32
  94. data/app/views/headmin/forms/_errors.html.erb +2 -3
  95. data/app/views/headmin/forms/_file.html.erb +84 -181
  96. data/app/views/headmin/forms/_flatpickr.html.erb +19 -20
  97. data/app/views/headmin/forms/_flatpickr_range.html.erb +28 -37
  98. data/app/views/headmin/forms/_hidden.html.erb +9 -10
  99. data/app/views/headmin/forms/_hint.html.erb +16 -0
  100. data/app/views/headmin/forms/_input_group.html.erb +21 -0
  101. data/app/views/headmin/forms/_label.html.erb +5 -13
  102. data/app/views/headmin/forms/_number.html.erb +23 -35
  103. data/app/views/headmin/forms/_password.html.erb +21 -30
  104. data/app/views/headmin/forms/_redactorx.html.erb +21 -40
  105. data/app/views/headmin/forms/_repeater.html.erb +55 -60
  106. data/app/views/headmin/forms/_search.html.erb +43 -0
  107. data/app/views/headmin/forms/_select.html.erb +24 -49
  108. data/app/views/headmin/forms/_switch.html.erb +29 -0
  109. data/app/views/headmin/forms/_text.html.erb +42 -96
  110. data/app/views/headmin/forms/_textarea.html.erb +21 -32
  111. data/app/views/headmin/forms/_url.html.erb +26 -31
  112. data/app/views/headmin/forms/_validation.html.erb +10 -13
  113. data/app/views/headmin/forms/_wrapper.html.erb +9 -0
  114. data/app/views/headmin/forms/_wysiwyg.html.erb +28 -0
  115. data/app/views/headmin/forms/autocomplete/_item.html.erb +3 -0
  116. data/app/views/headmin/forms/autocomplete/_list.html.erb +3 -0
  117. data/app/views/headmin/forms/fields/_group.html.erb +9 -2
  118. data/app/views/headmin/forms/repeater/_row.html.erb +4 -4
  119. data/app/views/headmin/table/_actions.html.erb +1 -1
  120. data/app/views/headmin/table/actions/_action.html.erb +2 -1
  121. data/app/views/headmin/table/actions/_delete.html.erb +1 -1
  122. data/bin/console +0 -1
  123. data/config/locales/headmin/forms/en.yml +1 -12
  124. data/config/locales/headmin/forms/nl.yml +1 -12
  125. data/esbuild-css.js +18 -18
  126. data/esbuild-js.js +8 -8
  127. data/headmin.gemspec +1 -3
  128. data/lib/generators/templates/controllers/auth/confirmations_controller.rb +0 -2
  129. data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +0 -2
  130. data/lib/generators/templates/controllers/auth/passwords_controller.rb +0 -2
  131. data/lib/generators/templates/controllers/auth/registrations_controller.rb +0 -2
  132. data/lib/generators/templates/controllers/auth/sessions_controller.rb +0 -2
  133. data/lib/generators/templates/controllers/auth/unlocks_controller.rb +0 -2
  134. data/lib/headmin/version.rb +1 -3
  135. data/lib/headmin.rb +0 -2
  136. data/package-lock.json +5359 -0
  137. data/package.json +13 -6
  138. data/view_model_benchmark.rb +74 -0
  139. data/yarn-error.log +367 -0
  140. data/yarn.lock +1575 -31
  141. metadata +63 -24
  142. data/app/assets/stylesheets/headmin/form.scss +0 -132
  143. data/app/assets/stylesheets/headmin/overrides/redactorx.css +0 -3
  144. data/app/helpers/headmin/documentation_helper.rb +0 -35
  145. data/app/models/headmin/documentation_renderer.rb +0 -32
  146. data/app/models/headmin/form/base.rb +0 -78
  147. data/app/models/headmin/form/text.rb +0 -51
  148. data/app/services/block_service.rb +0 -72
  149. data/app/views/headmin/_card.html.erb +0 -52
  150. data/app/views/headmin/forms/_actions.html.erb +0 -28
  151. data/app/views/headmin/forms/_base.html.erb +0 -114
  152. data/app/views/headmin/forms/_image.html.erb +0 -21
  153. data/app/views/headmin/forms/_video.html.erb +0 -21
  154. data/app/views/headmin/forms/actions/_destroy.html.erb +0 -13
  155. data/app/views/headmin/forms/actions/_save.html.erb +0 -12
  156. data/app/views/headmin/forms/actions/_view.html.erb +0 -15
  157. data/docs/blocks-and-fields.md +0 -54
  158. data/docs/blocks.md +0 -48
  159. data/docs/devise.md +0 -41
  160. data/docs/fields.md +0 -79
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9030a5fb86be00d17cc66832c36991fe2af18d745c94737a548695ff572b1b6f
4
- data.tar.gz: 786656902c0252efd3a2ea7b29df56f0c31b006dbdc1ee7bab4e2573711b617d
3
+ metadata.gz: 503fa2fc7ec041e2a3baca7937f969f7cc8061da02fcb698924f43f3ccc384f9
4
+ data.tar.gz: 88ad583e50e5d72b8f08c6212bdee24ce1f504d4776bcf0ff6c21faadb37db6e
5
5
  SHA512:
6
- metadata.gz: 599ca9728a88c3a9cd210429d5864660eef92831602f3f4c1370d0b40a58640e288fc3682caff76463e43e43df86cf56844cc414e53ec260e12308e7be6ea76b
7
- data.tar.gz: 8647e86331483620394e4ae0c0cf38c4ccac1ae89843de242a590af2bdb819104ffd0afd89bd77f5e6fb1264a9ead16dc8915c7ecf3dc7b740d52b65b73518a6
6
+ metadata.gz: 6bc9c3497c44c255eca104e024d672fa37041029c0da730ee257078f42a72b2d299b427c636b52ee6d0a370c41576d16af83b2ec55db4ad90418f104dbe406e9
7
+ data.tar.gz: ccecbb9860f879f0bd398954e67f546671e090a230a5f812bff8c59dd268e62755147ee4d14b3eafd7a59f182c39ee012f70e234ea14b47e58a63ef60dea71c7
@@ -0,0 +1,27 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - '*'
7
+ push:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-20.04
13
+ steps:
14
+ - name: Install libvips
15
+ run: sudo apt-get install -y libvips
16
+ - uses: actions/checkout@master
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ bundler: default
21
+ bundler-cache: true
22
+ - name: StandardRb check
23
+ run: bundle exec standardrb
24
+ - name: Run tests
25
+ env:
26
+ RAILS_ENV: test
27
+ run: bundle exec rake test
data/.gitignore CHANGED
@@ -8,6 +8,20 @@
8
8
  /tmp/
9
9
  /node_modules/
10
10
 
11
+ # Ignore dummy app
12
+ /test/dummy/log/*
13
+ /test/dummy/tmp/*
14
+ /test/dummy/db/*.sqlite3
15
+ /test/dummy/db/*.sqlite3-*
16
+ !/test/dummy/log/.keep
17
+ !/test/dummy/tmp/.keep
18
+ /test/dummy/tmp/pids/*
19
+ !/test/dummy/tmp/pids/
20
+ !/test/dummy/tmp/pids/.keep
21
+ /test/dummy/storage/*
22
+ !/test/dummy/storage/.keep
23
+ /test/dummy/public/assets
24
+
11
25
  # Ingore editors
12
26
  /.idea
13
27
  /headmin.iml
data/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ lts/gallium
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Headmin Changelog
2
2
 
3
+ ## HEAD
4
+ - FEATURE: Introduction of a `ViewModel` class to clean up the component views. This allows for a cleaner abstraction and better testing.
5
+ - FEATURE: New `wysiwyg` component which currently defaults to Redactor X. Redactor X will be swapped with a free open source version in the 1.0 release.
6
+ - FEATURE: `headmin/forms/redactorx` now accepts `hybrid: true` to hide the controls
7
+ - FEATURE: `headmin/forms/wysiwyg` accepts a `toolbar: false` to thide the top toolbar
8
+ - FEATURE: Validation highlighting has been added to all form fields
9
+ - FEATURE: Autocomplete suggestions added to `headmin/forms/text`, `headmin/forms/url`, `headmin/forms/email` and `headmin/forms/search`
10
+ - FIX: Readonly inputs didn't show the default greyed out background color
11
+ - FIX: Top corners of repeaters were square
12
+ - FIX: Square corners on group fields are now round
13
+ - BREAK: Passing the names of the blocks in `headmin/forms/blocks` is now required. The `allow` parameter is deprecated in favor of `names`.
14
+ - BREAK: `headmin/card` has been removed
15
+ - BREAK: `headmin/forms/actions` and all of its child components have been removed
16
+ - BREAK: `$font-weight-medium` has been removed from headmin overrides variables. We don't want to introduce new variable names that look like they are part of Bootstrap.
17
+ - BREAK: `headmin/forms/date_range` has a different way of setting attribute specific values. We now have a `:start` and `:end` attribute that accept all possible input options for their respective inputs. Both have a required `:attribute` parameter now.
18
+
19
+ ```erb
20
+ # Old
21
+ <%= render "headmin/forms/date_range", form: form, start_attribute: :start_date, end_attribute: :end_date %>
22
+
23
+ # New
24
+ <%= render "headmin/forms/date_range", form: form, start: {attribute: :start_date}, end: {attribute: :end_date} %>
25
+ ```
26
+
3
27
  ## 0.3
4
28
 
5
29
  - Support for import maps added
data/Gemfile CHANGED
@@ -1,11 +1,14 @@
1
- # frozen_string_literal: true
2
-
3
1
  source "https://rubygems.org"
4
2
 
5
3
  # Specify your gem's dependencies in headmin.gemspec
6
4
  gemspec
7
5
 
8
- gem "rake", "~> 13.0"
9
-
6
+ gem "capybara", ">= 3.26"
10
7
  gem "minitest", "~> 5.0"
8
+ gem "minitest-spec-rails", "~> 6.1"
9
+ gem "rails", "~> 7.0"
10
+ gem "rake", "~> 13.0"
11
+ gem "sprockets-rails", "~> 3.4"
12
+ gem "sqlite3", "~> 1.4"
11
13
  gem "standard", "~> 1.7"
14
+ gem "debug"
data/Gemfile.lock CHANGED
@@ -1,48 +1,191 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- headmin (0.3.3)
4
+ headmin (0.4.0)
5
5
  closure_tree (~> 7.4)
6
6
  inline_svg (~> 1.7)
7
7
  redcarpet (~> 3.5)
8
- rouge (~> 3.27)
8
+ rouge (~> 3.28)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
+ actioncable (7.0.1)
14
+ actionpack (= 7.0.1)
15
+ activesupport (= 7.0.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ actionmailbox (7.0.1)
19
+ actionpack (= 7.0.1)
20
+ activejob (= 7.0.1)
21
+ activerecord (= 7.0.1)
22
+ activestorage (= 7.0.1)
23
+ activesupport (= 7.0.1)
24
+ mail (>= 2.7.1)
25
+ net-imap
26
+ net-pop
27
+ net-smtp
28
+ actionmailer (7.0.1)
29
+ actionpack (= 7.0.1)
30
+ actionview (= 7.0.1)
31
+ activejob (= 7.0.1)
32
+ activesupport (= 7.0.1)
33
+ mail (~> 2.5, >= 2.5.4)
34
+ net-imap
35
+ net-pop
36
+ net-smtp
37
+ rails-dom-testing (~> 2.0)
38
+ actionpack (7.0.1)
39
+ actionview (= 7.0.1)
40
+ activesupport (= 7.0.1)
41
+ rack (~> 2.0, >= 2.2.0)
42
+ rack-test (>= 0.6.3)
43
+ rails-dom-testing (~> 2.0)
44
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
45
+ actiontext (7.0.1)
46
+ actionpack (= 7.0.1)
47
+ activerecord (= 7.0.1)
48
+ activestorage (= 7.0.1)
49
+ activesupport (= 7.0.1)
50
+ globalid (>= 0.6.0)
51
+ nokogiri (>= 1.8.5)
52
+ actionview (7.0.1)
53
+ activesupport (= 7.0.1)
54
+ builder (~> 3.1)
55
+ erubi (~> 1.4)
56
+ rails-dom-testing (~> 2.0)
57
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
58
+ activejob (7.0.1)
59
+ activesupport (= 7.0.1)
60
+ globalid (>= 0.3.6)
13
61
  activemodel (7.0.1)
14
62
  activesupport (= 7.0.1)
15
63
  activerecord (7.0.1)
16
64
  activemodel (= 7.0.1)
17
65
  activesupport (= 7.0.1)
66
+ activestorage (7.0.1)
67
+ actionpack (= 7.0.1)
68
+ activejob (= 7.0.1)
69
+ activerecord (= 7.0.1)
70
+ activesupport (= 7.0.1)
71
+ marcel (~> 1.0)
72
+ mini_mime (>= 1.1.0)
18
73
  activesupport (7.0.1)
19
74
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
75
  i18n (>= 1.6, < 2)
21
76
  minitest (>= 5.1)
22
77
  tzinfo (~> 2.0)
78
+ addressable (2.8.0)
79
+ public_suffix (>= 2.0.2, < 5.0)
23
80
  ast (2.4.2)
81
+ builder (3.2.4)
82
+ capybara (3.36.0)
83
+ addressable
84
+ matrix
85
+ mini_mime (>= 0.1.3)
86
+ nokogiri (~> 1.8)
87
+ rack (>= 1.6.0)
88
+ rack-test (>= 0.6.3)
89
+ regexp_parser (>= 1.5, < 3.0)
90
+ xpath (~> 3.2)
24
91
  closure_tree (7.4.0)
25
92
  activerecord (>= 4.2.10)
26
93
  with_advisory_lock (>= 4.0.0)
27
94
  concurrent-ruby (1.1.9)
95
+ crass (1.0.6)
96
+ debug (1.4.0)
97
+ irb (>= 1.3.6)
98
+ reline (>= 0.2.7)
99
+ digest (3.1.0)
100
+ erubi (1.10.0)
101
+ globalid (1.0.0)
102
+ activesupport (>= 5.0)
28
103
  i18n (1.9.1)
29
104
  concurrent-ruby (~> 1.0)
30
105
  inline_svg (1.8.0)
31
106
  activesupport (>= 3.0)
32
107
  nokogiri (>= 1.6)
108
+ io-console (0.5.11)
109
+ io-wait (0.2.1)
110
+ irb (1.4.1)
111
+ reline (>= 0.3.0)
112
+ loofah (2.13.0)
113
+ crass (~> 1.0.2)
114
+ nokogiri (>= 1.5.9)
115
+ mail (2.7.1)
116
+ mini_mime (>= 0.1.1)
117
+ marcel (1.0.2)
118
+ matrix (0.4.2)
119
+ method_source (1.0.0)
120
+ mini_mime (1.1.2)
33
121
  minitest (5.14.4)
122
+ minitest-spec-rails (6.1.0)
123
+ minitest (>= 5.0)
124
+ railties (>= 4.1)
125
+ net-imap (0.2.3)
126
+ digest
127
+ net-protocol
128
+ strscan
129
+ net-pop (0.1.1)
130
+ digest
131
+ net-protocol
132
+ timeout
133
+ net-protocol (0.1.2)
134
+ io-wait
135
+ timeout
136
+ net-smtp (0.3.1)
137
+ digest
138
+ net-protocol
139
+ timeout
140
+ nio4r (2.5.8)
141
+ nokogiri (1.13.1-arm64-darwin)
142
+ racc (~> 1.4)
34
143
  nokogiri (1.13.1-x86_64-darwin)
35
144
  racc (~> 1.4)
145
+ nokogiri (1.13.1-x86_64-linux)
146
+ racc (~> 1.4)
36
147
  parallel (1.21.0)
37
148
  parser (3.1.0.0)
38
149
  ast (~> 2.4.1)
150
+ public_suffix (4.0.6)
39
151
  racc (1.6.0)
152
+ rack (2.2.3)
153
+ rack-test (1.1.0)
154
+ rack (>= 1.0, < 3)
155
+ rails (7.0.1)
156
+ actioncable (= 7.0.1)
157
+ actionmailbox (= 7.0.1)
158
+ actionmailer (= 7.0.1)
159
+ actionpack (= 7.0.1)
160
+ actiontext (= 7.0.1)
161
+ actionview (= 7.0.1)
162
+ activejob (= 7.0.1)
163
+ activemodel (= 7.0.1)
164
+ activerecord (= 7.0.1)
165
+ activestorage (= 7.0.1)
166
+ activesupport (= 7.0.1)
167
+ bundler (>= 1.15.0)
168
+ railties (= 7.0.1)
169
+ rails-dom-testing (2.0.3)
170
+ activesupport (>= 4.2.0)
171
+ nokogiri (>= 1.6)
172
+ rails-html-sanitizer (1.4.2)
173
+ loofah (~> 2.3)
174
+ railties (7.0.1)
175
+ actionpack (= 7.0.1)
176
+ activesupport (= 7.0.1)
177
+ method_source
178
+ rake (>= 12.2)
179
+ thor (~> 1.0)
180
+ zeitwerk (~> 2.5)
40
181
  rainbow (3.1.1)
41
182
  rake (13.0.3)
42
183
  redcarpet (3.5.1)
43
184
  regexp_parser (2.2.0)
185
+ reline (0.3.1)
186
+ io-console (~> 0.5)
44
187
  rexml (3.2.5)
45
- rouge (3.27.0)
188
+ rouge (3.28.0)
46
189
  rubocop (1.25.0)
47
190
  parallel (~> 1.10)
48
191
  parser (>= 3.1.0.0)
@@ -58,22 +201,47 @@ GEM
58
201
  rubocop (>= 1.7.0, < 2.0)
59
202
  rubocop-ast (>= 0.4.0)
60
203
  ruby-progressbar (1.11.0)
204
+ sprockets (4.0.2)
205
+ concurrent-ruby (~> 1.0)
206
+ rack (> 1, < 3)
207
+ sprockets-rails (3.4.2)
208
+ actionpack (>= 5.2)
209
+ activesupport (>= 5.2)
210
+ sprockets (>= 3.0.0)
211
+ sqlite3 (1.4.2)
61
212
  standard (1.7.0)
62
213
  rubocop (= 1.25.0)
63
214
  rubocop-performance (= 1.13.2)
215
+ strscan (3.0.1)
216
+ thor (1.2.1)
217
+ timeout (0.2.0)
64
218
  tzinfo (2.0.4)
65
219
  concurrent-ruby (~> 1.0)
66
220
  unicode-display_width (2.1.0)
221
+ websocket-driver (0.7.5)
222
+ websocket-extensions (>= 0.1.0)
223
+ websocket-extensions (0.1.5)
67
224
  with_advisory_lock (4.6.0)
68
225
  activerecord (>= 4.2)
226
+ xpath (3.2.0)
227
+ nokogiri (~> 1.8)
228
+ zeitwerk (2.5.4)
69
229
 
70
230
  PLATFORMS
231
+ arm64-darwin-21
71
232
  x86_64-darwin-19
233
+ x86_64-linux
72
234
 
73
235
  DEPENDENCIES
236
+ capybara (>= 3.26)
237
+ debug
74
238
  headmin!
75
239
  minitest (~> 5.0)
240
+ minitest-spec-rails (~> 6.1)
241
+ rails (~> 7.0)
76
242
  rake (~> 13.0)
243
+ sprockets-rails (~> 3.4)
244
+ sqlite3 (~> 1.4)
77
245
  standard (~> 1.7)
78
246
 
79
247
  BUNDLED WITH
data/README.md CHANGED
@@ -4,6 +4,7 @@ A complete library of commonly used components to build an admin interface in yo
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/headmin.svg)](https://rubygems.org/gems/headmin)
6
6
  [![npm version](https://badge.fury.io/js/headmin.svg)](https://www.npmjs.com/package/headmin)
7
+ [![Test suite](https://github.com/frontierdotbe/headmin/actions/workflows/ci.yml/badge.svg)](https://github.com/frontierdotbe/headmin/actions/workflows/ci.yml)
7
8
 
8
9
  ## Installation
9
10
 
@@ -88,6 +89,12 @@ When adding new dependencies, make sure you add them to the `package.json` file
88
89
 
89
90
  ## Testing
90
91
 
92
+ Run tests with
93
+
94
+ ```shell
95
+ rake test
96
+ ```
97
+
91
98
  If you want to test a specific feature in a staging environment without releasing the gem, you can refer to the remote
92
99
  repo in your Gemfile and package.json.
93
100
 
@@ -129,7 +136,8 @@ Update the node package
129
136
 
130
137
  ```shell
131
138
  # Manually update the version number in package.json
132
- $ yarn release
139
+ $ yarn build
140
+ $ npm publish
133
141
  ```
134
142
 
135
143
  ## Contributing
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "bundler/gem_tasks"
4
2
  require "rake/testtask"
5
3
 
@@ -9,8 +7,4 @@ Rake::TestTask.new(:test) do |t|
9
7
  t.test_files = FileList["test/**/*_test.rb"]
10
8
  end
11
9
 
12
- require "rubocop/rake_task"
13
-
14
- RuboCop::RakeTask.new
15
-
16
- task default: %i[test rubocop]
10
+ task default: %i[test]
@@ -1,11 +1,11 @@
1
1
  export default class {
2
- static get locale() {
3
- if (window.I18n === undefined) {
4
- const locale = document.querySelector('html').getAttribute('lang')
5
- window.I18n = {
6
- locale: locale || 'en'
7
- }
8
- }
9
- return window.I18n.locale
2
+ static get locale () {
3
+ if (window.I18n === undefined) {
4
+ const locale = document.querySelector('html').getAttribute('lang')
5
+ window.I18n = {
6
+ locale: locale || 'en'
7
+ }
10
8
  }
11
- }
9
+ return window.I18n.locale
10
+ }
11
+ }