sn_filterable 0.1.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: 4789bdaca59f8fe8a8aa1adfc7725d69ec7fdded65ee794b13cf155c8ff3ad09
4
- data.tar.gz: a172fe3b19ce43a61ffb511c66a224f0caf1a533b7bd3414cdc752bbe2fd59c0
3
+ metadata.gz: c1b9cd4e29b1ae510d91132581e2bbd2f161ce990fc1e7ec6608d6f7bdb1b41c
4
+ data.tar.gz: 88eca5cf836c294bfb9853dc8bf321d63d7896115e6bdafc35faa8218c66f726
5
5
  SHA512:
6
- metadata.gz: 90af89cc97840f7f5c3cb53632ddbf3e99e197c01fcbf1f8e96a82daa0b7ff7d2a5c7e884aaeedb17f553a8a1e16ef73c298b7b9257ba9591e2a3020337321c0
7
- data.tar.gz: 5e6fa1d8e79e29abd6683e3d8756949feeebc23f1e99f92d57f39b55b3e162ef8d3f4233f2846e8a271e0f62f6fd9e6b515c9c85d7a982c2ed57c3584f52869a
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 = "0.1.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: 0.1.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