avo 1.21.1.pre.1 → 1.22.0.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +57 -57
  3. data/README.md +1 -1
  4. data/app/assets/builds/avo.css +405 -224
  5. data/app/assets/builds/avo.js +16 -6
  6. data/app/assets/builds/avo.js.map +2 -2
  7. data/app/assets/stylesheets/avo.css +1 -1
  8. data/app/assets/stylesheets/css/fonts.css +53 -0
  9. data/app/assets/stylesheets/css/pagination.css +9 -9
  10. data/app/assets/stylesheets/css/search.css +3 -2
  11. data/app/assets/svgs/dashboards-icon.svg +6 -0
  12. data/app/assets/svgs/resources-icon.svg +13 -0
  13. data/app/assets/svgs/three-dots.svg +5 -0
  14. data/app/assets/svgs/tools-icon.svg +3 -0
  15. data/app/components/avo/button_component.html.erb +1 -0
  16. data/app/components/avo/button_component.rb +111 -0
  17. data/app/components/avo/fields/belongs_to_field/autocomplete_component.html.erb +14 -7
  18. data/app/components/avo/fields/belongs_to_field/autocomplete_component.rb +47 -3
  19. data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +19 -4
  20. data/app/components/avo/fields/belongs_to_field/edit_component.rb +37 -0
  21. data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
  22. data/app/components/avo/index/field_wrapper_component.html.erb +8 -2
  23. data/app/components/avo/index/field_wrapper_component.rb +2 -1
  24. data/app/components/avo/index/resource_table_component.html.erb +3 -3
  25. data/app/components/avo/index/table_row_component.html.erb +1 -1
  26. data/app/components/avo/navigation_heading_component.html.erb +2 -2
  27. data/app/components/avo/navigation_heading_component.rb +5 -1
  28. data/app/components/avo/navigation_link_component.html.erb +2 -2
  29. data/app/components/avo/navigation_link_component.rb +5 -0
  30. data/app/components/avo/panel_component.html.erb +5 -3
  31. data/app/components/avo/sidebar_profile_component.html.erb +28 -0
  32. data/app/components/avo/sidebar_profile_component.rb +43 -0
  33. data/app/components/avo/views/resource_index_component.html.erb +8 -7
  34. data/app/components/avo/views/resource_show_component.html.erb +10 -0
  35. data/app/controllers/avo/application_controller.rb +1 -1
  36. data/app/helpers/avo/application_helper.rb +7 -5
  37. data/app/helpers/avo/resources_helper.rb +2 -2
  38. data/app/javascript/js/controllers/fields/date_field_controller.js +10 -2
  39. data/app/javascript/js/controllers/item_selector_controller.js +29 -19
  40. data/app/javascript/js/controllers/search_controller.js +8 -3
  41. data/app/views/avo/base/_actions.html.erb +4 -3
  42. data/app/views/avo/base/_filters.html.erb +3 -1
  43. data/app/views/avo/partials/_global_search.html.erb +2 -2
  44. data/app/views/avo/partials/_logo.html.erb +3 -1
  45. data/app/views/avo/partials/_navbar.html.erb +11 -0
  46. data/app/views/avo/partials/_paginator.html.erb +4 -3
  47. data/app/views/avo/partials/_resource_search.html.erb +1 -1
  48. data/app/views/avo/partials/_sidebar.html.erb +35 -0
  49. data/app/views/avo/partials/_table_header.html.erb +3 -3
  50. data/app/views/avo/partials/_turbo_frame_wrap.html.erb +7 -1
  51. data/app/views/avo/partials/_view_toggle_button.html.erb +22 -16
  52. data/app/views/layouts/avo/application.html.erb +3 -13
  53. data/db/factories.rb +7 -3
  54. data/lib/avo/app.rb +4 -3
  55. data/lib/avo/base_resource.rb +16 -14
  56. data/lib/avo/version.rb +1 -1
  57. data/public/avo-assets/avo.css +405 -224
  58. data/public/avo-assets/avo.js +16 -6
  59. data/public/avo-assets/avo.js.map +2 -2
  60. data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
  61. data/public/avo-assets/fonts/inter-v7-latin-500.svg +351 -0
  62. data/public/avo-assets/fonts/inter-v7-latin-500.ttf +0 -0
  63. data/public/avo-assets/fonts/inter-v7-latin-500.woff +0 -0
  64. data/public/avo-assets/fonts/inter-v7-latin-500.woff2 +0 -0
  65. data/public/avo-assets/fonts/inter-v7-latin-600.eot +0 -0
  66. data/public/avo-assets/fonts/inter-v7-latin-600.svg +351 -0
  67. data/public/avo-assets/fonts/inter-v7-latin-600.ttf +0 -0
  68. data/public/avo-assets/fonts/inter-v7-latin-600.woff +0 -0
  69. data/public/avo-assets/fonts/inter-v7-latin-600.woff2 +0 -0
  70. data/public/avo-assets/fonts/inter-v7-latin-700.eot +0 -0
  71. data/public/avo-assets/fonts/inter-v7-latin-700.svg +352 -0
  72. data/public/avo-assets/fonts/inter-v7-latin-700.ttf +0 -0
  73. data/public/avo-assets/fonts/inter-v7-latin-700.woff +0 -0
  74. data/public/avo-assets/fonts/inter-v7-latin-700.woff2 +0 -0
  75. data/public/avo-assets/fonts/inter-v7-latin-regular.eot +0 -0
  76. data/public/avo-assets/fonts/inter-v7-latin-regular.svg +351 -0
  77. data/public/avo-assets/fonts/inter-v7-latin-regular.ttf +0 -0
  78. data/public/avo-assets/fonts/inter-v7-latin-regular.woff +0 -0
  79. data/public/avo-assets/fonts/inter-v7-latin-regular.woff2 +0 -0
  80. data/public/avo-assets/logo.png +0 -0
  81. metadata +32 -5
  82. data/app/assets/images/avo/logo.png +0 -0
  83. data/app/views/avo/partials/_profile_dropdown.html.erb +0 -25
  84. data/app/views/avo/sidebar/_sidebar.html.erb +0 -33
@@ -83368,6 +83368,9 @@
83368
83368
  var esm_default = flatpickr;
83369
83369
 
83370
83370
  // app/javascript/js/controllers/fields/date_field_controller.js
83371
+ function universalTimestamp(timestampStr) {
83372
+ return new Date(new Date(timestampStr).getTime() + new Date(timestampStr).getTimezoneOffset() * 60 * 1e3);
83373
+ }
83371
83374
  var date_field_controller_default = class extends Controller {
83372
83375
  connect() {
83373
83376
  const options = {
@@ -83393,7 +83396,7 @@
83393
83396
  options.time_24hr = castBoolean(this.inputTarget.dataset.time24hr);
83394
83397
  options.appTimezone = this.inputTarget.dataset.timezone;
83395
83398
  } else {
83396
- currentValue = new Date(this.inputTarget.value);
83399
+ currentValue = universalTimestamp(this.inputTarget.value);
83397
83400
  }
83398
83401
  options.defaultDate = currentValue;
83399
83402
  esm_default(this.inputTarget, options);
@@ -83443,6 +83446,9 @@
83443
83446
  return [];
83444
83447
  }
83445
83448
  }
83449
+ get actionLinks() {
83450
+ return document.querySelectorAll('.js-actions-dropdown a[data-actions-picker-target="resourceAction"]');
83451
+ }
83446
83452
  set currentIds(value) {
83447
83453
  this.stateHolderElement.dataset.selectedResources = JSON.stringify(value);
83448
83454
  if (this.actionsPanelPresent) {
@@ -83476,7 +83482,7 @@
83476
83482
  }
83477
83483
  }
83478
83484
  enableResourceActions() {
83479
- document.querySelectorAll('.js-actions-dropdown a[data-actions-picker-target="resourceAction"]').forEach((link) => {
83485
+ this.actionLinks.forEach((link) => {
83480
83486
  link.classList.add("text-gray-700");
83481
83487
  link.classList.remove("text-gray-500");
83482
83488
  link.setAttribute("data-href", link.getAttribute("href"));
@@ -83484,7 +83490,7 @@
83484
83490
  });
83485
83491
  }
83486
83492
  disableResourceActions() {
83487
- document.querySelectorAll('.js-actions-dropdown a[data-actions-picker-target="resourceAction"]').forEach((link) => {
83493
+ this.actionLinks.forEach((link) => {
83488
83494
  link.classList.remove("text-gray-700");
83489
83495
  link.classList.add("text-gray-500");
83490
83496
  link.setAttribute("href", link.getAttribute("data-href"));
@@ -87339,7 +87345,9 @@
87339
87345
  this.hiddenIdTarget.setAttribute("value", item._id);
87340
87346
  this.buttonTarget.setAttribute("value", item._label);
87341
87347
  document.querySelector(".aa-DetachedOverlay").remove();
87342
- this.clearButtonTarget.classList.remove("hidden");
87348
+ if (this.hasClearButtonTarget) {
87349
+ this.clearButtonTarget.classList.remove("hidden");
87350
+ }
87343
87351
  } else {
87344
87352
  turbo_es2017_esm_exports.visit(item._url, { action: "advance" });
87345
87353
  }
@@ -87398,7 +87406,7 @@
87398
87406
  const that = this;
87399
87407
  this.buttonTarget.onclick = () => this.showSearchPanel();
87400
87408
  this.clearValueTargets.forEach((target) => {
87401
- if (target.getAttribute("value")) {
87409
+ if (target.getAttribute("value") && this.hasClearButtonTarget) {
87402
87410
  this.clearButtonTarget.classList.remove("hidden");
87403
87411
  }
87404
87412
  });
@@ -87418,7 +87426,9 @@
87418
87426
  return that.debouncedFetch(endpoint).then((response) => response.json()).then((data) => Object.keys(data).map((resourceName) => that.addSource(resourceName, data[resourceName])));
87419
87427
  }
87420
87428
  });
87421
- this.buttonTarget.removeAttribute("disabled");
87429
+ if (this.buttonTarget.dataset.shouldBeDisabled !== "true") {
87430
+ this.buttonTarget.removeAttribute("disabled");
87431
+ }
87422
87432
  }
87423
87433
  };
87424
87434
  __publicField(search_controller_default, "targets", [