ui_bibz 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ea698e25d31853e0cf7b8fe660f0b5ec71495e8fb76e5669aaa101a037c43ec
4
- data.tar.gz: d9c1a0975f1799f749b767743fea8ab0e9cac10a22694417bb9aae162aefad15
3
+ metadata.gz: d230136d48595c4f4300a001323a7d19ea58863dcca0486cfbfdaa9c1cb4e787
4
+ data.tar.gz: 82720943d66e77dffd6a566ca8992abc02e743c2ca1eb7a8595fa75b2747049a
5
5
  SHA512:
6
- metadata.gz: d2f33e5118202bddb6a7dd05e4db66dc92bbe9e9aa8598ee055aa0756352566b1052c2d6bae950647880d39cc2daf4c1bc3d69169c144fd54115dd40940bc035
7
- data.tar.gz: 9fc847dbd4165c92043f7376276db0720f102ed98a4af29161fd4fd48225fcfc930db39a90895b975a97196678618efec022998f8c15f5c94be94003b813efce
6
+ metadata.gz: 0b2b7c559fcbe30355f716c6140fccdabbe0afbaa883753c257602de2d148ea2cf680da2566150d7a4bbc4438a6dc7f491cfc36cdc0b19b6fef8220f0a44976f
7
+ data.tar.gz: ecc26cc0be6fcf85b77a92fa35ed65888f17fcb73061d4655dabcca4ea26123828b0730ebdef3f3487e471210653f2d6d8bc17b275bc2f4f65b58592c8ed7937
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.1)
4
+ ui_bibz (3.0.2)
5
5
  will-paginate-i18n
6
6
  will_paginate (~> 3.3.0)
7
7
  will_paginate-bootstrap4
@@ -1,5 +1,8 @@
1
1
  en:
2
2
  ui_bibz:
3
+ table:
4
+ pagination:
5
+ per_page: 'Per page: '
3
6
  grid:
4
7
  pagination:
5
8
  per_page: 'Per page: '
@@ -1,5 +1,8 @@
1
1
  fr:
2
2
  ui_bibz:
3
+ table:
4
+ pagination:
5
+ per_page: 'Par page : '
3
6
  grid:
4
7
  pagination:
5
8
  per_page: 'Par page : '
@@ -16,38 +16,45 @@ module UiBibz::Concerns::Models::Searchable
16
16
 
17
17
  def self.generate_parameters
18
18
  {
19
- controller: @arguments[:controller] || @params[:controller],
19
+ controller: @params[:controller],
20
+ actions_controller: @arguments[:actions_controller] || @params[:controller],
20
21
  param_id: @params[:id],
21
22
  params: @params,
22
- direction: @params[:direction],
23
- search: @params[:search],
24
- sort: @params[:sort],
23
+ direction: @tmp_params[:direction],
24
+ search: @tmp_params[:search],
25
+ sort: @tmp_params[:sort],
25
26
  action: @params[:action],
26
27
  column_id: @params[:column_id],
27
- id: @arguments[:store_id],
28
+ id: store_id,
28
29
  records: search_sort_paginate,
29
30
  searchable_attributes: @searchable_attributes,
30
31
  model: create_model
31
32
  }
32
33
  end
33
34
 
35
+ def self.store_id
36
+ @arguments[:store_id] || @arguments[:controller] || @params[:controller]
37
+ end
38
+
34
39
  def self.create_model
35
40
  @arguments[:model].nil? ? self : @arguments[:model].to_s.camelize.classify.constantize
36
41
  end
37
42
 
38
43
  # If there is more one table in html page
39
44
  def self.initialize_params
40
- @tmp_params = { per_page: @arguments[:per_page] }
45
+ @tmp_params = (session_store || { 'per_page' => @arguments[:per_page] || 30 }).with_indifferent_access
41
46
 
42
47
  return unless good_store_id?
43
48
 
44
49
  @tmp_params = {
45
- search: @params[:search],
46
- per_page: @params[:per_page] || @arguments[:per_page],
47
- page: new_search? ? nil : @params[:page],
48
- sort: @params[:sort],
49
- direction: @params[:direction]
50
- }
50
+ 'search' => @params[:search] || @tmp_params['search'],
51
+ 'per_page' => @params[:per_page] || @tmp_params['per_page'] || @arguments[:per_page],
52
+ 'page' => @params[:page],
53
+ 'sort' => @params[:sort] || @tmp_params['sort'],
54
+ 'direction' => @params[:direction] || @tmp_params['direction']
55
+ }.with_indifferent_access
56
+
57
+ @session[store_id] = @tmp_params
51
58
  end
52
59
 
53
60
  def self.search
@@ -75,15 +82,15 @@ module UiBibz::Concerns::Models::Searchable
75
82
 
76
83
  def self.generate_default_sql(sql)
77
84
  if sorting?
78
- sql.paginate(page: @tmp_params[:page], per_page: @session[:per_page])
85
+ sql.paginate(page: @tmp_params[:page], per_page: @tmp_params[:per_page])
79
86
  else
80
- sql.reorder(order_sql).paginate(page: @tmp_params[:page], per_page: @session[:per_page])
87
+ sql.reorder(order_sql).paginate(page: @tmp_params[:page], per_page: @tmp_params[:per_page])
81
88
  end
82
89
  end
83
90
 
84
91
  def self.generate_count_sql(sql)
85
92
  sq = "SELECT * FROM (#{sql.group("#{table_name}.id").to_sql}) countable ORDER BY countable.count #{@tmp_params[:direction] || asc}"
86
- paginate_by_sql(sq, page: @tmp_params[:page], per_page: @session[:per_page])
93
+ paginate_by_sql(sq, page: @tmp_params[:page], per_page: @tmp_params[:per_page])
87
94
  end
88
95
 
89
96
  def self.generate_select_count_sort_query(sql, column_args)
@@ -147,13 +154,16 @@ module UiBibz::Concerns::Models::Searchable
147
154
  end
148
155
 
149
156
  def self.search_sort_paginate
150
- @session[:per_page] = @tmp_params[:per_page] unless @tmp_params[:per_page].nil?
151
157
  search
152
158
  end
153
159
 
160
+ def self.session_store
161
+ @session[store_id]
162
+ end
163
+
154
164
  # If there's several table in the same page
155
165
  def self.good_store_id?
156
- @arguments[:store_id] == @params[:store_id]
166
+ @params[:store_id].nil? ? true : store_id == @params[:store_id]
157
167
  end
158
168
 
159
169
  def self.new_search?
data/lib/ui_bibz/infos.rb CHANGED
@@ -12,6 +12,6 @@ module UiBibz
12
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.1'
15
+ VERSION = '3.0.2'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -51,9 +51,9 @@ module UiBibz::Ui::Ux::Tables
51
51
 
52
52
  def defaults_actions
53
53
  [
54
- UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(show_name, url: { controller: @store.controller, action: 'show', id: :id }, glyph: 'eye').render,
55
- UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(edit_name, url: { controller: @store.controller, action: 'edit', id: :id }, glyph: 'edit').render,
56
- UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(delete_name, { glyph: 'trash', url: { controller: @store.controller, action: 'destroy', id: :id }, link_html_options: { data: { confirm: 'Are you sure?', method: :delete } } }).render
54
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(show_name, url: { controller: @store.actions_controller, action: 'show', id: :id }, glyph: 'eye').render,
55
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(edit_name, url: { controller: @store.actions_controller, action: 'edit', id: :id }, glyph: 'edit').render,
56
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(delete_name, { glyph: 'trash', url: { controller: @store.actions_controller, action: 'destroy', id: :id }, link_html_options: { data: { confirm: 'Are you sure?', method: :delete } } }).render
57
57
  ]
58
58
  end
59
59
 
@@ -70,6 +70,10 @@ module UiBibz::Ui::Ux::Tables
70
70
  @store.controller
71
71
  end
72
72
 
73
+ def actions_controller
74
+ @store.actions_controller
75
+ end
76
+
73
77
  def params
74
78
  @store.params || {}
75
79
  end
@@ -39,8 +39,8 @@ module UiBibz::Ui::Ux::Tables
39
39
  # Render html tag with boostrap pagination theme
40
40
  def render
41
41
  paginate_parameters = { controller: store.controller }
42
- paginate_parameters = paginate_parameters.merge({ store_id: store.id }) unless store.id.nil?
43
42
  paginate_parameters = paginate_parameters.merge(store.parameters)
43
+ paginate_parameters = paginate_parameters.merge({ store_id: store.id }) unless store.id.nil?
44
44
  paginate_parameters = paginate_parameters.merge({ link_type: 'pagination' })
45
45
  will_paginate(store.records, params: paginate_parameters.with_indifferent_access.reject { |k, v| default_parameters?(k) || v.blank? }, renderer: WillPaginate::ActionView::BootstrapLinkRenderer)
46
46
  end
@@ -57,7 +57,7 @@ module UiBibz::Ui::Ux::Tables
57
57
  content_tag :div, class: 'table-pagination-per-page' do
58
58
  concat results_count_html
59
59
  concat UiBibz::Utils::Internationalization.new('ui_bibz.table.pagination.per_page', default: 'Per page: ').translate
60
- concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-control')
60
+ concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-select')
61
61
  end
62
62
  end
63
63
 
@@ -68,7 +68,7 @@ module UiBibz::Ui::Ux::Tables
68
68
  store.parameters.with_indifferent_access.reject { |k, v| default_parameters?(k) || v.blank? }.each do |k, v|
69
69
  concat tag(:input, type: 'hidden', name: k, value: v)
70
70
  end
71
- concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-control')
71
+ concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-select')
72
72
  concat tag(:input, type: 'hidden', name: 'store_id', value: store.id) unless store.id.nil? # If there is more 1 table in html page
73
73
  end
74
74
  end
@@ -62,11 +62,7 @@ module UiBibz::Ui::Ux::Tables
62
62
  end
63
63
 
64
64
  def search_content
65
- if store.id.nil?
66
- store.search
67
- else
68
- store.id == store.params[:store_id] ? store.search : ''
69
- end
65
+ store.search
70
66
  end
71
67
 
72
68
  def clear_button
@@ -26,14 +26,14 @@ class TableTest < ActionView::TestCase
26
26
 
27
27
  test 'table search field' do
28
28
  actual = UiBibz::Ui::Ux::Tables::TableSearchField.new({ store: @users }).render
29
- expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form>"
29
+ expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form>"
30
30
 
31
31
  assert_equal expected, actual
32
32
  end
33
33
 
34
34
  test 'table pagination' do
35
35
  actual = UiBibz::Ui::Ux::Tables::TablePagination.new({ store: @users }).render
36
- expected = "<nav class=\"pagination\"><ul class=\"pagination\" role=\"group\"><li class=\"previous page-item disabled\"><span class=\"page-link\">&laquo;</span></li> <li class=\"page-item active\"><span class=\"page-link\">1</span></li> <li class=\"page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr\">2</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=3&amp;search=Name+fr&amp;sort=users.name_fr\">3</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=4&amp;search=Name+fr&amp;sort=users.name_fr\">4</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=5&amp;search=Name+fr&amp;sort=users.name_fr\">5</a></li> <li class=\"page-item disabled\"><i class=\"page-link\">&hellip;</i></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=12&amp;search=Name+fr&amp;sort=users.name_fr\">12</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=13&amp;search=Name+fr&amp;sort=users.name_fr\">13</a></li> <li class=\"next page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr\">&raquo;</a></li></ul></nav>"
36
+ expected = "<nav class=\"pagination\"><ul class=\"pagination\" role=\"group\"><li class=\"previous page-item disabled\"><span class=\"page-link\">&laquo;</span></li> <li class=\"page-item active\"><span class=\"page-link\">1</span></li> <li class=\"page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">2</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=3&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">3</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=4&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">4</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=5&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">5</a></li> <li class=\"page-item disabled\"><i class=\"page-link\">&hellip;</i></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=12&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">12</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=13&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">13</a></li> <li class=\"next page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">&raquo;</a></li></ul></nav>"
37
37
 
38
38
  assert_equal expected, actual
39
39
  end
@@ -49,7 +49,7 @@ class TableTest < ActionView::TestCase
49
49
  test 'table sortable' do
50
50
  options = { sortable: true }
51
51
  actual = UiBibz::Ui::Ux::Tables::Sortable.new(@store, options).header(@store.columns.list.first)
52
- expected = '<a class="dropup" href="/users?column_id=id&amp;direction=asc&amp;link_type=column&amp;search=Name+fr&amp;sort=users.id">Id</a>'
52
+ expected = '<a class="dropup" href="/users?column_id=id&amp;direction=asc&amp;link_type=column&amp;search=Name+fr&amp;sort=users.id&amp;store_id=users">Id</a>'
53
53
 
54
54
  assert_equal expected, actual
55
55
  end
@@ -66,14 +66,14 @@ class TableTest < ActionView::TestCase
66
66
  options = { paginable: true }
67
67
  pagination = UiBibz::Ui::Ux::Tables::Paginable.new(@store, options)
68
68
  actual = pagination.render if pagination.paginable?
69
- expected = "<div><nav class=\"pagination\"><ul class=\"pagination\" role=\"group\"><li class=\"previous page-item disabled\"><span class=\"page-link\">&laquo;</span></li> <li class=\"page-item active\"><span class=\"page-link\">1</span></li> <li class=\"page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr\">2</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=3&amp;search=Name+fr&amp;sort=users.name_fr\">3</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=4&amp;search=Name+fr&amp;sort=users.name_fr\">4</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=5&amp;search=Name+fr&amp;sort=users.name_fr\">5</a></li> <li class=\"page-item disabled\"><i class=\"page-link\">&hellip;</i></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=12&amp;search=Name+fr&amp;sort=users.name_fr\">12</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=13&amp;search=Name+fr&amp;sort=users.name_fr\">13</a></li> <li class=\"next page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr\">&raquo;</a></li></ul></nav><form action=\"/users\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"table-pagination-per-page\">Displaying User <b>1&nbsp;-&nbsp;2</b> of <b>25</b> in total | Per page: <input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><select name=\"per_page\" id=\"per_page\" class=\"form-control\"><option value=\"5\">5</option>
69
+ expected = "<div><nav class=\"pagination\"><ul class=\"pagination\" role=\"group\"><li class=\"previous page-item disabled\"><span class=\"page-link\">&laquo;</span></li> <li class=\"page-item active\"><span class=\"page-link\">1</span></li> <li class=\"page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">2</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=3&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">3</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=4&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">4</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=5&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">5</a></li> <li class=\"page-item disabled\"><i class=\"page-link\">&hellip;</i></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=12&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">12</a></li> <li class=\"page-item\"><a class=\"page-link\" href=\"/users?direction=asc&amp;page=13&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">13</a></li> <li class=\"next page-item\"><a class=\"page-link\" rel=\"next\" href=\"/users?direction=asc&amp;page=2&amp;search=Name+fr&amp;sort=users.name_fr&amp;store_id=users\">&raquo;</a></li></ul></nav><form action=\"/users\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"table-pagination-per-page\">Displaying User <b>1&nbsp;-&nbsp;2</b> of <b>25</b> in total | Per page: <input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><select name=\"per_page\" id=\"per_page\" class=\"form-select\"><option value=\"5\">5</option>
70
70
  <option value=\"10\">10</option>
71
71
  <option value=\"20\">20</option>
72
72
  <option value=\"30\">30</option>
73
73
  <option value=\"50\">50</option>
74
74
  <option value=\"100\">100</option>
75
75
  <option value=\"200\">200</option>
76
- <option value=\"500\">500</option></select></div></form></div>"
76
+ <option value=\"500\">500</option></select><input type=\"hidden\" name=\"store_id\" value=\"users\" /></div></form></div>"
77
77
 
78
78
  assert_equal expected, actual
79
79
  end
@@ -97,7 +97,7 @@ class TableTest < ActionView::TestCase
97
97
  test 'table searchable' do
98
98
  options = { searchable: true }
99
99
  actual = UiBibz::Ui::Ux::Tables::Searchable.new(@store, options).render
100
- expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form><br class=\"ui-bibz-clear\" /></div>"
100
+ expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form><br class=\"ui-bibz-clear\" /></div>"
101
101
 
102
102
  assert_equal expected, actual
103
103
  end
@@ -130,10 +130,10 @@ class TableTest < ActionView::TestCase
130
130
  end
131
131
 
132
132
  test 'table actionable with antoher controller' do
133
- @users = User.table_search_pagination(params, session, { controller: "areas" })
133
+ @users = User.table_search_pagination(params, session, { actions_controller: "areas" })
134
134
  @store = UiBibz::Ui::Ux::Tables::Store.new @users
135
135
 
136
- assert_equal("areas", @store.controller)
136
+ assert_equal("areas", @store.actions_controller)
137
137
  end
138
138
 
139
139
  test 'table non actionable header' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams [Thomas HUMMEL]