avo 1.19.0 → 1.19.1.pre.1

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: fe6f8fd6152562419ea4552e39ad441375f04932f9c3e15d4a46562d815a85a3
4
- data.tar.gz: 87a5b8936878970adb4be91743166f4fb33105d13110e517848dc865eb606157
3
+ metadata.gz: e19673d01d04cba52b2ca527f91296c4b4398a0c7c3dcc7a3ebe1fbd77305e4c
4
+ data.tar.gz: ee63a98ed8f24bdd3baa5f7e43e0822e9e1b339f2f4779917965274a91cacf94
5
5
  SHA512:
6
- metadata.gz: 65b14a78a7f769504202072693f7b5f648a798989d7e74e7aad0d4909d610cd2ffc4092a39fbe69d8cabdc7ffb69b0d350fac3cb93951f6dc27db9ffd5678ca0
7
- data.tar.gz: ca87e17c0fcb5aeee675aee252fa1d872aedab05109981410198376c77b8d79e8159d566bb2db9f0fec1952c1c098113a45fa1e8cbb5fc321c4864f0e80ba57a
6
+ metadata.gz: b2ea94f80529026b416ee860806a893585f8697453f2f144b22feb1f1b3eab7acdded6ea311949079fd5dc11c2bc99165c23fc4b73bf4c231bf56207ae3ed947
7
+ data.tar.gz: 438f26330cf7ded3ec531fac77056d2946c51ec20c3ddadb94a3ff0e8299292bd305eb285e68a403050f42eea14c71213ec15f30799999cbaf45fa742158f94b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (1.19.0)
4
+ avo (1.19.1.pre.1)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -227,8 +227,11 @@ GEM
227
227
  nokogiri (1.13.1)
228
228
  mini_portile2 (~> 2.7.0)
229
229
  racc (~> 1.4)
230
+ nokogiri (1.13.1-x86_64-linux)
231
+ racc (~> 1.4)
230
232
  orm_adapter (0.5.0)
231
- pagy (5.7.3)
233
+ pagy (5.9.3)
234
+ activesupport
232
235
  parallel (1.21.0)
233
236
  parser (3.1.0.0)
234
237
  ast (~> 2.4.1)
@@ -5,8 +5,8 @@ module Avo
5
5
  before_action :set_resource_name
6
6
  before_action :set_resource
7
7
  before_action :hydrate_resource
8
- before_action :authorize_action
9
8
  before_action :set_model, only: [:show, :edit, :destroy, :update]
9
+ before_action :authorize_action
10
10
  before_action :reset_pagination_if_filters_changed, only: :index
11
11
  before_action :cache_applied_filters, only: :index
12
12
 
@@ -127,7 +127,7 @@ module Avo
127
127
  resource_path(model: @model, resource: @resource)
128
128
  end
129
129
 
130
- format.html { redirect_to redirect_path, notice: "#{@model.class.name} was successfully created." }
130
+ format.html { redirect_to redirect_path, notice: "#{@model.class.name} #{t("avo.was_successfully_created")}." }
131
131
  format.json { render :show, status: :created, location: @model }
132
132
  else
133
133
  flash[:error] = t "avo.you_missed_something_check_form"
@@ -144,7 +144,7 @@ module Avo
144
144
 
145
145
  respond_to do |format|
146
146
  if saved
147
- format.html { redirect_to params[:referrer] || resource_path(model: @model, resource: @resource), notice: "#{@model.class.name} was successfully updated." }
147
+ format.html { redirect_to params[:referrer] || resource_path(model: @model, resource: @resource), notice: "#{@model.class.name} #{t("avo.was_successfully_updated")}." }
148
148
  format.json { render :show, status: :ok, location: @model }
149
149
  else
150
150
  flash[:error] = t "avo.you_missed_something_check_form"
@@ -19,7 +19,6 @@ module Avo
19
19
  attr_reader :nullable
20
20
  attr_reader :null_values
21
21
  attr_reader :format_using
22
- attr_reader :placeholder
23
22
  attr_reader :help
24
23
  attr_reader :default
25
24
  attr_reader :visible
@@ -57,7 +56,7 @@ module Avo
57
56
  @nullable = args[:nullable] || false
58
57
  @null_values = args[:null_values] || [nil, ""]
59
58
  @format_using = args[:format_using] || nil
60
- @placeholder = args[:placeholder] || id.to_s.humanize(keep_id_suffix: true)
59
+ @placeholder = args[:placeholder]
61
60
  @help = args[:help] || nil
62
61
  @default = args[:default] || nil
63
62
  @visible = args[:visible] || true
@@ -103,6 +102,12 @@ module Avo
103
102
  @id.to_s.humanize(keep_id_suffix: true)
104
103
  end
105
104
 
105
+ def placeholder
106
+ return @placeholder if @placeholder.present?
107
+
108
+ name
109
+ end
110
+
106
111
  def visible?
107
112
  if visible.present? && visible.respond_to?(:call)
108
113
  visible.call resource: @resource
@@ -15,10 +15,10 @@ module Avo
15
15
 
16
16
  hide_on :index
17
17
 
18
- @key_label = args[:key_label].present? ? args[:key_label].to_s : "Key"
19
- @value_label = args[:value_label].present? ? args[:value_label].to_s : "Value"
20
- @action_text = args[:action_text].present? ? args[:action_text].to_s : "Add row"
21
- @delete_text = args[:delete_text].present? ? args[:delete_text].to_s : "Delete row"
18
+ @key_label = args[:key_label].present? ? args[:key_label].to_s : I18n.translate('avo.key_value_field.key')
19
+ @value_label = args[:value_label].present? ? args[:value_label].to_s : I18n.translate('avo.key_value_field.value')
20
+ @action_text = args[:action_text].present? ? args[:action_text].to_s : I18n.translate('avo.key_value_field.add_row')
21
+ @delete_text = args[:delete_text].present? ? args[:delete_text].to_s : I18n.translate('avo.key_value_field.delete_row')
22
22
 
23
23
  @disable_editing_keys = args[:disable_editing_keys].present? ? args[:disable_editing_keys] : false
24
24
  # disabling editing keys also disables adding rows (doesn't take into account the value of disable_adding_rows)
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.19.0"
2
+ VERSION = "1.19.1.pre.1"
3
3
  end
@@ -8,7 +8,7 @@ en:
8
8
  run: 'Run'
9
9
  cancel: 'Cancel'
10
10
  action_ran_successfully: 'Action ran successfully!'
11
- resource_details: "%{item} details: %{title}"
11
+ resource_details: '%{item} details: %{title}'
12
12
  update_item: 'update %{item}: %{title}'
13
13
  unauthorized: 'Unauthorized'
14
14
  attachment_class_attached: '%{attachment_class} attached.'
@@ -16,8 +16,8 @@ en:
16
16
  resource_updated: 'Resource updated'
17
17
  resource_created: 'Resource created'
18
18
  resource_destroyed: 'Resource destroyed'
19
- switch_to_view: "Switch to %{view_type} view"
20
- click_to_reveal_filters: "Click to reveal filters"
19
+ switch_to_view: 'Switch to %{view_type} view'
20
+ click_to_reveal_filters: 'Click to reveal filters'
21
21
  attachment_destroyed: 'Attachment destroyed'
22
22
  failed_to_find_attachment: 'Failed to find attachment'
23
23
  you_missed_something_check_form: 'You might have missed something. Please check the form.'
@@ -86,3 +86,10 @@ en:
86
86
  sign_out: 'Sign out'
87
87
  failed: 'Failed'
88
88
  failed_to_load: 'Failed to load'
89
+ key_value_field:
90
+ key: 'Key'
91
+ value: 'Value'
92
+ add_row: 'Add row'
93
+ delete_row: 'Delete row'
94
+ was_successfully_created: 'was successfully created'
95
+ was_successfully_updated: 'was successfully updated'
@@ -71,3 +71,10 @@ ro:
71
71
  placeholder: 'Cauta'
72
72
  cancel_button: 'Anulare'
73
73
  sign_out: 'Delogare'
74
+ key_value_field:
75
+ key: 'Cheie'
76
+ value: 'Valoare'
77
+ add_row: 'Adauga rand'
78
+ delete_row: 'Sterge rand'
79
+ was_successfully_created: 'a fost creat'
80
+ was_successfully_updated: 'a fost actualizat'