mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
develop
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bf4179d759 |
feat(database): plugin hooks for button field action list (#6174)
Lets a plugin add components next to each action type in the dropdown and next to the Actions heading, so SaaS can show what an action costs. |
||
|
|
9b4fbdff7e |
fix: button field follow-ups from the #6086 review (#6135)
* fix: keep a button action card open when its save finishes A created action is keyed by its new id once the list is refetched, which closed the card while the context was still on screen. * fix: give the button action error a line height * fix: outline the selected button field cell * fix: name the button actions that ran before one failed Completed actions are not rolled back, and the old message left the clicker to assume nothing had happened. * fix: disable a button field for users who may not click it The dispatch operation is now scoped to the field, which is the only id a cell has to ask with. Roles attach no lower than the table, so one check on the field answers the same as one per action. * fix: refetch permissions when a field is created or restored A role on the table or database lists the fields it covers, so a field added after the page loaded was refused by every field scoped check until a reload. * test: cover the disabled button in the row modal and on a card * fix: keep a button action card in place while its save finishes The refetched list keyed a created or retyped action by its new id, so its card remounted and the editor scrolled to the top mid-save. |
||
|
|
6c1e3e45e8 |
feat(database): Button field: record who started a workflow run (#6068)
* feat: record who triggered an automation workflow run * feat: name the clicker on a workflow a button started * feat: carry the trigger user on the automation dispatch context * feat: expose who triggered a run on the workflow history API * feat: audit log a button field click * feat: show who started a run in the workflow history * docs: say a periodic trigger can be started and how a click is recorded * fix: give the history actor label room for a full name * fix: keep the trigger user off the dispatch context actor A Local Baserow node with no integration acts as the context actor, so a run would act as whoever clicked. * fix: audit a click only once it holds the lock * feat: record who started a test run * fix: honour is_test_run in the workflow history fixture * refactor: resolve who started a run through the workspace user store * test: drop a start workflow test whose deny patch never fires * test: e2e for who started a workflow a button or a test run began * test: e2e for picking a workflow in the button field editor * refactor: read the trigger user lazily from the run's history No per-node user join; the context exposes history.triggered_by on demand. * refactor: plain serializer for who triggered a run * test: forward history fixture kwargs and hoist imports * fix: put the run's starter on its own line in the history panel The header row is 327px wide; a name beside the title wrapped it. Name resolution reuses the collaborator mixin. * docs: say exactly when a click is audited and what a nested run records * test: share e2e job polling and AI panel suppression * fix: annotate the automation dispatch context's history as a workflow history * fix: cap the button action form so a helper sentence cannot stretch the editor * fix: keep the automation dispatch context's history required The simulation's history=None is a sample-data-only exception, not the norm. * refactor: carry the dispatch context actor through own_properties Contexts that take an actor list it like any other property; the rest keep the base None. * refactor: record who started a workflow run as a subject Stores id, type and name instead of a user foreign key, so an agent can start a run without a data migration and the name survives the user being deleted. * fix: record who started a test run that waits for its event The starter is kept on the workflow with the other test state, so the event that starts the run later can still name them. * fix: forget a test run's starter when its window closes Opening or closing the test run window through a workflow update left the earlier starter in place, so a later run could name the wrong person. * fix: keep a test run's starter when undo restores an unchanged window Undo and redo send every workflow field back, so only a real change to the test run window may replace who started it. * fix: reset a test run's starter type along with its id * fix: return None from get_subject for subject types without a table anonymous, user_source.user and builder_preview_actor have no manager, so the lookup raised AttributeError. * refactor: resolve collaborator names through a core util The history panel called a mixin method without its component, which only worked while the method ignored this. * refactor: name the history's started-by line after what it shows * docs: note that a button with no actions logs no click * refactor: drop the unused triggered_by from the automation dispatch context Left over from when the clicker was the context's actor; the history already records who started the run. |
||
|
|
886925500f |
feat[4a/6] Button field: send an HTTP request (#5968)
* feat: let a button field send an HTTP request A button can now call an endpoint when it is clicked, and the actions after it can read what came back. The request runs as part of the click, in the order the actions are listed, and a failure stops the ones behind it without rolling back what already ran. What an endpoint answers with has no shape until it has answered once, so a click by someone who may configure the field remembers the response and the editor builds the data explorer from it. Only a successful answer is kept, it is capped in size, and it never travels in an export, a snapshot or a duplicate. Because a click now makes this installation send a request, it is rate limited per user and per workspace, and only clicks that reach outside count. The address guard that stops a request reaching Baserow's own network applies here too, and a failure is reported by position without naming the URL it could not reach. * feat: say what a button's request has answered, and what it has not The data explorer only offers an HTTP action's body once a click has answered, and until then nothing said why. The action's form now carries the same block the builder uses: what the last click remembered, or a note explaining that a click is what captures it. The note also says the button's other actions run on that click, which a preview elsewhere in Baserow has no reason to warn about. * fix: stop a refused click from spending the budget, and sharpen what it is told A click refused by a permission check kept the slots it reserved, so a member who may not dispatch could spend the whole workspace's budget on refusals and lock out the members who may. The lock is now sized from what the click may wait for. The setting was a fixed two minutes while a button can chain requests that are each allowed to wait that long on their own, so the lock expired mid sequence on exactly the buttons it was there to protect. An external failure no longer hides a message about the values the action was given, such as a body that is not JSON. Only a message naming the address is withheld, since that is the part written for whoever configured the button rather than whoever clicked it. A result is returned to the browser only when a client action can read it. An answer from outside Baserow carries whatever the endpoint sent back, response headers included, and a clicker with nothing to run has no use for it. Also gives the remembered answer its own savepoint, so a value the column refuses cannot leave an enclosing transaction unusable, logs why it was refused, declares the 429 the endpoint can now return, and matches a duplicated field by the name the job gives it. * fix: charge a click for what it really sent, and stop leaking what it was told Answers the review on the button field's external actions. A click now takes one rate limit slot per action that reaches outside Baserow, rather than one per click, and gives back whatever it did not spend. The action list is read once and used for the budget, the permission checks and the run, so the three cannot disagree. A failure that names an address no longer reaches the log with the URL and request headers attached, only the ids and the exception class. A result the browser has no client action to hand it to is not sent at all. The classification is now a list of the failures that can name an address, so everything else keeps its own message and a malformed body says so. An HTTP response is read in chunks against a ceiling instead of being buffered whole, so an endpoint cannot decide how much memory a worker spends. A captured answer is dropped when a request-shaping value changes, and is not rewritten when it has not changed. A nested service type that disagrees with the action is refused rather than silently dropped. In the editor, the payload viewer shows what the explorer's paths name, a newly added request already offers its status code, raw body and headers, and reopening a field re-reads what a click captured. Docs get the four button field variables, the corrected lock TTL, and an ADR section that says secrets reach an export with external actions rather than external integrations. Claude-Session: https://claude.ai/code/session_01EwBqQJNK8seaAC5j8ppjF4 * fix: leave a button's API key out of an export An HTTP request action has no integration, so its key lives in the service's own headers and query parameters. Both were exported in clear text, and travelled wherever the export went: snapshots, workspace exports, templates. `CoreHTTPRequestServiceType` now names them sensitive, and the export config reaches them. `FieldType.export_serialized` takes it, the application export passes it, and the button field hands it to its actions, which blank whatever the backing service calls sensitive. The paths that stay inside the installation, duplicating a field and restoring a snapshot, pass no config and keep the key, so a copy still works. Which header holds the key is not knowable, so the whole list goes rather than a guess at the secret one, and the import reads a stripped list as none of them. Claude-Session: https://claude.ai/code/session_01EwBqQJNK8seaAC5j8ppjF4 * test: guard the editor's explorer without leaving the page Every other test here navigates or reloads between building a button and reading what it captured, which fetches from the backend again and hides what the editor was holding. This one stays on one page: it adds an HTTP action and a dependent action through the editor, checks the later one is already offered the status code and raw body before either has been saved, then saves, clicks, and reopens the field to find the answer the click just got. Without the baseline schema the request has no node at all until the field is saved and reopened. Without the re-read on reopen the captured body stays missing until the page is reloaded. * fix: hang up on a response that never stops arriving Requests treats a scalar timeout as inactivity, so it starts again on every byte. A server sending one every few seconds held the connection open for as long as it liked, and the click outlived the lock sized to `2 x sum(timeouts)`. Once Redis expired that lock a second click could start and repeat actions that are not reversible, which is the case the lock exists for. The body is now read against a wall-clock deadline as well as the size ceiling, both inside the streaming loop, and a deadline reached is reported the same way as any other timeout. The connect and header phases still use Requests' own inactivity timeout. Closing those needs a renewable lock, which is left as a follow-up. * feat: say why a click captured nothing A click that answered 404, timed out, or came back larger than the sample data ceiling captured nothing and said so nowhere. The note asking for a click stayed exactly as it was, so there was no way to tell the click had already happened. The action type now says why a result describes no shape rather than only that it does not, and the reason is stored under the `_error` sentinel the builder and automation already use. The editor shows it in place of the note, through the viewer's existing error state. Only written when there is nothing to lose: a shape an earlier click learned outlives an explanation of the latest one, and every action pointing at that shape would break with it. The reason names the status code but never the address, which is for whoever configured the button rather than whoever clicked it. `generate_schema` now skips a stored failure. It is truthy, so the body would otherwise come back as an empty object rather than being left out. * fix: close the holes a review found in the button field's external actions Seven of these are regressions from the earlier review fixes on this branch. An external action no longer logs its own exception, whatever type it is. The previous rule keyed on the failure, but loguru prints the frame locals beside the traceback and the frame that resolved the formulas holds the URL and every resolved header, so a malformed body or an oversized answer still wrote the key to the log. A click no longer asks for more rate limit slots than the limit could ever hold. Slots are taken one at a time, so a button carrying more requests than the budget was refused the slot past the limit and could never be clicked at all, however long anybody waited. Past that point the limit is back to counting clicks. A click is charged only for requests that were really sent. The callback fired before the formulas were resolved, so a header naming a deleted field, or a body that is not valid JSON, spent the budget without reaching anything. Reading the response no longer skips its ceiling when the ceiling is switched off. It returned before consuming the body, so a truncated or corrupt answer surfaced later as a 500 rather than a handled failure, and the drip deadline was never armed. An export keeps the keys of what it strips and blanks only the values, so an imported button says what has to be entered again instead of quietly sending a request without its `Content-Type`. Form data and the body are stripped too, not only headers and query params. The AI formula prompt no longer sends a button's headers to the provider. It serialized every field with no export config, and reading a formula field needs far less permission than configuring a button does. The editor's re-read on reopen takes only what a click captured, matched by id, so an unsaved action edit survives it. Also: loguru ignores `exc_info`, so two handlers were swallowing their tracebacks; the sample data cap measured escaped JSON, which refused a Japanese answer at half the documented size; the unchanged-answer check compared whole values, and `Date` alone moves every second, so nearly every click rewrote the blob it was meant to skip; and an e2e test found the duplicated field by an index that a new column had shifted. * fix: charge, log and explain a click the way the last review asked Four follow-ups from the review of the external actions. A button carrying more requests than a rate limit could ever hold is now refused rather than reserved for what fits: capping the reservation still sent every request, so the limit was paying for a burst of any size. An address Advocate refuses is told apart from a connection that failed, so a click that never sent anything gives its slot back. The HTTP service no longer logs its own unknown failures with the traceback. The frame holds the URL, the resolved headers and the body, and so does the one that could not keep an answer, so both log the class of the failure and the ids only. A reason left by an earlier failed click is replaced by the next one: a 404 followed by a timeout kept describing the 404. A shape an earlier click learned is still never overwritten. The e2e concurrency test waits for the first request to finish before closing the competing context. |
||
|
|
821a3d4991 |
feat[3/6]: Chain a button action's result into the ones after it (#1722) (#5951)
* feat: chain a button action's result into the actions after it
A click runs its whole sequence in one request, so each action's result is
kept on the dispatch context and read back by a new `previous_action` data
provider. The builder needs a cache keyed by a dispatch id because its
browser dispatches one action at a time, and automation reads results from
workflow history; neither applies here.
The store lives in the context's cache rather than on the context itself.
`clone()` rebuilds the context through `__init__` and only copies the cache
dict, so a plain attribute would give every clone its own empty one.
`start_action` deliberately leaves it alone: the row is re-read per action,
results are what the rest of the sequence chains from.
* feat: remap a previous action reference on import
A chained reference names an action by id, so duplicating a field, a table or
an application has to point it at the imported copy. The action id is remapped
through the import mapping and the rest of the path handed to that action's
service, the way the builder and automation already do.
A reference to an action outside the import is left as it is rather than
raising, so a partial import stays loadable.
* feat: reference an earlier action's result from the button editor
The data explorer offers an action what the actions before it return, and
`open_url` can build a URL from one. An action is only ever offered what
precedes it in the list, so a reference always points backwards.
An action that has never been saved carries no service schema, so its output
is derived from the target table's fields, which the action forms now report
up to the sub-form. It is referenced by its client id until the save, and the
creates go out in list order rewriting those ids to the real ones as they are
handed out, so no client id ever reaches the API.
A dispatch result is keyed by field name, and the browser has no way to map a
`field_<id>` onto a table that is not the clicked row's, so each result now
carries the names of the fields it returned.
* fix: let a button's URL reference an earlier action
The form names its own data providers, which overrides what the sub-form
injects, so the URL field never offered `previous_action` and the chained
URL could not be configured at all. The unit tests covered the provider and
the click path but never the form, which is what let it through.
Naming the fields of a result costs a table model per action, so it is only
done when there is a client action to read them.
* feat: mark a button action the click would fail on
Chaining multiplies the ways a configuration can be wrong, and until now
nothing said so until the button was clicked. An action with no table, a URL
action with no URL, and one referencing an action that no longer runs before
it are each marked, with a warning on the list.
A stale reference is marked rather than cleared, following ADR 006 section 8:
moving the action back makes it valid again, and clearing would throw away a
formula the user wrote.
It stays a warning rather than a validation gate, since a half configured
action is a normal state while editing and the field already saves either way.
* chore: drop the button field's url_formula column
Phase 2e stopped reading and writing it and backfilled every value into an
`open_url` action. Nothing has read the attribute since, so the column goes.
Safe to drop now rather than a release later: no released version has it.
2.3.3 carries no button field at all, and phases 1 to 3 go out together, so
there is no older process still writing the column during a rolling deploy.
The backfill helper stays where it is, since migration 0216 imports it and
has to keep running from scratch. Its test goes: it wrote to the column with
raw SQL, which there is now no column for.
* docs: record the phase 3 decisions in ADR 006
Section 2 gains why the frontend-last execution split is safe under chaining:
the explorer is scoped by list position, so an action can only ever name one
that has already run.
Section 4 gains where results live and why it differs from the other two
modules, and the field name mapping the response carries for a frontend-only
action that references a table it has no fields for.
Section 2's url_formula paragraph now says the column is gone rather than
pending, with the reason it could go a release early.
* test: cover context chaining end to end
Nine cases on the existing button field suite, chosen for spanning something
no unit test reaches: a URL built from a row a server action just created, the
data explorer through the whole provide chain, two brand new actions chained
in one save, a saved action pointed at one created beside it, a forward
reference marked and healed, and a failing action refusing to navigate.
Two backend cases go with them, both from shapes the suite seeds: a reference
to an action whose service has no table, and one pointing forwards.
Dragging an action is verified rather than assumed. How far the pointer has to
travel depends on how tall the target's form is, so the helper drops once,
checks the order really changed, and tries a different landing point if not.
The derived schema now names the row id "Id" like the backend's does, instead
of "Row ID", so the node stops renaming itself the first time an action is
saved.
* test: cover a three deep chain and a duplicated one
The third action reads the first, skipping the one between, which an
off-by-one in the position scoping still satisfies with only two actions.
The duplication test gains the chained case rather than duplicating this wide
table a second time: the copy's URL action has to name the copy's create row
action, and the copy has to still be clickable, which remapping alone does not
prove.
The test that saves a built chain gets a button field of its own, so it no
longer shares one with the test that builds a chain and throws it away.
* test: match a table name whole when picking one
"Tickets" also matched the "Tickets 2" that the duplication test leaves behind,
so the dropdown resolved to two items and Playwright refused to click either.
It only showed up in a full run, since duplication happens earlier in the file
than the test that picks a table.
* test: a write only field is not offered out of a created row
The derived schema filters them, but nothing asserted it. Verified alongside
the dispatch result masking a password to a boolean rather than the hash,
which is what the decision to document rather than rebuild the exposure
machinery rests on.
* fix: fail a chained read of a field that no longer exists
Reading a deleted field resolved to nothing and the click carried on, writing
a blank over whatever the target row held. The provider raised when the
referenced action was missing but not when the field was, so the two halves
disagreed, and the row provider already raises in the same situation.
A key absent from the result means the field is gone and now raises. A key
present holding null is a legitimately empty cell and still resolves to null.
Reading any path out of an action that produced no row at all, a delete for
instance, raises for the same reason.
Found working through the phase 3 verification checklist, item R12.
* test: cover explorer scoping for reorder, deletion and open_url
Four cases the desktop browser cannot show, because the field editor's popup
runs past the bottom of the viewport whatever the window size: the third action
seeing the first two, reordering changing what each is offered with no save,
a deleted middle action leaving the tree, and a URL action between two others
contributing nothing.
* test: cover reordering unsaved actions, and drain rows between tests
An action added, pointed at another added beside it, then dragged in front of
both, so the creates go out in an order the list no longer matches. The saved
formula has to name the middle action rather than the one dragged past it.
`resetRows` deleted a single page. `listRows` caps at 200, so once the shared
table grew past that, resets left a backlog and later lookups returned old rows
instead of the ones a test had just created. It drains in pages now. That is
what the intermittent failures in the chained tests were, not contention.
The viewport widens again for the two fields this adds; the grid renders only
the columns that fit, so a column past the edge never appears at all.
* fix: keep a button's buffered actions when a reference cannot be resolved
An unresolved reference threw a bare error. `notifyIf` presents an error only
when it carries a handler and rethrows anything else, so the throw escaped
before the caller could flag the failure. The editor then closed and reset,
discarding every buffered action edit, with no toast to say why. The guard that
exists to keep those edits on screen never ran.
The error now carries a handler that raises a toast, so a save that cannot
resolve a reference fails the way any other failed save does and the user keeps
what they were editing.
Adopting the ids handed out before a failure now rewrites the references to
them as well. Without that a retry met a client id whose action was no longer
being created, so nothing mapped it and the save could never succeed.
* fix: refuse a broken chained reference in the browser too
The backend raises for a reference to an action that did not run or a field
missing from its result. The browser resolved the same reference to nothing,
and a URL built from it opened with a hole in it, which is the failure this
phase exists to avoid. It now refuses them the way the backend does, so the
click reports an unusable URL instead of navigating.
Only a real click carries results. The editor resolves formulas for its own
preview before anything has run, so that path still resolves to nothing.
Naming a result's fields is skipped for an action that returned no row, a
delete for instance. It cost a table model per click to build a mapping the
browser could never resolve anything against.
* fix: describe the table an action points at now, not the one it was saved with
The editor buffers a table change without clearing the schema the API returned,
so the explorer kept offering the previous table's fields. Picking one wrote a
field reference that no longer existed anywhere, and the click then failed. The
fetched fields describe the table selected right now, so they win; the saved
schema is only a fallback for an action whose form has not fetched anything.
A reference was matched anywhere the words appeared, string literals included,
so a URL ending `/docs/previous_action.html` captured `html`, failed the check
that a reference resolves to a number, and left the field impossible to save
behind a toast about an action order that was never the problem. A path opens
straight after its quote, so requiring one keeps the match off ordinary text.
The list-returning branch of the provider indexed into its result before
checking it was one. No action type reaches it yet, and the guard is a line.
* refactor: type an unsaved action's fields, and match the base argument order
Every field of an action that had never been saved was typed as a string, so a
file or link row field showed as a leaf with nothing under it and then changed
shape the moment the real schema arrived. Only the types that decide whether a
node can have children are worth deriving, and they are taken from a schema the
backend generated rather than guessed: a number field really is a string there,
because the API returns it as one.
`getDataSchema` took its arguments the other way round from the base class and
from the builder's types. It has one caller, so nothing was wrong today, but
anything reaching for it through the base signature would have read a schema
off the wrong object and quietly returned nothing.
* fix: mark a reference to an action that no longer returns a result
Changing an earlier action to Open URL or Delete row kept its id and its
place, so nothing warned, yet the dispatch fails the whole click on a
read of it.
* fix: fail a previous action read outside a click, rather than crash
Both database providers share a registry, so an AI prompt formula could
reach this one through a context that carries no cache.
* perf: name a table's fields once per click
Every dispatched action rebuilt the table model to name the same fields,
which on a wide table is the expensive part of the response.
* fix: only offer a client action what really ran before it
Client actions run last whatever their place, so the response carried
every server result and the browser resolved references the dispatch
would have refused. The result now says where its action sat.
* perf: check each action's configuration once per render
Every rendered row asked for its error twice, and the warning banner once
more per action, each walking the whole config.
* test: say so when rows cannot be drained between tests
Falling through at the pass cap left behind the very rows the loop
exists to remove, so a suite failed later on a stale lookup.
* feat: collapse a button field's actions, one card at a time
The list showed every action's form at once, so a button with three of them
did not fit the editor and the data explorer opened over the list rather
than under the input it belongs to. Cards now open one at a time, the way
the builder's event list does.
The form is hidden rather than unmounted: it registers into this form's
chain and emits its defaults on mount, so tearing it down on collapse would
change what a save sends. A misconfigured action's message stays outside the
collapsible part, so it can be found without opening every card.
* fix: read an action reference only where a formula asks for one
A quoted literal that begins with the same word, such as the second argument
of concat('https://example.com/', 'previous_action.tmp.id'), was counted as a
reference to an action named tmp, which has no id and so blocked the save.
The pattern now anchors on the get( the reference must sit inside.
The walk also no longer descends into schema, context_data and
context_data_schema. Those formulas describe the selected table rather than
anything the user typed.
* fix: hold back a new action's error until the form is touched
An action is invalid the moment its type is picked, since it is configured
afterwards, so the warning appeared while the user was still filling it in.
The rest of the form only reports errors once touched, and this now follows:
Save, Create, or adding another action reveals them.
What the editor loaded is marked on sight, because an error there describes
config that is already saved.
* fix: keep a field's editor open when its actions fail to save
The field is created before its workflow actions can be, so a failure there left a field behind and closed the editor on the configuration. The editor now stays open on the edits and a retry saves them against the field that was made.
* test: cover retrying a new field whose actions failed to save
* fix: refuse a previous action reference that names no action
get('previous_action') has nothing to read. The API now rejects it while validating the formula, and the provider fails as a formula error rather than crashing on an empty path, so one saved earlier reports a dispatch failure instead of a 500.
* fix: fail a reference to a field the previous action no longer has
A path names a field as field_<id>, and the service turns that into the field's name. A field the reference outlived is left as it is, so a field named literally field_<id> answered for it and the click wrote the wrong value.
* test: cover a click that references a field the chain no longer has
* fix: tell two actions sharing an order apart by where they ran
Concurrent creates can hand two actions the same order, which execution then breaks by id. A client action compared orders to decide which results it may read, so it dropped one it was entitled to. The dispatch now returns the position each action ran at, on both the results and the client actions.
* docs: describe an action's dispatch position in the API schema
* fix: stop a click's client actions once one could not run
Open URL reported an unusable URL with a toast and returned, so the action after it still ran and could navigate away, taking the message with it. It now says whether it ran, and the loop stops when it did not.
* fix: open the card that is blocking a save, and reach it by keyboard
A collapsed action blocked the save with nothing on screen, since an invalid formula renders no error element to scroll to. Submitting now opens the first card whose form refuses what it holds. The collapse control and the drag handle also take focus, and the handle reorders with the arrow keys, which was mouse only.
* test: name a provider that really is unknown, and cover the url_formula upgrade
The duplication test used previous_action, which this branch registers, so duplication remapped the id and the test failed on its own. It now names a provider nothing registers. The helper level migration tests are replaced by one that runs 0215 to 0217 and proves every url_formula shape becomes an Open URL action before the column is dropped.
* test: expect the open url action to report that it did not run
* test: cover the lazy warning for a newly chosen row action
* test: cover a chained reference through a mapping and through a first save
A field mapping's value is a formula the service does not remap itself, and a reference between two never saved actions is rewritten from the ids the server hands out. Both were only covered end to end.
* perf: stop every formula input rebuilding its explorer on each keystroke
The action form copied the context it was given, which read the parent's getters and made the actions list a dependency of the provided object, so the object changed identity on every edit. It now delegates to the parent instead. The function nodes, which come from the registry rather than from anything being edited, are also built once per input rather than on every rebuild.
* fix: describe a composite field down to its children in the explorer
* refactor: drop a field name cache the table model already provides
* refactor: let the service type name its own missing table
* fix: fail a click that reads a result no action was recorded for
* fix: wrap an action's error instead of cutting the sentence short
* fix: point an imported path's tail at the action its head was remapped to
The remapped id was written straight over action_id, so when the lookup that
follows found no such action the path came back naming the imported copy with
the field id of the original. That field does not exist in the copy, and every
click on it failed.
* fix: report the field a retry patched, not the one it started from
A successful retry hid the editor without clearing createdField, so onHidden
ran as though the retry had been abandoned: it reset the form a second time
and handed the parent the copy taken when the field was first made, before the
retry patched its name, label and type.
* fix: keep two actions the server forgot from sharing one id
An action deleted by someone else is created again, and came from the server
with no client id. Both were keyed by that same undefined, so the second
create overwrote the first and every clientId-less action then adopted the one
id left, which the next save reconciled as two updates to one action.
* fix: forget a table whose fields could not be fetched
A failed fetch left the table unregistered, so the explorer fell back to the
schema of the last save, which describes whichever table the action pointed at
before. It went on offering those fields for as long as the fetch kept
failing, and a formula built from one fails the click.
* perf: read an action's references without copying it
Checking a reference ran the action through _.omit, which copies what it keeps
all the way down, so every keystroke cloned the saved schema of every action on
the field. The walk only reads, so it now visits the same keys where they are.
* test: cover a re-run of the url_formula move, and a reversed empty one
Two cases the helper level tests had were lost when they were replaced. The
column stores its keys in either order depending on whether it was written
from a string or a dict, and a re-applied migration must not stack a second
action on a field it already moved.
* fix: let a service that cannot name its fields answer for its own path
Only a table service defines get_table_field_objects. Any other kind reaching
this check raised an AttributeError, which is not a formula error, so the click
would have 500ed rather than reporting itself. Guarded the way the sibling that
makes the same call already is.
* docs: say that a dispatch position can be absent
Both sides of the response take their position from a dict that is empty when
the click ran no sequence, so both can be null. The schema promised an integer,
and a generated client reads null as a type error.
* fix: raise for any segment a previous action's result does not carry
The frontend provider only raised for a `field_` segment, so any other one
resolved to nothing, left a hole in the URL and opened it anyway. The backend
raises for whatever the result does not carry, and the explorer shows field
names, so a formula naming one was easy to write and silently wrong.
* fix: refuse a composite value in an open url formula
A previous action's result comes back raw, so a single select, link row or file
resolved to an object. `concat` turned it into JSON, and the URL parser read the
result as a relative path, so the click opened a URL built out of a field's
internal shape.
* test: cover a path that reaches inside a composite value
Only the leaf reaches the URL, so a deeper path is not itself a composite and
must keep resolving.
* fix: stop a cancelled edit hiding a saved action's error
The list stays mounted between opens and its pristine flag is keyed by a saved
action's id, so retyping an action and then cancelling brought it back as it was
stored with its own error still suppressed.
* fix: mark a table whose fields could not be fetched
Registering an empty list said two other things by accident: that the table has
no fields, and that whatever another action had fetched for the same table was
gone. A marker keeps those apart, and a failed fetch no longer overwrites a list
that arrived fine.
* fix: read a previous action reference from the parse tree
A regex cannot tell a reference from a string that reads like one, and it only
matched a lowercase get. An uppercase GET was a working reference the editor
never saw, so a stale one went unmarked and a client id reached the API. The
tree says which get() calls are real, and the ids are spliced by offset so the
rest of the formula is untouched.
An unparseable formula falls back to the regex for the save guard only, which
errs towards refusing the save rather than letting a client id through.
* fix: finish a retried field creation the way the first attempt would
Three things the retry path did differently from the create it continues. The
patch went out under no undo group, so undoing the create trashed the field and
left the patch nothing to undo. The field was committed straight away instead of
through a callback, so the parent never refreshed its rows, which shows when the
retry also changes the type. And dismissing the popup mid save reported the
field a second time.
* fix: address review findings on the button field editor
A close that lands while a save is running is now held and reported once
the save settles. Before, `@hidden` was dropped and never fired again, so
a failed save left the field with no owner and the context still holding
it: the next create patched that field instead of making a new one.
An action the server has forgotten keeps the id it had while it is created
again, so the actions naming it follow it to its new id rather than
pointing at nothing. The card the user has open follows the same way, so a
save that stops part way no longer closes it.
The previous action provider now refuses a write-only field the way the
row provider does, and says a context runs no sequence rather than
reporting the reference as one that has not run yet.
|
||
|
|
c9ff0923da |
refactor(frontend): move database stylesheets into their own module tree (#5939)
The button field's two stylesheets sat in modules/core/assets/scss/components even though they are database specific, because the OSS frontend had no per-module scss tree. Premium and enterprise already have one, so this adopts that layout for modules/database rather than inventing something new. Unlike premium and enterprise, which replace nuxt.options.css[0] with a default.scss that imports core's wholesale, the database module adds its own entry. Its default.scss therefore imports only the core layers that emit no CSS, so core's stylesheet is not emitted twice. Follow-up from #5934. |