sn_filterable 1.0.1 → 1.1.0

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: 1d92b60cf8e65b1e9e7ff21155740d51f9a1a4b6b7bf7e81ba5a3d074c9fd8df
4
- data.tar.gz: fba0177360cf72c903a695fb10adcf05daffbcca0be615c7ba5c6dd989f69267
3
+ metadata.gz: c1b9cd4e29b1ae510d91132581e2bbd2f161ce990fc1e7ec6608d6f7bdb1b41c
4
+ data.tar.gz: 88eca5cf836c294bfb9853dc8bf321d63d7896115e6bdafc35faa8218c66f726
5
5
  SHA512:
6
- metadata.gz: ad2f3ec556867d5f643aa234de026dd4513ffb9866b78120ed863bbf136fff8e6ad08794ab670205063d46c271cff1b70b4dac637ce34b832c173aa48ca504ba
7
- data.tar.gz: 8c10a4fb5ec63e12dd3ac35a6edbd49873a2fefb15e0836892f363b4121e80ce38f7ec71c2a65ee31a3ec6295d81741a56882d71a3c3769e092da6d1bbbbb372
6
+ metadata.gz: d0ac7e1edc645cb96066facb446d424237abfb064c2143863a97cc88dbc758483f62be811403728fb0b14e3436a654877bbedcc9783c0b59e27a30b9c7b3c09b
7
+ data.tar.gz: 39991b7cfacb996f545bb0aae07a4f18a6c316ca65f884b78b2b5fe7f4082c8cab0bf6cabe208aafa870392f9be09d8a2c1b5c0dbefac70ede1d4986b97daed8
data/README.md CHANGED
@@ -20,7 +20,7 @@ There are a couple key requirements for your app to be compatible with this gem:
20
20
  Add this line to your application's Gemfile:
21
21
 
22
22
  ```ruby
23
- gem "sn_filterable", git: "https://github.com/ibm-skills-network/sn_filterable.git"
23
+ gem "sn_filterable"
24
24
  ```
25
25
 
26
26
  And then execute:
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
  <% end %>
72
72
 
73
- <%= turbo_frame_tag @frame_id, "data-turbo-action": "advance" do %>
73
+ <%= turbo_frame_tag @frame_id, "data-turbo-action": @update_url_on_submit ? "advance" : nil do %>
74
74
  <%= content_tag :input, "", type: "hidden", name: "sort", value: @filtered.queries["sort"] if @filtered.queries["sort"].present? %>
75
75
  <%= content_tag :input, "", type: "hidden", name: "order", value: @filtered.queries["order"] if @filtered.queries["order"].present? %>
76
76
 
@@ -23,13 +23,15 @@ module SnFilterable
23
23
  # @param [String, nil] url Optional, the base URL of where the filters are displayed
24
24
  # @param [String, nil] search_filter_name Optional, enable's and set's the search filter, specified by the filter's parameter name
25
25
  # @param [Boolean] show_sidebar If true, will show the sidebar with the filters.
26
- def initialize(frame_id:, filtered:, filters:, url: nil, search_filter_name: nil, show_sidebar: true)
26
+ # @param [Boolean] update_url_on_submit If true, will update the URL in the user's browser on form submission.
27
+ def initialize(frame_id:, filtered:, filters:, url: nil, search_filter_name: nil, show_sidebar: true, update_url_on_submit: true)
27
28
  @frame_id = frame_id
28
29
  @filtered = filtered
29
30
  @filters = filters
30
31
  @url = url
31
32
  @search_filter_name = search_filter_name
32
33
  @show_sidebar = show_sidebar
34
+ @update_url_on_submit = update_url_on_submit
33
35
  end
34
36
 
35
37
  def search_field
@@ -1,5 +1,4 @@
1
1
  require "rails/engine"
2
- require "view_component/engine"
3
2
 
4
3
  module SnFilterable
5
4
  class Engine < Rails::Engine
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SnFilterable
4
- VERSION = "1.0.1"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sn_filterable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chase McDougall
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-29 00:00:00.000000000 Z
11
+ date: 2023-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroicon