avo 3.1.3 → 3.1.4

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.

Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/components/avo/button_component.rb +1 -1
  4. data/app/components/avo/fields/edit_component.rb +2 -0
  5. data/app/components/avo/fields/has_many_field/show_component.html.erb +2 -2
  6. data/app/components/avo/fields/has_many_field/show_component.rb +7 -0
  7. data/app/components/avo/fields/index_component.rb +3 -1
  8. data/app/components/avo/fields/show_component.rb +3 -1
  9. data/app/components/avo/items/switcher_component.rb +1 -1
  10. data/app/components/avo/tab_group_component.html.erb +10 -43
  11. data/app/components/avo/tab_group_component.rb +20 -2
  12. data/app/components/avo/tab_switcher_component.html.erb +14 -12
  13. data/app/components/avo/tab_switcher_component.rb +12 -10
  14. data/app/controllers/avo/base_controller.rb +3 -3
  15. data/app/javascript/avo.base.js +4 -0
  16. data/app/javascript/js/controllers/filter_controller.js +22 -11
  17. data/app/javascript/js/controllers/tabs_controller.js +42 -46
  18. data/app/javascript/js/local-storage-service.js +19 -0
  19. data/app/views/avo/home/_actions.html.erb +1 -1
  20. data/app/views/avo/home/_dashboards.html.erb +1 -1
  21. data/app/views/avo/home/_filters.html.erb +1 -1
  22. data/app/views/avo/home/_resources.html.erb +1 -1
  23. data/lib/avo/base_resource.rb +1 -1
  24. data/lib/avo/concerns/has_items.rb +17 -10
  25. data/lib/avo/filters/base_filter.rb +3 -3
  26. data/lib/avo/resources/items/holder.rb +2 -2
  27. data/lib/avo/resources/items/tab.rb +5 -0
  28. data/lib/avo/resources/items/tab_group.rb +17 -3
  29. data/lib/avo/resources/resource_manager.rb +1 -1
  30. data/lib/avo/test_helpers.rb +2 -2
  31. data/lib/avo/version.rb +1 -1
  32. data/public/avo-assets/avo.base.css +8 -0
  33. data/public/avo-assets/avo.base.js +124 -124
  34. data/public/avo-assets/avo.base.js.map +3 -3
  35. metadata +2 -1
@@ -8,17 +8,31 @@ class Avo::Resources::Items::TabGroup
8
8
 
9
9
  attr_accessor :index
10
10
  attr_accessor :style
11
+ attr_accessor :name
11
12
 
12
- def initialize(index: 0, view: nil, style: nil, **args)
13
+ def initialize(index: 0, view: nil, style: nil, id: nil, name: nil, **args)
13
14
  @index = index
14
15
  @items_holder = Avo::Resources::Items::Holder.new
15
16
  @view = Avo::ViewInquirer.new view
16
17
  @style = style
18
+ @id = id
19
+ @name = name
17
20
  @args = args
18
21
 
19
22
  post_initialize if respond_to?(:post_initialize)
20
23
  end
21
24
 
25
+ # The user might assign an id to a group.
26
+ # If not, we'll use the name.
27
+ # If not, we'll use the index
28
+ def id
29
+ return @id if @id.present?
30
+ return @name.parameterize if @name.present?
31
+
32
+ index
33
+ end
34
+ alias_method :to_param, :id
35
+
22
36
  def turbo_frame_id
23
37
  "#{Avo::Resources::Items::TabGroup.to_s.parameterize} #{index}".parameterize
24
38
  end
@@ -48,8 +62,8 @@ class Avo::Resources::Items::TabGroup
48
62
  @items_holder.tabs tab
49
63
  end
50
64
 
51
- def initialize(parent: ,style: nil)
52
- @group = Avo::Resources::Items::TabGroup.new(style: style)
65
+ def initialize(name:, id:, parent:, style: nil)
66
+ @group = Avo::Resources::Items::TabGroup.new(name: name, id: id, style: style)
53
67
  @items_holder = Avo::Resources::Items::Holder.new(parent: parent, from: self)
54
68
  end
55
69
 
@@ -69,7 +69,7 @@ module Avo
69
69
  possible_model = possible_model.gsub "Resource", ""
70
70
 
71
71
  Avo.error_manager.add({
72
- url: "https://docs.avohq.io/2.0/resources.html#custom-model-class",
72
+ url: "https://docs.avohq.io/3.0/resources.html#self_model_class",
73
73
  target: "_blank",
74
74
  message: "#{resource} does not have a valid model assigned. It failed to find the #{possible_model} model. \n\r Please create that model or assign one using self.model_class = YOUR_MODEL"
75
75
  })
@@ -149,12 +149,12 @@ module Avo
149
149
  def click_tab(tab_name = "", within_target: nil, **args)
150
150
  if within_target.present?
151
151
  within within_target do
152
- within find('[data-controller="tabs"] turbo-frame:not(.hidden) [data-target="tab-switcher"]') do
152
+ within find('[data-controller="tabs"] [data-tabs-target="tabSwitcher"]') do
153
153
  find_link(tab_name).click
154
154
  end
155
155
  end
156
156
  else
157
- within find('[data-controller="tabs"] turbo-frame:not(.hidden) [data-target="tab-switcher"]') do
157
+ within find('[data-controller="tabs"] [data-tabs-target="tabSwitcher"]') do
158
158
  find_link(tab_name).click
159
159
  end
160
160
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.1.3" unless const_defined?(:VERSION)
2
+ VERSION = "3.1.4" unless const_defined?(:VERSION)
3
3
  end
@@ -8264,10 +8264,18 @@ tag.tagify__tag{
8264
8264
  text-align:justify
8265
8265
  }
8266
8266
 
8267
+ .font-mono{
8268
+ font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
8269
+ }
8270
+
8267
8271
  .font-sans{
8268
8272
  font-family:"Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
8269
8273
  }
8270
8274
 
8275
+ .font-serif{
8276
+ font-family:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif
8277
+ }
8278
+
8271
8279
  .text-2xl{
8272
8280
  font-size:1.5rem;
8273
8281
  line-height:2rem