avo 1.15.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce1c9ffa6fde59af4b61d77ff981b439a369323c9d50c7775e8c505e23a48b4f
4
- data.tar.gz: 3f56bed982b298e60c4ea007f9946584810d9d5c1a6ab304a670dfd12f7312c2
3
+ metadata.gz: '058d74773e0381fcecf783cd8bebcb40324f6c2bab9de93c17d0f75b245319ba'
4
+ data.tar.gz: 8d5eba16f6aa0f07cb7215df8ef4b9e2c75bfc87cbdb64f24b5376d5068834a0
5
5
  SHA512:
6
- metadata.gz: 56131c0af786bab270cc590048c25587efbc31d0614e8faafc10ea4fac9c6c5c0e5155b23f978a4bd8da7c4faf3c30befc87585ca8c2b61873d135ef28c6515d
7
- data.tar.gz: 504322330fb7d8b75e860614c00c5c3c8972476f7475b01bd4a0a2b0fa1589682138156666b97ecf950dbfddf33a9f47349cfafa74b9afe72f93141c16e032b8
6
+ metadata.gz: 3619d803b275d81b9d67f6adcf8d8ad4025325f39f64d2c9f421c556879045e188a484d1596e033f28bede52857793ea4004ff4a32f3e3000c78af446acb8b6f
7
+ data.tar.gz: ec928e6cb7d34e001c269cefaf60c8172526249420deb4dac14266108d2d847f36bf2bf3ba4d0a53f6f978063dd76e0695eb568827719ba40d5a79319a2543dd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (1.15.0)
4
+ avo (1.16.0)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -0,0 +1,23 @@
1
+ import BaseFilterController from './filter_controller'
2
+
3
+ export default class extends BaseFilterController {
4
+ static targets = ['text']
5
+
6
+ getFilterValue() {
7
+ return this.textTarget.value
8
+ }
9
+
10
+ tryToSubmit(e) {
11
+ if (e.keyCode === 13) {
12
+ return this.changeFilter()
13
+ }
14
+
15
+ return undefined
16
+ }
17
+
18
+ getFilterClass() {
19
+ const { filterClass } = this.textTarget.dataset
20
+
21
+ return filterClass
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ <%
2
+ begin
3
+ decoded_filters_param = JSON.parse(Base64.decode64(params[:filters]))
4
+ set_value = decoded_filters_param[filter.class.to_s]
5
+ rescue => exception
6
+ set_value = filter.default
7
+ end
8
+ %>
9
+ <div data-controller="text-filter">
10
+ <%= filter_wrapper name: filter.name do %>
11
+ <%= text_field_tag filter.id, set_value,
12
+ class: input_classes('w-full mb-0'),
13
+ id: "avo_filters_#{filter.id.parameterize.underscore}",
14
+ 'data-filter-class': filter.class.to_s,
15
+ 'data-text-filter-target': 'text',
16
+ 'data-action': 'keypress->text-filter#tryToSubmit'
17
+ %>
18
+ <div class="flex justify-end">
19
+ <%= a_button filter.button_label || "Filter by #{filter.name}", class: 'mt-4', color: 'blue', data: { action: "text-filter#changeFilter" }, size: :sm %>
20
+ </div>
21
+ <%= link_to 'url_redirect', request.url, data: { 'text-filter-target': 'urlRedirect', 'turbo-frame': params[:turbo_frame] }, style: 'hidden', class: 'hidden' %>
22
+ <% end %>
23
+ </div>
@@ -0,0 +1,9 @@
1
+ module Avo
2
+ module Filters
3
+ class TextFilter < BaseFilter
4
+ class_attribute :button_label
5
+
6
+ self.template = "avo/base/text_filter"
7
+ end
8
+ end
9
+ end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.15.0"
2
+ VERSION = "1.16.0"
3
3
  end