ui_bibz 3.0.0.beta2 → 3.0.0.beta7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +28 -0
- data/.github/workflows/dependencies-checker.yml +13 -0
- data/.github/workflows/linter.yml +16 -0
- data/.rubocop.yml +1 -0
- data/Gemfile.lock +33 -34
- data/README.md +8 -8
- data/lib/ui_bibz/infos.rb +3 -3
- data/lib/ui_bibz/ui/core/forms/files/file_field.rb +8 -14
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +1 -1
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +2 -2
- data/test/simple_form_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +3 -3
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +5 -5
- data/test/ui/core/forms/files/file_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +1 -1
- data/test/ui/core/navigations/navbar_test.rb +4 -4
- data/test/ui/core/windows/modal_test.rb +1 -1
- data/ui_bibz.gemspec +2 -3
- metadata +8 -20
- data/.github/workflows/ruby.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcf81ce4807a05b926ca746d1bf59c6247fcd15f1570b92375f31965e9e2b77c
|
4
|
+
data.tar.gz: c194e18025bdaa41f2d89550f55b84cf96eaa76ce3c7d24802ec0a42c65ce80a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 809d8c0a5adc0a12aace155c5e9d94dd3c99e495922c0b5c55e1ed837ee3c1a98c6e09ef35a5de3b631e99cb21c4b6a4b59cda912168df6dfd4c5f8192eaa4e7
|
7
|
+
data.tar.gz: 6cb6392d902b2750a16c2d4bb17a8a2515294b0c9de8d4a81f1311ae86dc70ab77d8ae8efd987d7dc8ed66ddf9af28daab48152e4e26a6ea3e67c8eb6296f1ab
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
|
13
|
+
- name: Set up Ruby with .ruby-version file
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
bundler-cache: true
|
17
|
+
|
18
|
+
- name: Install gems
|
19
|
+
run: |
|
20
|
+
gem install bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
|
23
|
+
- name: Test with Rake
|
24
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
25
|
+
env:
|
26
|
+
CC_TEST_REPORTER_ID: 7e50558afc7a861280e3194a765a159e9ea5bdd22d2ebe6c13e5e23fe914c66b
|
27
|
+
with:
|
28
|
+
coverageCommand: bundle exec rake
|
@@ -0,0 +1,13 @@
|
|
1
|
+
name: Dependencies Checker
|
2
|
+
|
3
|
+
on: pull_request
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
audit:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- name: 'Bundler Audit'
|
11
|
+
uses: andrewmcodes/bundler-audit-action@main
|
12
|
+
env:
|
13
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (3.0.0.
|
5
|
-
rails (~> 6.0.3, >= 6.0.3.2)
|
4
|
+
ui_bibz (3.0.0.beta7)
|
6
5
|
will-paginate-i18n
|
7
|
-
will_paginate (~> 3.
|
6
|
+
will_paginate (~> 3.3.0)
|
8
7
|
will_paginate-bootstrap4
|
9
8
|
|
10
9
|
GEM
|
@@ -65,16 +64,14 @@ GEM
|
|
65
64
|
minitest (~> 5.1)
|
66
65
|
tzinfo (~> 1.1)
|
67
66
|
zeitwerk (~> 2.2, >= 2.2.2)
|
68
|
-
ast (2.4.
|
67
|
+
ast (2.4.2)
|
69
68
|
awesome_print (1.8.0)
|
70
69
|
builder (3.2.4)
|
71
70
|
byebug (11.1.3)
|
72
71
|
childprocess (4.0.0)
|
73
|
-
|
74
|
-
simplecov
|
75
|
-
concurrent-ruby (1.1.7)
|
72
|
+
concurrent-ruby (1.1.8)
|
76
73
|
crass (1.0.6)
|
77
|
-
docile (1.3.
|
74
|
+
docile (1.3.5)
|
78
75
|
erubi (1.10.0)
|
79
76
|
erubis (2.7.0)
|
80
77
|
factory_bot (4.11.1)
|
@@ -98,14 +95,14 @@ GEM
|
|
98
95
|
haml (>= 4.0, < 6)
|
99
96
|
nokogiri (>= 1.6.0)
|
100
97
|
ruby_parser (~> 3.5)
|
101
|
-
i18n (1.8.
|
98
|
+
i18n (1.8.7)
|
102
99
|
concurrent-ruby (~> 1.0)
|
103
100
|
iniparse (1.5.0)
|
104
101
|
jquery-rails (4.4.0)
|
105
102
|
rails-dom-testing (>= 1, < 3)
|
106
103
|
railties (>= 4.2.0)
|
107
104
|
thor (>= 0.14, < 2.0)
|
108
|
-
loofah (2.
|
105
|
+
loofah (2.9.0)
|
109
106
|
crass (~> 1.0.2)
|
110
107
|
nokogiri (>= 1.5.9)
|
111
108
|
mail (2.7.1)
|
@@ -115,17 +112,19 @@ GEM
|
|
115
112
|
method_source (1.0.0)
|
116
113
|
mimemagic (0.3.5)
|
117
114
|
mini_mime (1.0.2)
|
118
|
-
mini_portile2 (2.
|
119
|
-
minitest (5.14.
|
115
|
+
mini_portile2 (2.5.0)
|
116
|
+
minitest (5.14.3)
|
120
117
|
nio4r (2.5.4)
|
121
|
-
nokogiri (1.
|
122
|
-
mini_portile2 (~> 2.
|
118
|
+
nokogiri (1.11.1)
|
119
|
+
mini_portile2 (~> 2.5.0)
|
120
|
+
racc (~> 1.4)
|
123
121
|
overcommit (0.57.0)
|
124
122
|
childprocess (>= 0.6.3, < 5)
|
125
123
|
iniparse (~> 1.4)
|
126
124
|
parallel (1.20.1)
|
127
|
-
parser (
|
125
|
+
parser (3.0.0.0)
|
128
126
|
ast (~> 2.4.1)
|
127
|
+
racc (1.5.2)
|
129
128
|
rack (2.2.3)
|
130
129
|
rack-test (1.1.0)
|
131
130
|
rack (>= 1.0, < 3)
|
@@ -156,37 +155,37 @@ GEM
|
|
156
155
|
rake (>= 0.8.7)
|
157
156
|
thor (>= 0.20.3, < 2.0)
|
158
157
|
rainbow (3.0.0)
|
159
|
-
rake (13.0.
|
160
|
-
regexp_parser (2.0.
|
158
|
+
rake (13.0.3)
|
159
|
+
regexp_parser (2.0.3)
|
161
160
|
rexml (3.2.4)
|
162
|
-
rubocop (1.
|
161
|
+
rubocop (1.9.0)
|
163
162
|
parallel (~> 1.10)
|
164
|
-
parser (>=
|
163
|
+
parser (>= 3.0.0.0)
|
165
164
|
rainbow (>= 2.2.2, < 4.0)
|
166
165
|
regexp_parser (>= 1.8, < 3.0)
|
167
166
|
rexml
|
168
167
|
rubocop-ast (>= 1.2.0, < 2.0)
|
169
168
|
ruby-progressbar (~> 1.7)
|
170
|
-
unicode-display_width (>= 1.4.0, <
|
171
|
-
rubocop-ast (1.
|
169
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
170
|
+
rubocop-ast (1.4.1)
|
172
171
|
parser (>= 2.7.1.5)
|
173
|
-
rubocop-minitest (0.10.
|
174
|
-
rubocop (>= 0.87)
|
175
|
-
rubocop-performance (1.9.
|
172
|
+
rubocop-minitest (0.10.3)
|
173
|
+
rubocop (>= 0.87, < 2.0)
|
174
|
+
rubocop-performance (1.9.2)
|
176
175
|
rubocop (>= 0.90.0, < 2.0)
|
177
176
|
rubocop-ast (>= 0.4.0)
|
178
|
-
rubocop-rails (2.9.
|
177
|
+
rubocop-rails (2.9.1)
|
179
178
|
activesupport (>= 4.2.0)
|
180
179
|
rack (>= 1.1)
|
181
180
|
rubocop (>= 0.90.0, < 2.0)
|
182
|
-
ruby-progressbar (1.
|
183
|
-
ruby_parser (3.15.
|
181
|
+
ruby-progressbar (1.11.0)
|
182
|
+
ruby_parser (3.15.1)
|
184
183
|
sexp_processor (~> 4.9)
|
185
|
-
sexp_processor (4.15.
|
184
|
+
sexp_processor (4.15.2)
|
186
185
|
simple_form (5.0.3)
|
187
186
|
actionpack (>= 5.0)
|
188
187
|
activemodel (>= 5.0)
|
189
|
-
simplecov (0.
|
188
|
+
simplecov (0.21.2)
|
190
189
|
docile (~> 1.1)
|
191
190
|
simplecov-html (~> 0.11)
|
192
191
|
simplecov_json_formatter (~> 0.1)
|
@@ -201,17 +200,17 @@ GEM
|
|
201
200
|
sprockets (>= 3.0.0)
|
202
201
|
sqlite3 (1.4.2)
|
203
202
|
temple (0.8.2)
|
204
|
-
thor (1.0
|
203
|
+
thor (1.1.0)
|
205
204
|
thread_safe (0.3.6)
|
206
205
|
tilt (2.0.10)
|
207
|
-
tzinfo (1.2.
|
206
|
+
tzinfo (1.2.9)
|
208
207
|
thread_safe (~> 0.1)
|
209
|
-
unicode-display_width (
|
208
|
+
unicode-display_width (2.0.0)
|
210
209
|
websocket-driver (0.7.3)
|
211
210
|
websocket-extensions (>= 0.1.0)
|
212
211
|
websocket-extensions (0.1.5)
|
213
212
|
will-paginate-i18n (0.1.15)
|
214
|
-
will_paginate (3.
|
213
|
+
will_paginate (3.3.0)
|
215
214
|
will_paginate-bootstrap4 (0.2.2)
|
216
215
|
will_paginate (~> 3.0, >= 3.0.0)
|
217
216
|
zeitwerk (2.4.2)
|
@@ -222,12 +221,12 @@ PLATFORMS
|
|
222
221
|
DEPENDENCIES
|
223
222
|
awesome_print
|
224
223
|
byebug
|
225
|
-
codeclimate-test-reporter
|
226
224
|
factory_bot_rails (~> 4.0)
|
227
225
|
haml-rails
|
228
226
|
jquery-rails (>= 3.1.0)
|
229
227
|
minitest
|
230
228
|
overcommit
|
229
|
+
rails (~> 6.0.3, >= 6.0.3.2)
|
231
230
|
rubocop
|
232
231
|
rubocop-ast
|
233
232
|
rubocop-minitest
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
![Ui Bibz logo](https://repository-images.githubusercontent.com/29547689/e29b2180-0d59-11eb-89f3-4541571d7c67)
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/ui_bibz.svg)](
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![
|
8
|
-
[![
|
9
|
-
![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/ui_bibz.svg)](https://badge.fury.io/rb/ui_bibz)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/cfbe9828c32d69581534/maintainability)](https://codeclimate.com/github/thooams/ui_bibz/maintainability)
|
5
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/cfbe9828c32d69581534/test_coverage)](https://codeclimate.com/github/thooams/ui_bibz/test_coverage)
|
6
|
+
[![security](https://hakiri.io/github/thooams/ui_bibz/main.svg)](https://hakiri.io/github/thooams/ui_bibz/main)
|
7
|
+
[![Ci](https://github.com/thooams/ui_bibz/workflows/CI/badge.svg)](https://github.com/thooams/ui_bibz/actions)
|
8
|
+
[![Linter](https://github.com/thooams/chart_bibz/workflows/Linter/badge.svg)](https://github.com/thooams/chart_bibz/actions)
|
9
|
+
[![Inline docs](http://inch-ci.org/github/thooams/ui_bibz.svg?branch=main)](http://inch-ci.org/github/thooams/ui_bibz)
|
10
10
|
|
11
11
|
This project rocks and uses MIT-LICENSE.
|
12
12
|
|
@@ -22,7 +22,7 @@ Full documentation is here with bootstrap 5:
|
|
22
22
|
[Ui Bibz v3](http://hummel.link/ui-bibz/)
|
23
23
|
|
24
24
|
Older documentation is here with bootstrap 4:
|
25
|
-
[Ui Bibz v2.5](http://hummel.link/
|
25
|
+
[Ui Bibz v2.5](http://hummel.link/ui-bibz/docs/v2.5/)
|
26
26
|
|
27
27
|
|
28
28
|
## Donate
|
data/lib/ui_bibz/infos.rb
CHANGED
@@ -7,11 +7,11 @@ module UiBibz
|
|
7
7
|
DESCRIPTION = "A Rails Interface Framework using Bootstrap #{BOOTSTRAP_VERSION}."
|
8
8
|
SUMMARY = "Ui Bibz is an Ui Framework that allows you to build an interface very quickly and simply using Bootstrap #{BOOTSTRAP_VERSION}."
|
9
9
|
LICENSE = 'MIT'
|
10
|
-
FONTAWESOME_VERSION = '5.15.
|
10
|
+
FONTAWESOME_VERSION = '5.15.2'
|
11
11
|
HOMEPAGE = 'https://hummel.link/ui-bibz/'
|
12
|
-
REPO = 'git+https://github.com/thooams/
|
12
|
+
REPO = 'git+https://github.com/thooams/ui_bibz.git'
|
13
13
|
EMAIL = 'thomas@hummel.link'
|
14
14
|
AUTHOR = 'Thooams [Thomas HUMMEL]'
|
15
|
-
VERSION = '3.0.0.
|
15
|
+
VERSION = '3.0.0.beta7'
|
16
16
|
AUTHORS = ['Thooams'].freeze
|
17
17
|
end
|
@@ -45,19 +45,17 @@ module UiBibz::Ui::Core::Forms::Files
|
|
45
45
|
|
46
46
|
# Render html tag
|
47
47
|
def pre_render
|
48
|
-
|
49
|
-
concat file_field_tag content, class: 'form-file-input', multiple: options[:multiple], disabled: disabled?
|
50
|
-
concat label_text_and_button
|
51
|
-
end
|
48
|
+
file_field_tag content, html_options
|
52
49
|
end
|
53
50
|
|
54
51
|
private
|
55
52
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
def component_html_options
|
54
|
+
super.merge({
|
55
|
+
multiple: options[:multiple],
|
56
|
+
disabled: disabled?,
|
57
|
+
value: format_value(options[:input_text] || options[:value])
|
58
|
+
})
|
61
59
|
end
|
62
60
|
|
63
61
|
def format_value(value)
|
@@ -70,12 +68,8 @@ module UiBibz::Ui::Core::Forms::Files
|
|
70
68
|
value.to_s
|
71
69
|
end
|
72
70
|
|
73
|
-
def label_name
|
74
|
-
html_options[:id] || content
|
75
|
-
end
|
76
|
-
|
77
71
|
def component_html_classes
|
78
|
-
super << 'form-
|
72
|
+
super << 'form-control'
|
79
73
|
end
|
80
74
|
end
|
81
75
|
end
|
@@ -163,7 +163,7 @@ module UiBibz::Ui::Core::Navigations
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def navbar_toggle_button_html
|
166
|
-
content_tag :button, '☰', class: 'navbar-toggler hidden-sm-up', type: :button, data: { "bs-toggle": 'collapse', target: "##{id}" }
|
166
|
+
content_tag :button, '☰', class: 'navbar-toggler hidden-sm-up', type: :button, data: { "bs-toggle": 'collapse', "bs-target": "##{id}" }
|
167
167
|
end
|
168
168
|
|
169
169
|
def expand_size
|
@@ -15,7 +15,7 @@ module PopoverExtension
|
|
15
15
|
|
16
16
|
return unless options[:popover].is_a?(Hash)
|
17
17
|
|
18
|
-
POPOVER_METHODS.each { |mth| add_html_data(mth, value: options[:popover].try(:[], mth)) unless options[:popover].try(:[], mth).nil? }
|
18
|
+
POPOVER_METHODS.each { |mth| add_html_data("bs-#{mth}", value: options[:popover].try(:[], mth)) unless options[:popover].try(:[], mth).nil? }
|
19
19
|
add_html_data 'bs-placement', value: options[:popover].try(:[], :position) unless options[:popover].try(:[], :position).nil?
|
20
20
|
end
|
21
21
|
|
@@ -25,7 +25,7 @@ module PopoverExtension
|
|
25
25
|
add_html_data 'bs-toggle', value: 'tooltip'
|
26
26
|
|
27
27
|
if options[:tooltip].is_a?(Hash)
|
28
|
-
TOOLTIP_METHODS.each { |mth| add_html_data(mth, value: options[:tooltip].try(:[], mth)) unless options[:tooltip].try(:[], mth).nil? }
|
28
|
+
TOOLTIP_METHODS.each { |mth| add_html_data("bs-#{mth}", value: options[:tooltip].try(:[], mth)) unless options[:tooltip].try(:[], mth).nil? }
|
29
29
|
add_html_data 'bs-placement', value: options[:tooltip].try(:[], :position) unless options[:tooltip].try(:[], :position).nil?
|
30
30
|
else
|
31
31
|
add_html_data :title, value: options[:tooltip] == true ? sanitize_text(content) : options[:tooltip]
|
data/test/simple_form_test.rb
CHANGED
@@ -202,7 +202,7 @@ test1</textarea></div></form>"
|
|
202
202
|
f.input :name_fr, as: :ui_file_field
|
203
203
|
end
|
204
204
|
|
205
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><
|
205
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"file\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_file_field optional form-control\" /></div></form>"
|
206
206
|
|
207
207
|
assert_equal expected, actual
|
208
208
|
end
|
@@ -47,7 +47,7 @@ class ButtonGroupTest < ActionView::TestCase
|
|
47
47
|
d.link 'Link 1', url: '#link1', glyph: 'eye'
|
48
48
|
end
|
49
49
|
end
|
50
|
-
expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
50
|
+
expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a></div></div></div>"
|
51
51
|
|
52
52
|
assert_equal expected, actual
|
53
53
|
end
|
@@ -90,8 +90,8 @@ class ButtonTest < ActionView::TestCase
|
|
90
90
|
end
|
91
91
|
|
92
92
|
test 'button with complex popover' do
|
93
|
-
actual = ui_button('My Button', popover: { content: 'My popover', position: :left })
|
94
|
-
expected = '<button data-bs-toggle="popover" data-bs-content="My popover" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
93
|
+
actual = ui_button('My Button', popover: { content: 'My popover', position: :left, html: true })
|
94
|
+
expected = '<button data-bs-toggle="popover" data-bs-content="My popover" data-bs-html="true" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
95
95
|
|
96
96
|
assert_equal expected, actual
|
97
97
|
end
|
@@ -105,7 +105,7 @@ class ButtonTest < ActionView::TestCase
|
|
105
105
|
|
106
106
|
test 'button with complex tooltip' do
|
107
107
|
actual = ui_button('My Button', tooltip: { title: 'My tooltip', position: :left })
|
108
|
-
expected = '<button data-bs-toggle="tooltip" data-title="My tooltip" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
108
|
+
expected = '<button data-bs-toggle="tooltip" data-bs-title="My tooltip" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
109
109
|
|
110
110
|
assert_equal expected, actual
|
111
111
|
end
|
@@ -8,7 +8,7 @@ class DropdownTest < ActionView::TestCase
|
|
8
8
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown').tap do |d|
|
9
9
|
d.link 'link'
|
10
10
|
end
|
11
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
11
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
12
12
|
|
13
13
|
assert_equal expected, actual.render
|
14
14
|
end
|
@@ -17,7 +17,7 @@ class DropdownTest < ActionView::TestCase
|
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown', status: :primary).tap do |d|
|
18
18
|
d.link 'link'
|
19
19
|
end
|
20
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
20
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
21
21
|
|
22
22
|
assert_equal expected, actual.render
|
23
23
|
end
|
@@ -26,7 +26,7 @@ class DropdownTest < ActionView::TestCase
|
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown', status: :primary, outline: true).tap do |d|
|
27
27
|
d.link 'link'
|
28
28
|
end
|
29
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-outline-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
29
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-outline-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
30
30
|
|
31
31
|
assert_equal expected, actual.render
|
32
32
|
end
|
@@ -39,7 +39,7 @@ class DropdownTest < ActionView::TestCase
|
|
39
39
|
d.divider
|
40
40
|
d.link 'Link3', url: '#link3'
|
41
41
|
end
|
42
|
-
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
42
|
+
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fas fa-diamond\"></i> Dropdown</button><div class=\"dropdown-menu dropdown-menu-end\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
43
43
|
|
44
44
|
assert_equal expected, actual.render
|
45
45
|
end
|
@@ -48,7 +48,7 @@ class DropdownTest < ActionView::TestCase
|
|
48
48
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Split Dropdown').tap do |d|
|
49
49
|
d.link 'state'
|
50
50
|
end
|
51
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
51
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
52
52
|
|
53
53
|
assert_equal expected, actual.render
|
54
54
|
end
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class FileFieldTest < ActionView::TestCase
|
6
6
|
test 'file_field' do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Files::FileField.new('test').render
|
8
|
-
expected = "<
|
8
|
+
expected = "<input type=\"file\" name=\"test\" id=\"test\" value=\"\" class=\"form-control\" />"
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -31,7 +31,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
31
31
|
d.link 'Link3', url: '#link3'
|
32
32
|
end
|
33
33
|
end.render
|
34
|
-
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-
|
34
|
+
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
35
35
|
|
36
36
|
assert_equal expected, actual
|
37
37
|
end
|
@@ -4,14 +4,14 @@ require 'test_helper'
|
|
4
4
|
class NavbarTest < ActionView::TestCase
|
5
5
|
test 'Navbar' do
|
6
6
|
actual = UiBibz::Ui::Core::Navigations::Navbar.new
|
7
|
-
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
7
|
+
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
8
8
|
|
9
9
|
assert_equal expected, actual.render
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'Navbar with options' do
|
13
13
|
actual = UiBibz::Ui::Core::Navigations::Navbar.new(title: 'Brand', expand_size: :xs, status: :primary, position: :top, brand_position: :right)
|
14
|
-
expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
14
|
+
expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
15
15
|
|
16
16
|
assert_equal expected, actual.render
|
17
17
|
end
|
@@ -30,7 +30,7 @@ class NavbarTest < ActionView::TestCase
|
|
30
30
|
end
|
31
31
|
nb.text 'test'
|
32
32
|
end
|
33
|
-
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
|
33
|
+
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
|
34
34
|
|
35
35
|
assert_equal expected, actual.render
|
36
36
|
end
|
@@ -43,7 +43,7 @@ class NavbarTest < ActionView::TestCase
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
expected =
|
46
|
-
"<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
|
46
|
+
"<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
|
47
47
|
|
48
48
|
assert_equal expected, actual.render
|
49
49
|
end
|
@@ -28,7 +28,7 @@ class UiHelperTest < ActionView::TestCase
|
|
28
28
|
concat ui_button_link 'Save', url: '#', status: :primary
|
29
29
|
end
|
30
30
|
end
|
31
|
-
expected = "<div data-backdrop=\"static\" data-keyboard=\"false\" class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog modal-fullscreen modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
31
|
+
expected = "<div data-bs-backdrop=\"static\" data-bs-keyboard=\"false\" class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog modal-fullscreen modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
32
32
|
|
33
33
|
assert_equal expected, actual
|
34
34
|
end
|
data/ui_bibz.gemspec
CHANGED
@@ -27,15 +27,14 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.require_paths = %w[lib vendor]
|
28
28
|
|
29
29
|
# Rails gems
|
30
|
-
s.
|
30
|
+
s.add_development_dependency 'rails', '~> 6.0.3', '>= 6.0.3.2'
|
31
31
|
|
32
32
|
# Remove these dependencies after
|
33
|
-
s.add_dependency 'will_paginate', '~> 3.
|
33
|
+
s.add_dependency 'will_paginate', '~> 3.3.0'
|
34
34
|
s.add_dependency 'will_paginate-bootstrap4'
|
35
35
|
s.add_dependency 'will-paginate-i18n'
|
36
36
|
|
37
37
|
# Development gems
|
38
|
-
s.add_development_dependency 'codeclimate-test-reporter'
|
39
38
|
s.add_development_dependency 'factory_bot_rails', '~> 4.0'
|
40
39
|
s.add_development_dependency 'haml-rails'
|
41
40
|
s.add_development_dependency 'minitest'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.beta7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams [Thomas HUMMEL]
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 6.0.3.2
|
23
|
-
type: :
|
23
|
+
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 3.
|
39
|
+
version: 3.3.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 3.
|
46
|
+
version: 3.3.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: will_paginate-bootstrap4
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,20 +72,6 @@ dependencies:
|
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: codeclimate-test-reporter
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
75
|
- !ruby/object:Gem::Dependency
|
90
76
|
name: factory_bot_rails
|
91
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,7 +248,9 @@ extensions: []
|
|
262
248
|
extra_rdoc_files: []
|
263
249
|
files:
|
264
250
|
- ".github/FUNDING.yml"
|
265
|
-
- ".github/workflows/
|
251
|
+
- ".github/workflows/ci.yml"
|
252
|
+
- ".github/workflows/dependencies-checker.yml"
|
253
|
+
- ".github/workflows/linter.yml"
|
266
254
|
- ".gitignore"
|
267
255
|
- ".gitlab-ci.yml"
|
268
256
|
- ".overcommit.yml"
|
data/.github/workflows/ruby.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
name: Ruby
|
2
|
-
|
3
|
-
on: [push]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
|
8
|
-
runs-on: ubuntu-latest
|
9
|
-
|
10
|
-
steps:
|
11
|
-
- uses: actions/checkout@v1
|
12
|
-
- name: Setup System
|
13
|
-
run: |
|
14
|
-
sudo apt-get install libsqlite3-dev
|
15
|
-
- name: Set up Ruby 2.7
|
16
|
-
uses: actions/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
ruby-version: 2.7.x
|
19
|
-
- name: Build and test with Rake
|
20
|
-
run: |
|
21
|
-
gem install bundler
|
22
|
-
bundle install --jobs 4 --retry 3
|
23
|
-
bundle exec rake
|