sn_filterable 1.1.0 → 1.1.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.
- checksums.yaml +4 -4
- data/README.md +28 -0
- data/lib/sn_filterable/filterable.rb +1 -2
- data/lib/sn_filterable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d4ca6d509892a2c953861a953127b8488669f6b8b5a4ffad77e18c70797961c
|
|
4
|
+
data.tar.gz: f395268a282728c7b7632a9638cc7ee325eca5de6e3c9ff46f346f897794cc85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4dd00f9138cc3b36004a984e9285d339b2eab51e939ba45a8f0049e9a051b3b4d6970eee191a0b7954d1511f5f215b00591efc378da22920f18018c8c6ce1748
|
|
7
|
+
data.tar.gz: 23901c70d787118584e856012389a20440dc274768479057102e35bbcafa16ce6e1d035de49dac2390290f7af8183974ed5fe9d201cf38eb66cec572fb162c70
|
data/README.md
CHANGED
|
@@ -53,6 +53,13 @@ en:
|
|
|
53
53
|
<%= SnFilterable.load_js %>
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
If your application does not allow for use of `.js.erb` files the JavaScript can be loaded by adding the following to your layout:
|
|
57
|
+
```javascript
|
|
58
|
+
<%= javascript_tag nonce: true do %>
|
|
59
|
+
<%= SnFilterable.load_js.html_safe %>
|
|
60
|
+
<% end %>
|
|
61
|
+
```
|
|
62
|
+
|
|
56
63
|
3. Configure your app's Tailwind to scan the gem
|
|
57
64
|
```javascript
|
|
58
65
|
// tailwind.config.js
|
|
@@ -190,8 +197,29 @@ Now the test suite can be run from the project root using
|
|
|
190
197
|
bundle exec rspec
|
|
191
198
|
```
|
|
192
199
|
|
|
200
|
+
### Using a Development Version
|
|
201
|
+
|
|
202
|
+
Your changes can be tested manually by making one of the following additions to an App's Gemfile:
|
|
203
|
+
|
|
204
|
+
For using a local version:
|
|
205
|
+
```ruby
|
|
206
|
+
gem "sn_filterable", path: "path/to/gem/sn_filterable"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
For using a GitHub branch:
|
|
210
|
+
```ruby
|
|
211
|
+
gem "sn_filterable", git: "https://github.com/ibm-skills-network/sn_filterable.git", branch: "defaults_to_main"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
|
|
193
215
|
## Contributing
|
|
194
216
|
|
|
217
|
+
Once you have made your updates to the codebase do the following to ensure a smooth merge:
|
|
218
|
+
|
|
219
|
+
1. Update `lib/sn_filterable/version.rb` to follow [Semantic Versioning](https://semver.org)
|
|
220
|
+
|
|
221
|
+
2. Run `bundle` to update the `Gemfile.lock` with your new version
|
|
222
|
+
|
|
195
223
|
Bug reports and pull requests are welcome on [GitHub](https://github.com/ibm-skills-network/sn_filterable).
|
|
196
224
|
|
|
197
225
|
## License
|
|
@@ -33,9 +33,8 @@ module SnFilterable
|
|
|
33
33
|
filter_params = filter_params(params)
|
|
34
34
|
sort_params = sort_params(params)
|
|
35
35
|
other_params = other_params(params, items)
|
|
36
|
-
|
|
37
|
-
items = perform_filter(items, filter_params)
|
|
38
36
|
items, sort_name, reverse_order = perform_sort(items, sort_params, default_sort)
|
|
37
|
+
items = perform_filter(items, filter_params)
|
|
39
38
|
items = items.page(other_params[:page]).per(other_params[:per]) if pagination_enabled
|
|
40
39
|
|
|
41
40
|
Filtered.new(self, items, generate_url_queries(filter_params, sort_params, other_params), sort_name, reverse_order)
|
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.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chase McDougall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: heroicon
|
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
287
287
|
- !ruby/object:Gem::Version
|
|
288
288
|
version: '0'
|
|
289
289
|
requirements: []
|
|
290
|
-
rubygems_version: 3.4.
|
|
290
|
+
rubygems_version: 3.4.10
|
|
291
291
|
signing_key:
|
|
292
292
|
specification_version: 4
|
|
293
293
|
summary: Skills Network - Item filtering component
|