avo 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/avo/debug/status_component.html.erb +27 -23
- data/app/components/avo/debug/status_component.rb +4 -0
- data/lib/avo/skills/avo-actions/SKILL.md +3 -2
- data/lib/avo/skills/avo-custom-ui/SKILL.md +3 -1
- data/lib/avo/skills/avo-index-views/SKILL.md +2 -2
- data/lib/avo/skills/avo-update/SKILL.md +2 -2
- data/lib/avo/skills/docs-index.json +2 -2
- data/lib/avo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4db5afb9a352fe2f25dd355093e0fb16f466c205d4ab10f4c59a30951021c6aa
|
|
4
|
+
data.tar.gz: aad220bc34950f2d5c53d9e7af37b6d98d4b4e26168e33df781bdae46d6e95e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 803ebc0900b8ce4ea49f94d0ef3f058075494894576c06975354d22024deba6485d4d3ff516711471af1231c28336085c80d88cb267fa0a77a20f6e41fcdaeaf
|
|
7
|
+
data.tar.gz: 351edeedeb2ead0adf9c2b653d1c80f60b54367c11a06334df2f64f352d3edf86397b62a4a8c119b6b6f8c79f049efa7d8719c75ac72d52678badbf2faa5c2c2
|
data/Gemfile.lock
CHANGED
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
<%= render ui.panel(title: "Avo Status", description: "Use this page to debug your Avo instance.") do |panel| %>
|
|
2
2
|
<% panel.with_body do %>
|
|
3
3
|
<div class="status-page">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
<% if license_card? %>
|
|
5
|
+
<%= license_card %>
|
|
6
|
+
<% else %>
|
|
7
|
+
<%= render ui.card(title: "License", padded: true) do |card| %>
|
|
8
|
+
<% card.with_body do %>
|
|
9
|
+
<div class="status-page__license">
|
|
10
|
+
<%= render ui.badge(label: "Community", color: :success, icon: "tabler/outline/rosette-discount-check") %>
|
|
11
|
+
<dl class="status-page__details">
|
|
12
|
+
<% information_items.each do |key, value| %>
|
|
13
|
+
<div class="status-page__detail">
|
|
14
|
+
<dt class="status-page__detail-label"><%= key.humanize %></dt>
|
|
15
|
+
<dd class="status-page__detail-value"><%= value.presence || tag.span("Not set", class: "status-page__detail-empty") %></dd>
|
|
16
|
+
</div>
|
|
17
|
+
<% end %>
|
|
18
|
+
</dl>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% card.with_footer do %>
|
|
22
|
+
<div class="status-page__upgrade">
|
|
23
|
+
<p class="status-page__upgrade-text">
|
|
24
|
+
Need more? Pick your license, then open its <strong>Upgrade</strong> section.
|
|
25
|
+
</p>
|
|
26
|
+
<%= a_link "https://avohq.io/licenses", style: :primary, color: :blue, size: :sm, target: "_blank", icon: "tabler/outline/external-link" do %>
|
|
27
|
+
View licenses
|
|
14
28
|
<% end %>
|
|
15
|
-
</
|
|
16
|
-
|
|
17
|
-
<% end %>
|
|
18
|
-
<% card.with_footer do %>
|
|
19
|
-
<div class="status-page__upgrade">
|
|
20
|
-
<p class="status-page__upgrade-text">
|
|
21
|
-
Need more? Pick your license, then open its <strong>Upgrade</strong> section.
|
|
22
|
-
</p>
|
|
23
|
-
<%= a_link "https://avohq.io/licenses", style: :primary, color: :blue, size: :sm, target: "_blank", icon: "tabler/outline/external-link" do %>
|
|
24
|
-
View licenses
|
|
25
|
-
<% end %>
|
|
26
|
-
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<% end %>
|
|
27
31
|
<% end %>
|
|
28
32
|
<% end %>
|
|
29
33
|
|
|
30
|
-
<%= render Avo::Debug::PluginsComponent.new %>
|
|
34
|
+
<%= render Avo::Debug::PluginsComponent.new(row_extra: @plugin_row_extra) %>
|
|
31
35
|
|
|
32
36
|
<% if Avo::IN_DEVELOPMENT %>
|
|
33
37
|
<%= render ui.card(title: "Telemetry", description: "The payload sent to HQ. Shown only when AVO_IN_DEVELOPMENT=1.", class: "status-page__wide") do |card| %>
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
class Avo::Debug::StatusComponent < Avo::BaseComponent
|
|
4
4
|
include Avo::ApplicationHelper
|
|
5
5
|
|
|
6
|
+
# A host page that knows more about the license fills these, so it reuses this layout instead of drawing its own.
|
|
7
|
+
renders_one :license_card
|
|
8
|
+
prop :plugin_row_extra
|
|
9
|
+
|
|
6
10
|
def information_items
|
|
7
11
|
@information_items ||= {
|
|
8
12
|
license_key: Avo.configuration.license_key,
|
|
@@ -171,7 +171,7 @@ def handle(query:, fields:, **args)
|
|
|
171
171
|
end
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
**Picking an associated record.** A `belongs_to` field
|
|
174
|
+
**Picking an associated record.** A `belongs_to` field renders in the action modal wherever the action starts: **Show**, one or several rows on **Index**, or a standalone action with no record. On a single record it opens with that record's association preselected. Before `avo` 4.2.9 it rendered only with exactly one record, so older apps guard it with `visible: -> { resource.record.present? }` (drop the guard on 4.2.9+). For a value that isn't an association, use a plain input:
|
|
175
175
|
|
|
176
176
|
```ruby
|
|
177
177
|
# Short list — a select with the options loaded when the form renders.
|
|
@@ -270,7 +270,8 @@ When an index spans multiple pages, checking "Select all" offers to select **eve
|
|
|
270
270
|
URI.parse(request.referer).query.to_s.include?("hey=ya") ? :yes : :no
|
|
271
271
|
}
|
|
272
272
|
```
|
|
273
|
-
-
|
|
273
|
+
- **A `belongs_to` field arrives in `handle` under its foreign key.** `field :user, as: :belongs_to` is `fields[:user_id]`; a polymorphic one arrives as `fields[:reviewable_type]` and `fields[:reviewable_id]` (4.2.7+). Both are the submitted strings, and an action does not check the type against the field's `types`, so validate it before constantizing. On `avo` older than 4.2.9 the field doesn't render in a bulk or standalone action: use `as: :select` or `as: :tags, mode: :select, fetch_values_from: "..."` and assign the ID yourself.
|
|
274
|
+
- **Actions also run from association panels (4.3.3+).** A `has_many` or `has_and_belongs_to_many` panel offers the actions declared on the *associated* resource, on the rows checked in the panel. `record` is `nil` while the dropdown renders (as on Index), so `name` and `arguments` blocks must handle that; the panel's parent record reaches `visible` as `parent_resource.record` (`parent_resource` is `nil` outside a panel).
|
|
274
275
|
- **`reload_records` is Index-only.** It doesn't work on association tables — use `reload` there.
|
|
275
276
|
- **Notification bodies truncate at ~320 characters.** Keep `succeed`/`error` messages short; put long output in a `download` or a redirect.
|
|
276
277
|
- **File downloads need `self.turbo = false`.** Otherwise Turbo intercepts the response and the download won't fire.
|
|
@@ -482,7 +482,7 @@ end
|
|
|
482
482
|
`Avo.plugin_manager` API:
|
|
483
483
|
|
|
484
484
|
- `register(name, priority: 10)` — add to the plugin list (lower priority runs earlier).
|
|
485
|
-
- `register_view_type(name, component:, icon:, active_icon:)` — a new index view type. **Pass `component:` as a string** (`"MyPlugin::ViewTypes::TimelineViewTypeComponent"`) to dodge boot load-order issues; the component inherits `Avo::ViewTypes::BaseViewTypeComponent` and must render `paginator_component
|
|
485
|
+
- `register_view_type(name, component:, icon:, active_icon:)` — a new index view type. **Pass `component:` as a string** (`"MyPlugin::ViewTypes::TimelineViewTypeComponent"`) to dodge boot load-order issues; the component inherits `Avo::ViewTypes::BaseViewTypeComponent` and must render `paginator_component` and keep its list inside `<turbo-frame id="<%= list_frame_id %>">`. Name the list's frame with `list_frame_id` (not the `turbo_frame` prop, which is the surrounding frame passed on to the paginator) and the selection data attributes (`data-resource-name`, `data-selected-resources-name`) with `resource_name_for(@resource)`, never `@resource.model_key` (4.3.4+): inside an association panel both use the association field's id, so two panels on one page don't collide. It only gets `collection`, `records` and `pagination` slots where its template calls `render_index_slot`, passing the default markup as the block for replacements. Enabling it on a resource is **avo-index-views** (`self.view_types` / `self.default_view_type`).
|
|
486
486
|
- `register_field(method_name, klass)` — ship a field *type* from a gem (the plugin-author side of **avo-custom-fields**).
|
|
487
487
|
- `register_menu_item(name, &block)` — a custom menu DSL method for `config.main_menu`. Delegates to `avo-menu`; **no-op when avo-menu isn't installed**, so register unconditionally.
|
|
488
488
|
- `register_configuration(name, klass)` — add a `config.<name>` namespace to `Avo::Configuration` backed by an instance of `klass`, so host apps configure the plugin from the same `config/initializers/avo.rb` they already use. **The one call that must not go in `avo_boot`** — see below.
|
|
@@ -520,6 +520,7 @@ Assets from library code go through `Avo.asset_manager` (not the app pipeline);
|
|
|
520
520
|
- **Custom tool vs. resource tool vs. new field.** Standalone page → custom tool. Widget on a record's Show/Edit → resource tool. A new *input type* used across resources → **avo-custom-fields** (not this).
|
|
521
521
|
- **Ejected files are frozen copies — you own them forever.** They stop receiving upstream updates; Avo bug/security fixes won't reach your copy. Prefer [view slots](#view-slots), CSS-variable / Tailwind-layer overrides and `--scope` (so you don't replace a component everywhere) before ejecting whole components.
|
|
522
522
|
- **A slot replacement that skips its default skips the nested hooks too.** Replacing `:header` without `default_content.call` also drops the title and controls and their hooks. Replacing `:collection` the same way drops `records` and `pagination`.
|
|
523
|
+
- **Live search refreshes `collection`, `records` and `pagination` slots, not `toolbar` ones.** Put a summary that must follow the search and page in a collection or records slot. On an empty index core renders the shared empty state with `collection` and `records` hooks only, no `pagination`. Map view's collection hooks wrap only its optional embedded table.
|
|
523
524
|
- **Index slots of a resource also fire on its has-many panels** on a parent's page. Return `nil` when `parent_record` is present if the content only belongs on the main index.
|
|
524
525
|
- **`controls` hooks run twice when `buttons_on_form_footers` is on**, once in the header and once in the footer, so a fixed HTML id can be duplicated.
|
|
525
526
|
- **The toolbar doesn't refresh on live search.** Put a summary that follows the search in a `collection`, `records` or `pagination` hook.
|
|
@@ -536,6 +537,7 @@ Assets from library code go through `Avo.asset_manager` (not the app pipeline);
|
|
|
536
537
|
- **`avo-overrides.css` is served as-is — NOT compiled by Tailwind.** `@apply` and utility classes won't be generated there; it's for raw CSS and CSS-variable overrides. Put Tailwind-using CSS under `app/assets/stylesheets/avo/`.
|
|
537
538
|
- **Tailwind integration silently stays off** unless `tailwindcss-ruby` is present, and — if you pull Tailwind via `tailwindcss-rails` — that gem is **>= 4.0** (on 3.x the integration is disabled even though `tailwindcss-ruby` is there). Symptom: your utility classes don't exist in the admin.
|
|
538
539
|
- **New JS/CSS not loading?** You skipped the asset-pipeline entrypoint. Run `avo:js:install` (or wire `avo.custom.js` manually) — `self.stimulus_controllers` alone loads nothing.
|
|
540
|
+
- **`avo_boot` must not load app classes.** It runs while the app initializes, and naming a controller, component or model there loads Action Controller, Action View or Active Record early (Rails 8.2 flags it). Extend Avo's `lib/` classes (resources, fields, managers) in the hook; extend controllers, components and helpers from `Rails.autoloaders.main.on_load("Avo::BaseController") { |klass, _| klass.prepend ... }`; extend models from `ActiveSupport.on_load(:active_record)`. It also re-runs on each code reload in development.
|
|
539
541
|
- **Plugin registration must be inside `ActiveSupport.on_load(:avo_boot)`** — with one exception: `register_configuration` runs **too late** there and must go in an engine initializer ordered `before: :load_config_initializers`. `register_view_type`'s `component:` should be a **string**, and `register_menu_item` is a no-op without `avo-menu`.
|
|
540
542
|
|
|
541
543
|
## Report
|
|
@@ -233,7 +233,7 @@ Make it the default with `self.default_view_type = :map`.
|
|
|
233
233
|
|
|
234
234
|
Not a view type — a table affordance. Checking the header "Select all" checkbox and confirming "select all matching" lets an action run on **every record the current query matches**, across all pages, not just the visible page. Avo serializes (and encrypts) the whole query — filters, sorting, scopes — and reconstructs it inside the action.
|
|
235
235
|
|
|
236
|
-
It works out of the box on the table view; nothing to enable on the resource. The action itself is where the selection is consumed — cross-link the **avo-actions** skill for writing/handling the action. If serialization fails, Avo silently disables select-all rather than crashing (see the `normalizes` gotcha below).
|
|
236
|
+
It works out of the box on the table view and, from `avo` 4.3.10, on the grid view (a bar above the cards with the page checkbox, "Select all matching" and Undo); nothing to enable on the resource. A resource that sets `self.record_selector` to hide checkboxes renders no bar. The action itself is where the selection is consumed — cross-link the **avo-actions** skill for writing/handling the action. If serialization fails, Avo silently disables select-all rather than crashing (see the `normalizes` gotcha below).
|
|
237
237
|
|
|
238
238
|
**Coming back to the index (4.3.1+):** going Back (browser Back or the record page's **Go back** link) re-checks the rows that were selected and restores scroll. The selection is kept per browser tab and per URL (filters, sort, page), is forgotten after running an action or on reload, and a "Select all matching" choice is not kept. With `config.persistence = { driver: :session }` (4.3.11+) the selection is kept per page rather than per URL and comes back however you reach the index; turn it off with `selection: false`. System specs that expect nothing selected after **Go back** will now find rows checked.
|
|
239
239
|
|
|
@@ -254,7 +254,7 @@ class Avo::Resources::Project < Avo::BaseResource
|
|
|
254
254
|
end
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
`cards` means the resource's dashboard cards, not grid items. Blocks run once per region, not per row: use `row_options` to change rows.
|
|
257
|
+
`cards` means the resource's dashboard cards, not grid items. Collection, records and pagination slots refresh with live search; toolbar, cards and header ones don't. Blocks run once per region, not per row: use `row_options` to change rows.
|
|
258
258
|
|
|
259
259
|
The **avo-custom-ui** skill's **View slots** section has the full reference, Show/Edit/New, block context and gotchas.
|
|
260
260
|
|
|
@@ -66,7 +66,7 @@ grep -n "avo" Gemfile
|
|
|
66
66
|
bin/rails avo:update # or: bundle exec rails avo:update
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
The task resolves Avo core plus every registered Avo plugin to its real gem name and runs `bundle update --conservative <those gems>` — `--conservative` so it doesn't drag unrelated shared dependencies along. Read its output: it echoes the exact `bundle update` command it ran.
|
|
69
|
+
The task resolves Avo core plus every registered Avo plugin to its real gem name and runs `bundle update --conservative <those gems>` — `--conservative` so it doesn't drag unrelated shared dependencies along. Read its output: it echoes the exact `bundle update` command it ran. From `avo` 4.3.10, `AVO_UPDATE_PUSH=1 bin/rails avo:update` also commits `Gemfile.lock` (message `Update Avo gems`) and pushes to the branch's upstream, for scheduled jobs and agents. It refuses to start outside a Git repo, with uncommitted changes to tracked files, or on a branch with no upstream; run it on a branch you're happy to push to, not the deploy branch.
|
|
70
70
|
|
|
71
71
|
If the task isn't available (older Avo, or the app won't boot), fall back to naming the gems yourself:
|
|
72
72
|
|
|
@@ -147,7 +147,7 @@ Check the project's own instructions for how — in this order: `AGENTS.md`, `CL
|
|
|
147
147
|
| Command | Does |
|
|
148
148
|
| --- | --- |
|
|
149
149
|
| `grep -E "^ {4}avo(-[a-z_]+)? \(" Gemfile.lock` | Current version of every Avo gem — run **before** updating |
|
|
150
|
-
| `bin/rails avo:update` | `bundle update --conservative` across Avo core + every registered plugin |
|
|
150
|
+
| `bin/rails avo:update` | `bundle update --conservative` across Avo core + every registered plugin (`AVO_UPDATE_PUSH=1` also commits and pushes the lockfile) |
|
|
151
151
|
| `git diff Gemfile.lock \| grep -E "^[-+] {4}avo"` | The actual before → after jump per gem |
|
|
152
152
|
| `bundle update --conservative avo …` | Manual fallback when the rake task isn't available |
|
|
153
153
|
| `bundle outdated \| grep avo` | What's available above the current Gemfile constraints |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repo": "avo-hq/docs.avohq.io",
|
|
3
3
|
"docs_path": "docs/4.0",
|
|
4
|
-
"commit": "
|
|
5
|
-
"date": "2026-11-
|
|
4
|
+
"commit": "c54913692157757c342802a3b9e1d5f167798624",
|
|
5
|
+
"date": "2026-11-09",
|
|
6
6
|
"note": "The docs commit these skills were last indexed from. Run ruby lib/avo/skills/bin/docs_drift.rb to see what changed since, and --update after a refresh."
|
|
7
7
|
}
|
data/lib/avo/version.rb
CHANGED