refine-rails 2.9.2 → 2.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -50
- data/app/assets/stylesheets/index.css +3 -5
- data/app/models/refine/filters/blueprint_editor.rb +1 -0
- data/app/models/refine/filters/criterion.rb +1 -2
- data/app/models/refine/inline/criteria/input.rb +2 -2
- data/app/models/refine/inline/criterion.rb +1 -2
- data/app/views/refine/blueprints/_criterion.html.erb +24 -19
- data/lib/refine/rails/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: 1abfebfeb61dfe1d7807827fdf1d48c8a9b3f163f2d2aced308378ca577234a7
|
4
|
+
data.tar.gz: 59b3a22f8cad671211eb81e2eb8bcb8a68a909b156d19baea265b225a4bfe804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4828b6f1e0c4146ec8fa9cb33a0974ed73edec68b820e03337a061b72a8d36c89b80dc8b7bb0ec1bcd24ad24261faf9143616341f1055fc0239122e41b01e23
|
7
|
+
data.tar.gz: 22e89bb4e4f76348ff71a646f55f2ef62b9e350435d3d20ba0a849406a555888ad73c2d4ae1fbff8da5b2118660cbfd7134ffc9dcb50e12735426e7ad671ff98
|
data/README.md
CHANGED
@@ -42,41 +42,6 @@ This is a helper method you can inspect in `Hammerstone::FilterApplicationContro
|
|
42
42
|
@pagy, @contacts = pagy(@refine_filter.get_query)
|
43
43
|
```
|
44
44
|
|
45
|
-
# TODO: Everything below this header was not covered in the installation guide. Not sure if it is deprecated
|
46
|
-
|
47
|
-
12. Add the `reveal` controller to your application if using the `filter_builder_dropdown` partial
|
48
|
-
|
49
|
-
`yarn add stimulus-reveal`
|
50
|
-
|
51
|
-
```javascript
|
52
|
-
//index.js
|
53
|
-
import RevealController from 'stimulus-reveal'
|
54
|
-
|
55
|
-
application.register('reveal', RevealController)
|
56
|
-
```
|
57
|
-
|
58
|
-
~13. If the gems tailwind styles are being purged with JIT you can add the gem to `tmp/gems` and add this to your tailwing config.~
|
59
|
-
|
60
|
-
``` tailwind.config.js
|
61
|
-
'./tmp/gems/*/app/views/**/*.html.erb',
|
62
|
-
'./tmp/gems/*/app/helpers/**/*.rb',
|
63
|
-
'./tmp/gems/*/app/assets/stylesheets/**/*.css',
|
64
|
-
'./tmp/gems/*/app/javascript/**/*.js',
|
65
|
-
```
|
66
|
-
|
67
|
-
~Run the following rake task:~
|
68
|
-
```
|
69
|
-
task :add_temp_gems do
|
70
|
-
target = `bundle show refine-rails`.chomp
|
71
|
-
if target.present?
|
72
|
-
puts "Linking refine-rails to '#{target}'."
|
73
|
-
`ln -s #{target} tmp/gems/refine-rails`
|
74
|
-
end
|
75
|
-
end
|
76
|
-
```
|
77
|
-
|
78
|
-
Don't forget to restart the server!
|
79
|
-
|
80
45
|
14. Add external styles - currently themify icons (can be overriden - the trash can icon is located in `_criterion.html.erb`) and `daterangepicker`
|
81
46
|
A quick way to load them is in the `head` section. Also available as an npm package.
|
82
47
|
|
@@ -374,25 +339,11 @@ import { controllerDefinitions as refineControllers } from "@hammerstone/refine-
|
|
374
339
|
application.load(refineControllers)
|
375
340
|
```
|
376
341
|
|
377
|
-
## Readme Installation Goals (what we're working towards - does not work yet)
|
378
|
-
|
379
|
-
1. Run the generator
|
380
|
-
`rails generate refine:install`
|
381
|
-
|
382
|
-
2. Define your filters, subclassing from `Hammerstone::Refine::Filter`
|
383
|
-
|
384
|
-
3. Call `apply_filter` in your controller (or even better, instantiate the filter in your controller `@contacts = ContactFilter.new(blueprint, initial_query` -> might not be possible, how can we do this with validations?)
|
385
|
-
|
386
|
-
4. If you want to customize the views you can override our stylesheet with you own.
|
387
|
-
If you need even more customization you can override the views with `rails generate refine:views` will extract the views
|
388
|
-
|
389
|
-
5. Add custom datepicker if desired and scope stored filters.
|
390
|
-
|
391
342
|
## Releasing New Versions
|
392
343
|
|
393
344
|
- Every release should update the gem and NPM package so version numbers stay in sync.
|
394
345
|
- Make sure to update the CHANGELOG with a note explaining what the new version does
|
395
|
-
- Make sure you have the [bump](https://rubygems.org/gems/bump)
|
346
|
+
- Make sure you have the [bump](https://rubygems.org/gems/bump) gems installed locally
|
396
347
|
|
397
348
|
### Releasing the Ruby Gem
|
398
349
|
|
@@ -822,11 +822,13 @@
|
|
822
822
|
}
|
823
823
|
|
824
824
|
.refine-criterion-refinement-container {
|
825
|
-
width: 100
|
825
|
+
width: 100%;
|
826
|
+
padding-top: 0.75rem
|
826
827
|
}
|
827
828
|
|
828
829
|
@media (min-width: 640px) {
|
829
830
|
.refine-criterion-refinement-container {
|
831
|
+
margin-right: 0.75rem;
|
830
832
|
width: auto;
|
831
833
|
flex-shrink: 0
|
832
834
|
}
|
@@ -1424,10 +1426,6 @@
|
|
1424
1426
|
padding: 0.5rem 0;
|
1425
1427
|
}
|
1426
1428
|
|
1427
|
-
.refine--refinement-input-container {
|
1428
|
-
margin: 0.5rem 0;
|
1429
|
-
}
|
1430
|
-
|
1431
1429
|
/* _date_condition.html.erb */
|
1432
1430
|
|
1433
1431
|
.refine--date-condition-days-text {
|
@@ -23,7 +23,6 @@ class Refine::Filters::Criterion
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def validate!
|
26
|
-
return if (input&.has_key?(:count_refinement) || input&.has_key?(:date_refinement))
|
27
26
|
errors.clear
|
28
27
|
return true if type == "conjunction"
|
29
28
|
begin
|
@@ -31,7 +30,7 @@ class Refine::Filters::Criterion
|
|
31
30
|
condition&.apply(input, filter.table, query_for_validate)
|
32
31
|
rescue Refine::Conditions::Errors::ConditionClauseError => e
|
33
32
|
e.errors.each do |error|
|
34
|
-
errors.add(:base, error.full_message)
|
33
|
+
errors.add(:base, :invalid, message: error.full_message)
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -29,8 +29,8 @@ class Refine::Inline::Criteria::Input
|
|
29
29
|
value: value,
|
30
30
|
value1: value1,
|
31
31
|
value2: value2,
|
32
|
-
|
33
|
-
|
32
|
+
count_refinement: count_refinement_attributes.presence,
|
33
|
+
date_refinement: date_refinement_attributes.presence
|
34
34
|
}.compact
|
35
35
|
end
|
36
36
|
|
@@ -93,8 +93,7 @@ class Refine::Inline::Criterion
|
|
93
93
|
result = attributes.slice(:condition_id, :input_attributes)
|
94
94
|
result[:input] = result.delete(:input_attributes)
|
95
95
|
if input_attrs = result[:input]
|
96
|
-
|
97
|
-
input_attrs[:date_refinement] = input_attrs.delete(:date_refinement_attributes)
|
96
|
+
result[:input] = input_attrs
|
98
97
|
end
|
99
98
|
result
|
100
99
|
end
|
@@ -5,33 +5,38 @@
|
|
5
5
|
refine__update_criterion_id_value: criterion_id,
|
6
6
|
position: criterion.position}) do %>
|
7
7
|
|
8
|
+
<div class="refine-criterion-line">
|
8
9
|
<!-- Select Condition -->
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
<div class="refine-criterion-condition-container">
|
11
|
+
<%= render partial: 'refine/blueprints/condition_select', locals: {
|
12
|
+
selected_condition_id: criterion.condition_id } %>
|
13
|
+
</div>
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
<!-- Select Clause -->
|
16
|
+
<div class="refine-criterion-clause-container">
|
17
|
+
<%= render partial: 'refine/blueprints/clause_select', locals: {
|
18
|
+
meta: criterion.meta, selected_clause: criterion.input[:clause]} %>
|
19
|
+
</div>
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
<!-- Render correct type of condition -->
|
22
|
+
<%= render partial: "refine/blueprints/clauses/#{criterion.component}", locals: {
|
23
|
+
criterion: criterion,
|
24
|
+
condition: criterion.condition, input: criterion.input, criterion_id: criterion_id, meta: criterion.meta, meta_clause: criterion.selected_clause_meta, input_id: nil } %>
|
25
|
+
</div>
|
24
26
|
|
25
27
|
<!-- Refinements -->
|
26
28
|
<% criterion.refinements.each do |refinement|%>
|
27
29
|
|
28
|
-
<div class="refine-criterion-refinement-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
<div class="refine-criterion-refinement-line">
|
31
|
+
<i class="fa-thin fa-l"></i>
|
32
|
+
<div class="refine-criterion-refinement-container">
|
33
|
+
<%= render partial: 'refine/blueprints/clause_select', locals: {
|
34
|
+
meta: refinement[:meta], input_id: "input, #{refinement[:id]}", selected_clause: criterion.input.dig(refinement[:id].to_sym, :clause) || {} } %>
|
35
|
+
</div>
|
32
36
|
|
33
|
-
|
34
|
-
|
37
|
+
<%= render partial: "refine/blueprints/clauses/#{refinement[:component].underscore}", locals: {
|
38
|
+
condition: refinement, input: criterion.input[refinement[:id].to_sym] || {}, criterion_id: criterion_id, meta: refinement[:meta], input_id: "input, #{refinement[:id]}", meta_clause: criterion.meta_for_refinement_clause(refinement), criterion: criterion} %>
|
39
|
+
</div>
|
35
40
|
<% end %>
|
36
41
|
<!-- End Refinements -->
|
37
42
|
|
data/lib/refine/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colleen Schnettler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -178,7 +178,7 @@ files:
|
|
178
178
|
- lib/tasks/refine/rails_tasks.rake
|
179
179
|
homepage: https://rubygems.org/gems/refine-rails
|
180
180
|
licenses:
|
181
|
-
-
|
181
|
+
- MIT
|
182
182
|
metadata:
|
183
183
|
homepage_uri: https://rubygems.org/gems/refine-rails
|
184
184
|
source_code_uri: https://github.com/clickfunnels2/refine-rails
|