avo 2.13.1 → 2.13.2.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.

Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -1
  3. data/app/assets/stylesheets/avo.css +1 -1
  4. data/app/assets/stylesheets/css/fields/progress.css +3 -3
  5. data/app/assets/stylesheets/css/pagination.css +0 -4
  6. data/app/assets/stylesheets/css/search.css +1 -1
  7. data/app/assets/stylesheets/css/sidebar.css +1 -1
  8. data/app/assets/stylesheets/css/tags.css +7 -0
  9. data/app/assets/svgs/failed_to_load.svg +4 -5
  10. data/app/assets/svgs/grid-empty-state.svg +10 -11
  11. data/app/assets/svgs/table-empty-state.svg +11 -12
  12. data/app/components/avo/actions_component.html.erb +2 -2
  13. data/app/components/avo/actions_component.rb +1 -1
  14. data/app/components/avo/button_component.rb +3 -3
  15. data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
  16. data/app/components/avo/fields/progress_bar_field/index_component.html.erb +1 -1
  17. data/app/components/avo/fields/progress_bar_field/show_component.html.erb +1 -1
  18. data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
  19. data/app/components/avo/fields/tags_field/show_component.rb +2 -0
  20. data/app/components/avo/profile_item_component.html.erb +1 -1
  21. data/app/components/avo/tab_group_component.html.erb +1 -1
  22. data/app/components/avo/tab_switcher_component.rb +2 -2
  23. data/app/components/avo/views/resource_edit_component.rb +1 -1
  24. data/app/components/avo/views/resource_index_component.html.erb +2 -2
  25. data/app/components/avo/views/resource_index_component.rb +0 -17
  26. data/app/components/avo/views/resource_show_component.html.erb +1 -2
  27. data/app/controllers/avo/base_controller.rb +33 -87
  28. data/app/controllers/avo/search_controller.rb +20 -57
  29. data/app/helpers/avo/resources_helper.rb +2 -2
  30. data/app/javascript/avo.js +0 -1
  31. data/app/javascript/js/controllers/fields/trix_field_controller.js +4 -3
  32. data/app/javascript/js/controllers/item_selector_controller.js +1 -1
  33. data/app/javascript/js/controllers/menu_controller.js +2 -2
  34. data/app/javascript/js/controllers/search_controller.js +15 -42
  35. data/app/views/avo/associations/new.html.erb +2 -3
  36. data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
  37. data/app/views/avo/base/_text_filter.html.erb +1 -1
  38. data/app/views/avo/partials/_branding.html.erb +5 -0
  39. data/app/views/avo/partials/_header.html.erb +1 -1
  40. data/app/views/avo/partials/_logo.html.erb +2 -2
  41. data/app/views/avo/partials/_resource_search.html.erb +0 -6
  42. data/app/views/avo/private/_links_and_buttons.html.erb +1 -1
  43. data/app/views/avo/private/design.html.erb +3 -3
  44. data/app/views/layouts/avo/application.html.erb +1 -0
  45. data/lib/avo/concerns/has_editable_controls.rb +1 -1
  46. data/lib/avo/configuration/branding.rb +57 -0
  47. data/lib/avo/configuration.rb +5 -0
  48. data/lib/avo/fields/base_field.rb +1 -1
  49. data/lib/avo/fields/has_base_field.rb +0 -2
  50. data/lib/avo/licensing/pro_license.rb +1 -0
  51. data/lib/avo/version.rb +1 -1
  52. data/lib/generators/avo/templates/initializer/avo.tt +13 -0
  53. data/lib/generators/avo/templates/resource/resource.tt +1 -1
  54. data/public/avo-assets/avo.css +286 -248
  55. data/public/avo-assets/avo.js +47 -47
  56. data/public/avo-assets/avo.js.map +2 -2
  57. metadata +6 -13
  58. data/app/components/avo/button_component.html.erb +0 -1
  59. data/app/helpers/avo/actions_helper.rb +0 -4
  60. data/app/helpers/avo/attachments_helper.rb +0 -4
  61. data/app/views/kaminari/_first_page.html.erb +0 -3
  62. data/app/views/kaminari/_last_page.html.erb +0 -3
  63. data/app/views/kaminari/_next_page.html.erb +0 -9
  64. data/app/views/kaminari/_page.html.erb +0 -12
  65. data/app/views/kaminari/_prev_page.html.erb +0 -9
  66. data/lib/avo/hosts/search_scope_host.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b921afbe3cb5f55ee67ac20bb21d65dffa91b2b3608dddf1c21b6f9fa5a686e
4
- data.tar.gz: 5a7d24f4c324b1109717321b3200c41f6b61470fabc915fe41c662fb3858a108
3
+ metadata.gz: fc519d3091408bc2355cb12d6b86671f8b77270e479de775d3290a18c7933a5f
4
+ data.tar.gz: 244a5fcc3837878903f797177cf791a7981f5d1ccd07b60245a9226fde24b978
5
5
  SHA512:
6
- metadata.gz: 0e740c3c1eb71a50fe32bf7856b993e8921c6891e16a09341d636fbcaa32faf8564fd417efc8c914573d959364d573851faaf1b943a5314f7aab78f8c752758f
7
- data.tar.gz: 7d66c540afb965ac2a07e0a2d88fe811cd6c035cee7a0ce88e8cc926c53f2dd186cabf69fb69946becec707711edb49033cf2c4d6952cdfc13894302554fc1ac
6
+ metadata.gz: 13d4188612ef439fd452a4e13fdd5d294e44e4024a3c0c23812cf0580bcd76af03a9a06225ac0ea32f1ee4ff938b1b4ce21481b09716f44c4299151472c81e97
7
+ data.tar.gz: b66aac0a5d64487839e61e5d30409063a877dd65d9d693fc140b17c5222c4605ef5ebfd51b01d55fd7638d2011fcb04e3fa0dd005ba58b89201a683e692fea48
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.13.1)
4
+ avo (2.13.2.pre.1)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -252,6 +252,8 @@ GEM
252
252
  nokogiri (1.13.7)
253
253
  mini_portile2 (~> 2.8.0)
254
254
  racc (~> 1.4)
255
+ nokogiri (1.13.7-x86_64-linux)
256
+ racc (~> 1.4)
255
257
  orm_adapter (0.5.0)
256
258
  pagy (5.10.1)
257
259
  activesupport
@@ -73,7 +73,7 @@ body {
73
73
 
74
74
 
75
75
  .turbo-progress-bar {
76
- @apply bg-blue-400;
76
+ @apply bg-primary-400;
77
77
  }
78
78
 
79
79
  body.os-mac .mac\:hidden {
@@ -1,13 +1,13 @@
1
1
  progress {
2
- @apply h-2 bg-white border border-gray-400 rounded shadow-inner;
2
+ @apply h-2 bg-white border border-slate-400 rounded shadow-inner;
3
3
  }
4
4
  progress[value]::-webkit-progress-bar {
5
5
  @apply bg-white border border-gray-500 rounded shadow-inner;
6
6
  }
7
7
  progress[value]::-webkit-progress-value{
8
- @apply bg-green-600 rounded;
8
+ @apply bg-primary-500 rounded;
9
9
 
10
10
  }
11
11
  progress[value]::-moz-progress-bar {
12
- @apply bg-green-600 rounded appearance-none;
12
+ @apply bg-primary-500 rounded appearance-none;
13
13
  }
@@ -23,10 +23,6 @@
23
23
  .pagy-combo-nav-js .pagy-combo-input a {
24
24
  @apply rounded px-3 py-1 text-sm text-gray-500 font-semibold bg-white shadow-md border border-gray-300;
25
25
 
26
- &:focus{
27
- @apply border-blue-300;
28
- }
29
-
30
26
  &:hover{
31
27
  @apply bg-gray-150;
32
28
  }
@@ -78,7 +78,7 @@ button.aa-DetachedCancelButton {
78
78
  }
79
79
 
80
80
  &[aria-selected=true]{
81
- @apply bg-blue-500 text-white;
81
+ @apply bg-primary-500 text-white;
82
82
 
83
83
  .aa-ItemDescription {
84
84
  @apply text-white;
@@ -1,6 +1,6 @@
1
1
  .application-sidebar .active:hover,
2
2
  .application-sidebar .active {
3
- @apply bg-blue-100 text-blue-500;
3
+ @apply bg-primary-100 text-primary-500;
4
4
  }
5
5
 
6
6
  .content-area {
@@ -1,5 +1,12 @@
1
1
  tags.tagify {
2
2
  --tag-inset-shadow-size: 3em;
3
+ --tags-border-color: rgb(var(--color-primary-500));
4
+ --tags-hover-border-color: rgb(var(--color-primary-500));
5
+ --tags-hover-border-color: rgb(var(--color-primary-500));
6
+ }
7
+
8
+ .tagify__dropdown {
9
+ --tagify-dd-color-primary: rgb(var(--color-primary-500));
3
10
  }
4
11
 
5
12
  tags.tagify {
@@ -1,13 +1,12 @@
1
1
  <svg width="275" height="275" viewBox="0 0 275 275" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M137.714 274.227C213.377 274.227 274.714 212.89 274.714 137.227C274.714 61.5636 213.377 0.226593 137.714 0.226593C62.0512 0.226593 0.714233 61.5636 0.714233 137.227C0.714233 212.89 62.0512 274.227 137.714 274.227Z" fill="url(#paint0_linear_663_759)"/>
2
+ <path d="M137.714 274.227C213.377 274.227 274.714 212.89 274.714 137.227C274.714 61.5636 213.377 0.226593 137.714 0.226593C62.0512 0.226593 0.714233 61.5636 0.714233 137.227C0.714233 212.89 62.0512 274.227 137.714 274.227Z" fill="rgb(var(--color-primary-100))"/>
3
3
  <rect x="55.5142" y="67.8133" width="164.4" height="32.88" fill="white"/>
4
4
  <path d="M219.914 274.227H55.5142V97.0399C63.2629 97.0312 70.6918 93.9492 76.171 88.4701C81.6502 82.9909 84.7322 75.562 84.7409 67.8133H190.688C190.679 71.6518 191.432 75.4538 192.903 78.9994C194.374 82.5449 196.533 85.7636 199.256 88.4692C201.962 91.1929 205.181 93.353 208.727 94.8242C212.273 96.2953 216.075 97.0484 219.914 97.0399V274.227Z" fill="white"/>
5
- <path d="M137.714 186.547C161.926 186.547 181.554 166.919 181.554 142.707C181.554 118.494 161.926 98.8666 137.714 98.8666C113.502 98.8666 93.8743 118.494 93.8743 142.707C93.8743 166.919 113.502 186.547 137.714 186.547Z" fill="#4285F4"/>
5
+ <path d="M137.714 186.547C161.926 186.547 181.554 166.919 181.554 142.707C181.554 118.494 161.926 98.8666 137.714 98.8666C113.502 98.8666 93.8743 118.494 93.8743 142.707C93.8743 166.919 113.502 186.547 137.714 186.547Z" fill="rgb(var(--color-primary-500))"/>
6
6
  <path d="M153.214 163.373L137.714 147.874L122.214 163.373L117.048 158.207L132.548 142.707L117.048 127.207L122.214 122.041L137.714 137.54L153.214 122.041L158.381 127.207L142.881 142.707L158.381 158.207L153.214 163.373Z" fill="white"/>
7
- <path d="M161.461 197.507H113.968C110.941 197.507 108.488 199.96 108.488 202.987C108.488 206.013 110.941 208.467 113.968 208.467H161.461C164.487 208.467 166.941 206.013 166.941 202.987C166.941 199.96 164.487 197.507 161.461 197.507Z" fill="#DFEAFB"/>
8
- <path d="M177.901 219.427H97.5275C94.501 219.427 92.0475 221.88 92.0475 224.907C92.0475 227.933 94.501 230.387 97.5275 230.387H177.901C180.927 230.387 183.381 227.933 183.381 224.907C183.381 221.88 180.927 219.427 177.901 219.427Z" fill="#DFEAFB"/>
7
+ <path d="M161.461 197.507H113.968C110.941 197.507 108.488 199.96 108.488 202.987C108.488 206.013 110.941 208.467 113.968 208.467H161.461C164.487 208.467 166.941 206.013 166.941 202.987C166.941 199.96 164.487 197.507 161.461 197.507Z" fill="rgb(var(--color-primary-100))"/>
8
+ <path d="M177.901 219.427H97.5275C94.501 219.427 92.0475 221.88 92.0475 224.907C92.0475 227.933 94.501 230.387 97.5275 230.387H177.901C180.927 230.387 183.381 227.933 183.381 224.907C183.381 221.88 180.927 219.427 177.901 219.427Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
9
9
  <defs>
10
- <linearGradient id="paint0_linear_663_759" x1="137.714" y1="0.226593" x2="137.714" y2="274.227" gradientUnits="userSpaceOnUse">
11
10
  <stop stop-color="#E3ECFA"/>
12
11
  <stop offset="1" stop-color="#DAE7FF"/>
13
12
  </linearGradient>
@@ -1,21 +1,20 @@
1
1
  <svg width="248" height="287" viewBox="0 0 248 287" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="grid-empty-state-svg">
2
- <path d="M124 270.227C192.483 270.227 248 214.71 248 146.227C248 77.7433 192.483 22.2266 124 22.2266C55.5167 22.2266 0 77.7433 0 146.227C0 214.71 55.5167 270.227 124 270.227Z" fill="#DDF0FE"/>
3
- <g filter="url(#filter0_d_577_1090)">
2
+ <path d="M124 270.227C192.483 270.227 248 214.71 248 146.227C248 77.7433 192.483 22.2266 124 22.2266C55.5167 22.2266 0 77.7433 0 146.227C0 214.71 55.5167 270.227 124 270.227Z" fill="rgb(var(--color-primary-100))"/>
3
+ <g filter="rgb(var(--color-primary-100))">
4
4
  <path d="M195.093 93.3198H52.9068C48.3412 93.3198 44.6401 97.0209 44.6401 101.586V275.186C44.6401 279.752 48.3412 283.453 52.9068 283.453H195.093C199.659 283.453 203.36 279.752 203.36 275.186V101.586C203.36 97.0209 199.659 93.3198 195.093 93.3198Z" fill="white"/>
5
5
  </g>
6
- <path d="M107.467 118.12H64.48C61.7407 118.12 59.52 120.34 59.52 123.08C59.52 125.819 61.7407 128.04 64.48 128.04H107.467C110.206 128.04 112.427 125.819 112.427 123.08C112.427 120.34 110.206 118.12 107.467 118.12Z" fill="#A2D7FC"/>
7
- <path d="M137.227 139.613H64.48C61.7407 139.613 59.52 141.834 59.52 144.573C59.52 147.312 61.7407 149.533 64.48 149.533H137.227C139.966 149.533 142.187 147.312 142.187 144.573C142.187 141.834 139.966 139.613 137.227 139.613Z" fill="#DDF0FE"/>
8
- <path d="M107.467 162.76H64.48C61.7407 162.76 59.52 164.981 59.52 167.72C59.52 170.459 61.7407 172.68 64.48 172.68H107.467C110.206 172.68 112.427 170.459 112.427 167.72C112.427 164.981 110.206 162.76 107.467 162.76Z" fill="#A2D7FC"/>
9
- <path d="M137.227 184.253H64.48C61.7407 184.253 59.52 186.474 59.52 189.213C59.52 191.953 61.7407 194.173 64.48 194.173H137.227C139.966 194.173 142.187 191.953 142.187 189.213C142.187 186.474 139.966 184.253 137.227 184.253Z" fill="#DDF0FE"/>
10
- <path d="M107.467 207.4H64.48C61.7407 207.4 59.52 209.621 59.52 212.36C59.52 215.099 61.7407 217.32 64.48 217.32H107.467C110.206 217.32 112.427 215.099 112.427 212.36C112.427 209.621 110.206 207.4 107.467 207.4Z" fill="#A2D7FC"/>
11
- <path d="M137.227 228.893H64.48C61.7407 228.893 59.52 231.114 59.52 233.853C59.52 236.592 61.7407 238.813 64.48 238.813H137.227C139.966 238.813 142.187 236.592 142.187 233.853C142.187 231.114 139.966 228.893 137.227 228.893Z" fill="#DDF0FE"/>
6
+ <path d="M107.467 118.12H64.48C61.7407 118.12 59.52 120.34 59.52 123.08C59.52 125.819 61.7407 128.04 64.48 128.04H107.467C110.206 128.04 112.427 125.819 112.427 123.08C112.427 120.34 110.206 118.12 107.467 118.12Z" fill="rgb(var(--color-primary-100))"/>
7
+ <path d="M137.227 139.613H64.48C61.7407 139.613 59.52 141.834 59.52 144.573C59.52 147.312 61.7407 149.533 64.48 149.533H137.227C139.966 149.533 142.187 147.312 142.187 144.573C142.187 141.834 139.966 139.613 137.227 139.613Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
8
+ <path d="M107.467 162.76H64.48C61.7407 162.76 59.52 164.981 59.52 167.72C59.52 170.459 61.7407 172.68 64.48 172.68H107.467C110.206 172.68 112.427 170.459 112.427 167.72C112.427 164.981 110.206 162.76 107.467 162.76Z" fill="rgb(var(--color-primary-100))"/>
9
+ <path d="M137.227 184.253H64.48C61.7407 184.253 59.52 186.474 59.52 189.213C59.52 191.953 61.7407 194.173 64.48 194.173H137.227C139.966 194.173 142.187 191.953 142.187 189.213C142.187 186.474 139.966 184.253 137.227 184.253Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
10
+ <path d="M107.467 207.4H64.48C61.7407 207.4 59.52 209.621 59.52 212.36C59.52 215.099 61.7407 217.32 64.48 217.32H107.467C110.206 217.32 112.427 215.099 112.427 212.36C112.427 209.621 110.206 207.4 107.467 207.4Z" fill="rgb(var(--color-primary-100))"/>
11
+ <path d="M137.227 228.893H64.48C61.7407 228.893 59.52 231.114 59.52 233.853C59.52 236.592 61.7407 238.813 64.48 238.813H137.227C139.966 238.813 142.187 236.592 142.187 233.853C142.187 231.114 139.966 228.893 137.227 228.893Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
12
12
  <g filter="url(#filter1_d_577_1090)">
13
- <path d="M195.093 9H52.9068C48.3412 9 44.6401 12.7011 44.6401 17.2667V66.8667C44.6401 71.4322 48.3412 75.1333 52.9068 75.1333H195.093C199.659 75.1333 203.36 71.4322 203.36 66.8667V17.2667C203.36 12.7011 199.659 9 195.093 9Z" fill="#0886DE"/>
13
+ <path d="M195.093 9H52.9068C48.3412 9 44.6401 12.7011 44.6401 17.2667V66.8667C44.6401 71.4322 48.3412 75.1333 52.9068 75.1333H195.093C199.659 75.1333 203.36 71.4322 203.36 66.8667V17.2667C203.36 12.7011 199.659 9 195.093 9Z" fill="rgb(var(--color-primary-500))"/>
14
14
  </g>
15
- <path d="M107.467 27.1865H64.48C61.7407 27.1865 59.52 29.4072 59.52 32.1465C59.52 34.8859 61.7407 37.1065 64.48 37.1065H107.467C110.206 37.1065 112.427 34.8859 112.427 32.1465C112.427 29.4072 110.206 27.1865 107.467 27.1865Z" fill="#A2D7FC"/>
15
+ <path d="M107.467 27.1865H64.48C61.7407 27.1865 59.52 29.4072 59.52 32.1465C59.52 34.8859 61.7407 37.1065 64.48 37.1065H107.467C110.206 37.1065 112.427 34.8859 112.427 32.1465C112.427 29.4072 110.206 27.1865 107.467 27.1865Z" fill="rgb(var(--color-primary-100))"/>
16
16
  <path d="M137.227 48.6799H64.48C61.7407 48.6799 59.52 50.9006 59.52 53.6399C59.52 56.3793 61.7407 58.5999 64.48 58.5999H137.227C139.966 58.5999 142.187 56.3793 142.187 53.6399C142.187 50.9006 139.966 48.6799 137.227 48.6799Z" fill="white"/>
17
17
  <defs>
18
- <filter id="filter0_d_577_1090" x="38.6401" y="84.3198" width="170.72" height="202.133" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
19
18
  <feFlood flood-opacity="0" result="BackgroundImageFix"/>
20
19
  <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
21
20
  <feOffset dy="-3"/>
@@ -1,26 +1,26 @@
1
1
  <svg width="348" height="250" viewBox="0 0 348 250" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="table-empty-state-svg">
2
- <path d="M284.572 0H70.2863C60.4241 0 52.4292 7.99492 52.4292 17.8571V232.143C52.4292 242.005 60.4241 250 70.2863 250H284.572C294.434 250 302.429 242.005 302.429 232.143V17.8571C302.429 7.99492 294.434 0 284.572 0Z" fill="url(#paint0_linear_577_1275)"/>
2
+ <path d="M284.572 0H70.2863C60.4241 0 52.4292 7.99492 52.4292 17.8571V232.143C52.4292 242.005 60.4241 250 70.2863 250H284.572C294.434 250 302.429 242.005 302.429 232.143V17.8571C302.429 7.99492 294.434 0 284.572 0Z" fill="rgb(var(--color-primary-100))"/>
3
3
  <g filter="url(#filter0_d_577_1275)">
4
4
  <path d="M91.7142 96.4287H332.786C335.154 96.4287 337.425 97.3694 339.099 99.0438C340.774 100.718 341.714 102.989 341.714 105.357V150C341.714 152.368 340.774 154.639 339.099 156.314C337.425 157.988 335.154 158.929 332.786 158.929H91.7142C89.3462 158.929 87.0752 157.988 85.4008 156.314C83.7263 154.639 82.7856 152.368 82.7856 150V105.357C82.7856 102.989 83.7263 100.718 85.4008 99.0438C87.0752 97.3694 89.3462 96.4287 91.7142 96.4287V96.4287Z" fill="white"/>
5
5
  </g>
6
- <path d="M223.857 110.714H177.429C174.47 110.714 172.072 113.112 172.072 116.071C172.072 119.03 174.47 121.428 177.429 121.428H223.857C226.816 121.428 229.215 119.03 229.215 116.071C229.215 113.112 226.816 110.714 223.857 110.714Z" fill="#B4DAFF"/>
7
- <path d="M256 133.928H177.429C174.47 133.928 172.072 136.327 172.072 139.285C172.072 142.244 174.47 144.643 177.429 144.643H256C258.959 144.643 261.357 142.244 261.357 139.285C261.357 136.327 258.959 133.928 256 133.928Z" fill="#DEE9FC"/>
8
- <path d="M137.251 144.642C146.621 144.642 154.216 137.047 154.216 127.678C154.216 118.309 146.621 110.714 137.251 110.714C127.882 110.714 120.287 118.309 120.287 127.678C120.287 137.047 127.882 144.642 137.251 144.642Z" fill="#1485FD"/>
6
+ <path d="M223.857 110.714H177.429C174.47 110.714 172.072 113.112 172.072 116.071C172.072 119.03 174.47 121.428 177.429 121.428H223.857C226.816 121.428 229.215 119.03 229.215 116.071C229.215 113.112 226.816 110.714 223.857 110.714Z" fill="rgb(var(--color-primary-100))"/>
7
+ <path d="M256 133.928H177.429C174.47 133.928 172.072 136.327 172.072 139.285C172.072 142.244 174.47 144.643 177.429 144.643H256C258.959 144.643 261.357 142.244 261.357 139.285C261.357 136.327 258.959 133.928 256 133.928Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
8
+ <path d="M137.251 144.642C146.621 144.642 154.216 137.047 154.216 127.678C154.216 118.309 146.621 110.714 137.251 110.714C127.882 110.714 120.287 118.309 120.287 127.678C120.287 137.047 127.882 144.642 137.251 144.642Z" fill="rgb(var(--color-primary-500))"/>
9
9
  <path d="M133.905 133V131.668L137.44 128.202C137.778 127.861 138.059 127.558 138.285 127.293C138.51 127.027 138.679 126.771 138.792 126.522C138.905 126.273 138.961 126.008 138.961 125.727C138.961 125.405 138.888 125.13 138.742 124.901C138.596 124.669 138.396 124.49 138.141 124.364C137.885 124.238 137.595 124.175 137.271 124.175C136.936 124.175 136.643 124.245 136.391 124.384C136.139 124.52 135.943 124.714 135.804 124.966C135.668 125.218 135.6 125.518 135.6 125.866H133.845C133.845 125.219 133.993 124.658 134.288 124.18C134.583 123.703 134.989 123.334 135.506 123.072C136.026 122.81 136.623 122.679 137.295 122.679C137.978 122.679 138.578 122.807 139.095 123.062C139.612 123.317 140.013 123.667 140.298 124.111C140.587 124.555 140.731 125.062 140.731 125.632C140.731 126.013 140.658 126.388 140.512 126.756C140.366 127.124 140.109 127.531 139.741 127.979C139.377 128.426 138.865 128.968 138.205 129.604L136.45 131.389V131.459H140.885V133H133.905Z" fill="white"/>
10
10
  <g filter="url(#filter1_d_577_1275)">
11
11
  <path d="M14.9286 173.214H256C258.368 173.214 260.639 174.155 262.313 175.829C263.988 177.504 264.929 179.775 264.929 182.143V226.786C264.929 229.154 263.988 231.425 262.313 233.099C260.639 234.774 258.368 235.714 256 235.714H14.9286C12.5606 235.714 10.2896 234.774 8.61512 233.099C6.94069 231.425 6 229.154 6 226.786V182.143C6 179.775 6.94069 177.504 8.61512 175.829C10.2896 174.155 12.5606 173.214 14.9286 173.214V173.214Z" fill="white"/>
12
12
  </g>
13
- <path d="M147.071 187.5H100.643C97.6841 187.5 95.2856 189.898 95.2856 192.857C95.2856 195.816 97.6841 198.214 100.643 198.214H147.071C150.03 198.214 152.429 195.816 152.429 192.857C152.429 189.898 150.03 187.5 147.071 187.5Z" fill="#B4DAFF"/>
14
- <path d="M179.214 210.714H100.643C97.6841 210.714 95.2856 213.113 95.2856 216.071C95.2856 219.03 97.6841 221.429 100.643 221.429H179.214C182.173 221.429 184.571 219.03 184.571 216.071C184.571 213.113 182.173 210.714 179.214 210.714Z" fill="#DEE9FC"/>
15
- <path d="M37.2499 221.428C46.619 221.428 54.2142 213.833 54.2142 204.464C54.2142 195.095 46.619 187.5 37.2499 187.5C27.8808 187.5 20.2856 195.095 20.2856 204.464C20.2856 213.833 27.8808 221.428 37.2499 221.428Z" fill="#1485FD"/>
13
+ <path d="M147.071 187.5H100.643C97.6841 187.5 95.2856 189.898 95.2856 192.857C95.2856 195.816 97.6841 198.214 100.643 198.214H147.071C150.03 198.214 152.429 195.816 152.429 192.857C152.429 189.898 150.03 187.5 147.071 187.5Z" fill="rgb(var(--color-primary-100))"/>
14
+ <path d="M179.214 210.714H100.643C97.6841 210.714 95.2856 213.113 95.2856 216.071C95.2856 219.03 97.6841 221.429 100.643 221.429H179.214C182.173 221.429 184.571 219.03 184.571 216.071C184.571 213.113 182.173 210.714 179.214 210.714Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
15
+ <path d="M37.2499 221.428C46.619 221.428 54.2142 213.833 54.2142 204.464C54.2142 195.095 46.619 187.5 37.2499 187.5C27.8808 187.5 20.2856 195.095 20.2856 204.464C20.2856 213.833 27.8808 221.428 37.2499 221.428Z" fill="rgb(var(--color-primary-500))"/>
16
16
  <path d="M36.9077 209.119C36.294 209.119 35.7486 209.014 35.2713 208.804C34.7969 208.594 34.4219 208.301 34.1463 207.926C33.8707 207.551 33.7244 207.118 33.7074 206.626H35.3097C35.3239 206.862 35.402 207.068 35.544 207.244C35.6861 207.418 35.875 207.553 36.1108 207.649C36.3466 207.746 36.6108 207.794 36.9034 207.794C37.2159 207.794 37.4929 207.74 37.7344 207.632C37.9759 207.521 38.1648 207.368 38.3011 207.172C38.4375 206.976 38.5043 206.75 38.5014 206.494C38.5043 206.23 38.4361 205.997 38.2969 205.795C38.1577 205.594 37.956 205.436 37.6918 205.322C37.4304 205.209 37.1151 205.152 36.7457 205.152H35.9744V203.933H36.7457C37.0497 203.933 37.3153 203.881 37.5426 203.776C37.7727 203.67 37.9531 203.523 38.0838 203.332C38.2145 203.139 38.2784 202.916 38.2756 202.663C38.2784 202.416 38.223 202.202 38.1094 202.02C37.9986 201.835 37.8409 201.692 37.6364 201.589C37.4347 201.487 37.1974 201.436 36.9247 201.436C36.6577 201.436 36.4105 201.484 36.1832 201.581C35.956 201.678 35.7727 201.815 35.6335 201.994C35.4943 202.17 35.4205 202.381 35.4119 202.625H33.8906C33.902 202.136 34.0426 201.707 34.3125 201.338C34.5852 200.966 34.9489 200.676 35.4034 200.469C35.858 200.259 36.3679 200.153 36.9332 200.153C37.5156 200.153 38.0213 200.263 38.4503 200.482C38.8821 200.697 39.2159 200.989 39.4517 201.355C39.6875 201.722 39.8054 202.126 39.8054 202.57C39.8082 203.061 39.6634 203.473 39.3707 203.805C39.081 204.138 38.7003 204.355 38.2287 204.457V204.526C38.8423 204.611 39.3125 204.838 39.6392 205.207C39.9688 205.574 40.1321 206.03 40.1293 206.575C40.1293 207.064 39.9901 207.501 39.7116 207.888C39.4361 208.271 39.0554 208.572 38.5696 208.791C38.0866 209.01 37.5327 209.119 36.9077 209.119Z" fill="white"/>
17
17
  <g filter="url(#filter2_d_577_1275)">
18
- <path d="M256 19.6428H14.9286C9.99746 19.6428 6 23.6403 6 28.5714V73.2142C6 78.1454 9.99746 82.1428 14.9286 82.1428H256C260.931 82.1428 264.929 78.1454 264.929 73.2142V28.5714C264.929 23.6403 260.931 19.6428 256 19.6428Z" fill="#0886DE"/>
18
+ <path d="M256 19.6428H14.9286C9.99746 19.6428 6 23.6403 6 28.5714V73.2142C6 78.1454 9.99746 82.1428 14.9286 82.1428H256C260.931 82.1428 264.929 78.1454 264.929 73.2142V28.5714C264.929 23.6403 260.931 19.6428 256 19.6428Z" ss="hh" fill="rgb(var(--color-primary-500))"/>
19
19
  </g>
20
- <path d="M143.5 33.929H97.0715C94.1128 33.929 91.7144 36.3274 91.7144 39.2861C91.7144 42.2448 94.1128 44.6432 97.0715 44.6432H143.5C146.459 44.6432 148.857 42.2448 148.857 39.2861C148.857 36.3274 146.459 33.929 143.5 33.929Z" fill="#B4DAFF"/>
21
- <path d="M175.643 57.1431H97.0715C94.1128 57.1431 91.7144 59.5415 91.7144 62.5002C91.7144 65.4589 94.1128 67.8574 97.0715 67.8574H175.643C178.602 67.8574 181 65.4589 181 62.5002C181 59.5415 178.602 57.1431 175.643 57.1431Z" fill="#DEE9FC"/>
20
+ <path d="M143.5 33.929H97.0715C94.1128 33.929 91.7144 36.3274 91.7144 39.2861C91.7144 42.2448 94.1128 44.6432 97.0715 44.6432H143.5C146.459 44.6432 148.857 42.2448 148.857 39.2861C148.857 36.3274 146.459 33.929 143.5 33.929Z" fill="rgb(var(--color-primary-100))"/>
21
+ <path d="M175.643 57.1431H97.0715C94.1128 57.1431 91.7144 59.5415 91.7144 62.5002C91.7144 65.4589 94.1128 67.8574 97.0715 67.8574H175.643C178.602 67.8574 181 65.4589 181 62.5002C181 59.5415 178.602 57.1431 175.643 57.1431Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
22
22
  <path d="M60.4643 67.857C69.8334 67.857 77.4286 60.2619 77.4286 50.8928C77.4286 41.5236 69.8334 33.9285 60.4643 33.9285C51.0952 33.9285 43.5 41.5236 43.5 50.8928C43.5 60.2619 51.0952 67.857 60.4643 67.857Z" fill="white"/>
23
- <path d="M62.1477 45.6746V55.8564H60.3032V47.4694H60.2435L57.8621 48.9907V47.3003L60.3927 45.6746H62.1477Z" fill="#0886DE"/>
23
+ <path d="M62.1477 45.6746V55.8564H60.3032V47.4694H60.2435L57.8621 48.9907V47.3003L60.3927 45.6746H62.1477Z" fill="rgb(var(--color-primary-500))"/>
24
24
  <defs>
25
25
  <filter id="filter0_d_577_1275" x="76.7856" y="93.4287" width="270.929" height="74.5" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
26
26
  <feFlood flood-opacity="0" result="BackgroundImageFix"/>
@@ -49,7 +49,6 @@
49
49
  <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_577_1275"/>
50
50
  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_577_1275" result="shape"/>
51
51
  </filter>
52
- <linearGradient id="paint0_linear_577_1275" x1="177.429" y1="0" x2="177.429" y2="250" gradientUnits="userSpaceOnUse">
53
52
  <stop stop-color="#E3ECFA"/>
54
53
  <stop offset="1" stop-color="#DAE7FF"/>
55
54
  </linearGradient>
@@ -1,6 +1,6 @@
1
1
  <div class="relative flex flex-col w-full sm:w-auto z-40 js-actions-dropdown"
2
2
  data-controller="toggle-panel actions-picker"
3
- data-actions-picker-enabled-class="text-black hover:bg-blue-500 hover:text-white"
3
+ data-actions-picker-enabled-class="text-black hover:bg-primary-500 hover:text-white"
4
4
  data-actions-picker-disabled-class="cursor-wait text-gray-500"
5
5
  >
6
6
  <%= a_button style: @style,
@@ -27,7 +27,7 @@
27
27
  'disabled': is_disabled?(action),
28
28
  },
29
29
  title: action.action_name,
30
- class: "flex items-center px-4 py-3 w-full font-semibold text-sm #{is_disabled?(action) ? 'text-gray-500' : 'text-black hover:bg-blue-500 hover:text-white'}" do %>
30
+ class: "flex items-center px-4 py-3 w-full font-semibold text-sm hover:bg-primary-100 #{is_disabled?(action) ? 'text-gray-500' : 'text-black'}" do %>
31
31
  <%= svg 'play', class: 'h-5 mr-1 inline' %> <%= action.action_name %>
32
32
  <% end %>
33
33
  <% end %>
@@ -3,7 +3,7 @@
3
3
  class Avo::ActionsComponent < ViewComponent::Base
4
4
  include Avo::ApplicationHelper
5
5
 
6
- def initialize(actions: [], resource: nil, view: nil, exclude: [], style: :outline, color: :blue)
6
+ def initialize(actions: [], resource: nil, view: nil, exclude: [], style: :outline, color: :primary)
7
7
  @actions = actions || []
8
8
  @resource = resource
9
9
  @view = view
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # A button/link can have the following settings:
4
- # style: primary/secondary/ternary
4
+ # style: primary/outline/text
5
5
  # size: :xs :sm, :md, :lg
6
6
  class Avo::ButtonComponent < ViewComponent::Base
7
7
  def initialize(path = nil, size: :md, style: :outline, color: :gray, icon: nil, icon_class: "", is_link: false, rounded: true, compact: false, **args)
@@ -73,7 +73,7 @@ class Avo::ButtonComponent < ViewComponent::Base
73
73
  result.html_safe
74
74
  end
75
75
 
76
- def output
76
+ def call
77
77
  if is_link?
78
78
  output_link
79
79
  else
@@ -149,7 +149,7 @@ class Avo::ButtonComponent < ViewComponent::Base
149
149
  def style_classes
150
150
  case @style
151
151
  when :primary
152
- " bg-#{@color}-500 text-white border-#{@color}-500 hover:bg-#{@color}-600 hover:border-#{@color}-600 active:border-#{@color}-700 active:outline-#{@color}-700 active:bg-#{@color}-600"
152
+ " bg-#{@color}-500 text-white border-#{@color}-500 hover:bg-#{@color}-600 hover:border-#{@color}-600 active:border-#{@color}-600 active:outline-#{@color}-600 active:bg-#{@color}-600"
153
153
  when :outline
154
154
  " bg-white text-#{@color}-500 border-#{@color}-500 hover:bg-#{@color}-100 active:bg-#{@color}-100 active:border-#{@color}-500 active:outline-#{@color}-500"
155
155
  when :text
@@ -2,7 +2,7 @@
2
2
  <div class="h-8 flex items-center">
3
3
  <%= @form.check_box @field.id,
4
4
  checked: @field.value,
5
- class: "text-lg h-4 w-4 #{@field.get_html(:classes, view: view, element: :input)}",
5
+ class: "text-lg h-4 w-4 checked:bg-primary-400 focus:checked:!bg-primary-400 #{@field.get_html(:classes, view: view, element: :input)}",
6
6
  data: @field.get_html(:data, view: view, element: :input),
7
7
  disabled: @field.readonly,
8
8
  style: @field.get_html(:style, view: view, element: :input)
@@ -4,5 +4,5 @@
4
4
  <%= @field.value %><%= @field.value_suffix if @field.value_suffix.present? %>
5
5
  </div>
6
6
  <% end %>
7
- <progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-24"></progress>
7
+ <progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-auto"></progress>
8
8
  <% end %>
@@ -4,5 +4,5 @@
4
4
  <%= @field.value %><%= @field.value_suffix if @field.value_suffix.present? %>
5
5
  </div>
6
6
  <% end %>
7
- <progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-full"></progress>
7
+ <progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block h-3 w-full"></progress>
8
8
  <% end %>
@@ -17,7 +17,7 @@
17
17
  %>
18
18
  <%# real field %>
19
19
  <%= @form.text_field @field.id,
20
- class: classes("hidden w-full"),
20
+ class: classes("hidden w-full border-primary-500 focus-within:border-primary-500"),
21
21
  data: {
22
22
  'tags-field-target': 'input',
23
23
  'whitelist-items': @field.suggestions.to_json,
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # require_relative 'item_labels'
4
+
3
5
  class Avo::Fields::TagsField::ShowComponent < Avo::Fields::ShowComponent
4
6
  include Avo::Fields::Concerns::ItemLabels
5
7
  end
@@ -1,3 +1,3 @@
1
- <%= link_to path, class: "flex-1 flex items-center justify-center bg-white text-left cursor-pointer text-gray-800 font-semibold hover:bg-blue-100 block px-4 py-1 w-full py-3 text-center rounded w-full", target: target, title: title do %>
1
+ <%= link_to path, class: "flex-1 flex items-center justify-center bg-white text-left cursor-pointer text-gray-800 font-semibold hover:bg-primary-100 block px-4 py-1 w-full py-3 text-center rounded w-full", target: target, title: title do %>
2
2
  <%= helpers.svg(icon, class: 'h-4 mr-1') if icon.present? %> <%= label %>
3
3
  <% end %>
@@ -25,7 +25,7 @@
25
25
  # On edit screens we want to load each tab because we wnst the DOM to have the fields present on form submission.
26
26
  # If you have a field which is in the second tab and it's required, the form submission will fail because the required field is not in view, and we don't want that.
27
27
  # We also want to load the current tab
28
- should_lazy_load = if @view.to_s.in?(['edit', 'new', 'update', 'create'])
28
+ should_lazy_load = if @view.to_s.in?(['edit', 'new'])
29
29
  false
30
30
  else
31
31
  !is_current_tab
@@ -30,11 +30,11 @@ class Avo::TabSwitcherComponent < Avo::BaseComponent
30
30
  end
31
31
 
32
32
  def is_edit?
33
- @view.in?([:edit, :update])
33
+ @view == :edit
34
34
  end
35
35
 
36
36
  def is_new?
37
- @view.in?([:new, :create])
37
+ @view == :new
38
38
  end
39
39
 
40
40
  def is_initial_load?
@@ -42,7 +42,7 @@ class Avo::Views::ResourceEditComponent < Avo::ResourceComponent
42
42
  end
43
43
 
44
44
  def is_edit?
45
- view.in?([:edit, :update])
45
+ view == :edit
46
46
  end
47
47
 
48
48
  def form_method
@@ -32,9 +32,9 @@
32
32
  data-selected-resources-name="<%= @resource.model_key %>"
33
33
  data-selected-resources="[]"
34
34
  >
35
- <% unless hide_search_input %>
35
+ <% if @resource.search_query.present? %>
36
36
  <div class="flex items-center px-4 w-64">
37
- <%= render partial: 'avo/partials/resource_search', locals: {resource: @resource.route_key, via_reflection: via_reflection} %>
37
+ <%= render partial: 'avo/partials/resource_search', locals: {resource: @resource.route_key} %>
38
38
  </div>
39
39
  <% else %>
40
40
  <%# Offset for the space-y-2 property when the search is missing %>
@@ -143,12 +143,6 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
143
143
  @resource.resource_description
144
144
  end
145
145
 
146
- def hide_search_input
147
- return true unless @resource.search_query.present?
148
-
149
- field&.hide_search_input || false
150
- end
151
-
152
146
  private
153
147
 
154
148
  def reflection_model_class
@@ -159,15 +153,4 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
159
153
  field.custom_name? ? field.name : field.plural_name
160
154
  end
161
155
 
162
- def via_reflection
163
- return unless @reflection.present?
164
-
165
- {
166
- association: 'has_many',
167
- association_id: @reflection.name,
168
- class: reflection_model_class,
169
- id: @parent_model.id
170
- }
171
- end
172
-
173
156
  end
@@ -36,7 +36,6 @@
36
36
  tippy: control.title ? :tooltip : nil,
37
37
  'resource-id': @resource.model.id,
38
38
  } do %>
39
- <%= control.label %>
40
39
  <% end %>
41
40
  <% end %>
42
41
  <% elsif control.actions_list? %>
@@ -91,7 +90,7 @@
91
90
  data: {
92
91
  confirm: "Are you sure you want to detach this #{title}."
93
92
  } do %>
94
- <%= control.label %>
93
+ <%= t('avo.detach_item', item: title).capitalize %>
95
94
  <% end %>
96
95
  <% end %>
97
96
  <% end %>
@@ -115,7 +115,7 @@ module Avo
115
115
  add_breadcrumb via_resource.model_title, resource_path(model: via_model, resource: via_resource)
116
116
  end
117
117
 
118
- add_breadcrumb @resource.plural_name.humanize, resources_path(resource: @resource)
118
+ add_breadcrumb @resource.plural_name.humanize
119
119
  add_breadcrumb t("avo.new").humanize
120
120
  end
121
121
 
@@ -129,14 +129,21 @@ module Avo
129
129
  @reflection = @model._reflections[params[:via_relation]]
130
130
  # Figure out what kind of association does the record have with the parent record
131
131
 
132
- # Fills in the required infor for belongs_to and has_many
132
+ # belongs_to
133
+ # has_many
133
134
  # Get the foreign key and set it to the id we received in the params
134
135
  if @reflection.is_a?(ActiveRecord::Reflection::BelongsToReflection) || @reflection.is_a?(ActiveRecord::Reflection::HasManyReflection)
135
- @model.send("#{@reflection.foreign_key}=", params[:via_resource_id])
136
+ foreign_key = @reflection.foreign_key
137
+ @model.send("#{foreign_key}=", params[:via_resource_id])
136
138
  @model.save
137
139
  end
138
140
 
139
- # For when working with has_one, has_one_through, has_many_through, has_and_belongs_to_many, polymorphic
141
+ # has_one
142
+ # has_one_through
143
+
144
+ # has_many_through
145
+ # has_and_belongs_to_many
146
+ # polymorphic
140
147
  if @reflection.is_a? ActiveRecord::Reflection::ThroughReflection
141
148
  # find the record
142
149
  via_resource = ::Avo::App.get_resource_by_model_name params[:via_relation_class]
@@ -146,14 +153,13 @@ module Avo
146
153
  end
147
154
  end
148
155
 
149
- add_breadcrumb @resource.plural_name.humanize, resources_path(resource: @resource)
150
- add_breadcrumb t("avo.new").humanize
151
- set_actions
152
-
153
- if saved
154
- create_success_action
155
- else
156
- create_fail_action
156
+ respond_to do |format|
157
+ if saved
158
+ format.html { redirect_to after_create_path, notice: "#{@resource.name} #{t("avo.was_successfully_created")}." }
159
+ else
160
+ flash.now[:error] = t "avo.you_missed_something_check_form"
161
+ format.html { render :new, status: :unprocessable_entity }
162
+ end
157
163
  end
158
164
  end
159
165
 
@@ -165,20 +171,26 @@ module Avo
165
171
  # model gets instantiated and filled in the fill_model method
166
172
  saved = save_model
167
173
  @resource = @resource.hydrate(model: @model, view: :edit, user: _current_user)
168
- set_actions
169
174
 
170
- if saved
171
- update_success_action
172
- else
173
- update_fail_action
175
+ respond_to do |format|
176
+ if saved
177
+ format.html { redirect_to after_update_path, notice: "#{@resource.name} #{t("avo.was_successfully_updated")}." }
178
+ else
179
+ flash.now[:error] = t "avo.you_missed_something_check_form"
180
+ format.html { render :edit, status: :unprocessable_entity }
181
+ end
174
182
  end
175
183
  end
176
184
 
177
185
  def destroy
178
- if destroy_model
179
- destroy_success_action
180
- else
181
- destroy_fail_action
186
+ respond_to do |format|
187
+ if destroy_model
188
+ format.html { redirect_to params[:referrer] || resources_path(resource: @resource, turbo_frame: params[:turbo_frame], view_type: params[:view_type]), notice: t("avo.resource_destroyed", attachment_class: @attachment_class) }
189
+ else
190
+ error_message = @errors.present? ? @errors.first : t("avo.failed")
191
+
192
+ format.html { redirect_back fallback_location: params[:referrer] || resources_path(resource: @resource, turbo_frame: params[:turbo_frame], view_type: params[:view_type]), error: error_message }
193
+ end
182
194
  end
183
195
  end
184
196
 
@@ -389,27 +401,6 @@ module Avo
389
401
  add_breadcrumb t("avo.edit").humanize
390
402
  end
391
403
 
392
- def create_success_action
393
- respond_to do |format|
394
- format.html { redirect_to after_create_path, notice: create_success_message}
395
- end
396
- end
397
-
398
- def create_fail_action
399
- respond_to do |format|
400
- flash.now[:error] = create_fail_message
401
- format.html { render :new, status: :unprocessable_entity }
402
- end
403
- end
404
-
405
- def create_success_message
406
- "#{@resource.name} #{t("avo.was_successfully_created")}."
407
- end
408
-
409
- def create_fail_message
410
- t "avo.you_missed_something_check_form"
411
- end
412
-
413
404
  def after_create_path
414
405
  # If this is an associated record return to the association show page
415
406
  if params[:via_relation_class].present? && params[:via_resource_id].present?
@@ -421,57 +412,12 @@ module Avo
421
412
  redirect_path_from_resource_option(:after_create_path) || resource_path(model: @model, resource: @resource)
422
413
  end
423
414
 
424
- def update_success_action
425
- respond_to do |format|
426
- format.html { redirect_to after_update_path, notice: update_success_message }
427
- end
428
- end
429
-
430
- def update_fail_action
431
- respond_to do |format|
432
- flash.now[:error] = update_fail_message
433
- format.html { render :edit, status: :unprocessable_entity }
434
- end
435
- end
436
-
437
- def update_success_message
438
- "#{@resource.name} #{t("avo.was_successfully_updated")}."
439
- end
440
-
441
- def update_fail_message
442
- t "avo.you_missed_something_check_form"
443
- end
444
-
445
415
  def after_update_path
446
416
  return params[:referrer] if params[:referrer].present?
447
417
 
448
418
  redirect_path_from_resource_option(:after_update_path) || resource_path(model: @model, resource: @resource)
449
419
  end
450
420
 
451
- def destroy_success_action
452
- respond_to do |format|
453
- format.html { redirect_to after_destroy_path, notice: destroy_success_message }
454
- end
455
- end
456
-
457
- def destroy_fail_action
458
- respond_to do |format|
459
- format.html { redirect_back fallback_location: params[:referrer] || resources_path(resource: @resource, turbo_frame: params[:turbo_frame], view_type: params[:view_type]), error: destroy_fail_message }
460
- end
461
- end
462
-
463
- def destroy_success_message
464
- t("avo.resource_destroyed", attachment_class: @attachment_class)
465
- end
466
-
467
- def destroy_fail_message
468
- @errors.present? ? @errors.first : t("avo.failed")
469
- end
470
-
471
- def after_destroy_path
472
- params[:referrer] || resources_path(resource: @resource, turbo_frame: params[:turbo_frame], view_type: params[:view_type])
473
- end
474
-
475
421
  def redirect_path_from_resource_option(action = :after_update_path)
476
422
  return nil if @resource.class.send(action).blank?
477
423