33 Commits
Author SHA1 Message Date
Jonathan Adeline 38ccc54c2e chore: update Iconoir to 7.12.2 (#7012)
* chore(deps): update Iconoir to 7.12.2

* test: update grid visibility selector for Iconoir 7

* fix: restore open and slashed eye icons

* docs: document Iconoir 7 plugin changes
2026-12-04 15:36:56 +04:00
Tsering Paljor 674e4b12a8 feat: Add markdown support to more Builder elements (#6124)
* WIP

* Remove formula conversion related changes

* Move the file input click guard to formatted text component

* Move format types into their own components

* Use a shared markdown-it instance

* Move the formatter into data explorer

* Move minification logic into BaserowFormulaMinified

* Renderer should own the root element

* Ensure long choice names are truncated

* Ensure line height doesn't grow for paragraphs

* Add tests

* Add changelog

* Add specific tests for choice element
2026-10-09 09:36:32 +04:00
Tsering Paljor e995e8f937 feat: Show multiple formula expression examples (#5981)
* Added support for multiple examples in formula expression help tooltip.

* Show an icon to indicate that an example can be inserted.
2026-09-10 13:28:40 +04:00
alamin-br 3b2ab433bf feat[1/6]: Add button field type with URL button behind feature flag (#1722) (#5767)
* refactor: move formula field-reference visitors from premium to core

* feat: add ButtonField model and fixture (#1722)

* feat: add read-only button field type backend (#1722)

* feat: resolve database formulas client-side for the button field (#1722)

* feat: add button field type frontend (#1722)

* chore: add changelog entry for button field (#1722)

* fix: disable button field cells when the url formula is broken (#1722)

* fix: encode whitespace in resolved button field urls (#1722)

* fix: rename button field visitor tests to avoid pytest module collision

* test: add button field to expected premium export outputs

* test: add button field to remaining interesting-table test expectations

Registering the button field in construct_all_possible_field_kwargs
changed the interesting test table used by several golden-output
tests. Update the affected expectations (serialized row value, CSV
export column, and generated schema entry) to match actual behavior.

* feat: put the button field behind the button-field feature flag

* fix: address button field review nits

* fix: renumber button field migration after develop merge

* docs: describe the button field as an action field in API docs

* fix: handle raw formulas and missing field references in button fields

* fix(review): remap binary-op field refs, cache parse trees, extend button field tests

- visit both operands in BaserowFormulaReplaceFieldReferences.visitBinaryOp so
  get() references inside binary expressions are remapped on import/duplication
- cache client-side formula parse trees so large grids do not re-parse the same
  button formula for every row
- add tests for the urlInvalid submission block, the field-store fallback in
  functional grid cells, and duplication with broken field references

* fix: keep button field type registered when the feature flag is off

Gating registration behind the flag meant that disabling it after button
fields existed made every registry lookup for those fields raise, breaking
all row, field and export endpoints for the affected tables.

The type is now always registered on both backend and frontend, matching
how other gated field types work. Creating a button field (or converting
a field to one) is rejected with ERROR_FEATURE_DISABLED while the flag is
off, and the field type dropdown hides the type entirely via the new
isVisibleInDropdown hook. Existing button fields keep rendering and their
tables keep working.

* fix: keep brackets when remapping field references in formulas

* fix: keep the button url formula mode when remapping field references

Assigning the remapped formula string to `url_formula` made the patched
`save()` re-wrap it through `to_python` as `simple` mode, undoing the
raw-mode guard in `replace_field_id_references`. A raw literal URL then
became an unparseable formula, so duplicating a table left the button
broken. Assign the whole formula object so mode and version survive.

* fix(review): share the formula field id cache and cover the flag-off cases

Move `get_table_field_ids` and its `table_schema_changed` invalidation into
core next to the visitors, so validating a button field's url formula no
longer costs a query per field on every field response. The AI prompt
validation now reads the same cache instead of its own copy.

Also list the edited field's own type in the field form dropdown even when
hidden, otherwise an existing button field renders with a blank type once
the feature flag is turned back off, and drop the always-null cell backup
on type conversion.

* chore(review): tidy the button field export branch and flag docs spacing

* test: cover the formula parse tree cache

The cache is shared by every resolveFormula caller, including the builder,
so record what it guarantees: one parse per distinct formula, raw formulas
never parsed, failures not cached, and oldest-first eviction at the cap.
Also state the read-only invariant the reuse depends on.

* fix: guard and cache the formula field reference helpers (#1722)

`get()` and `get('fields')` both parse and both pass the create API, so
remapping them raised an uncaught IndexError that aborted the whole
duplication or import job. Guard every index instead.

`extract_field_id_dependencies` also parsed raw formulas, unlike its two
sibling helpers, and re-parsed on every call. It now short-circuits raw
mode and caches the extracted ids per formula string.

* fix: keep the AI prompt's mode when remapping field references (#1722)

Moving the reference visitors to core added a raw short-circuit that
returns a bare string. `AIFieldType.after_import_serialized` re-saved
that string, so `to_python` re-wrapped a raw natural language prompt as
`simple` mode and every row's generation then failed on parsing the
prose.

Assign the whole formula object instead, the same way the button field
already does, and cover a raw prompt surviving an export/import.

* feat: add the encode_uri and encode_uri_component formula functions (#1722)

A button field's URL is built by concatenating row values, so a value
holding a reserved character corrupts it: `shoes#7` truncates to a
fragment and `a&b=1` injects a parameter. Encoding every value
automatically is not an option, because a value can legitimately be the
whole URL.

These mirror the two functions that already exist in the database
formula language and let a formula escape the parts that need it. The
backend and the browser encode identically, since button URLs resolve
client-side and everything else resolves on the server.

* fix: address review on the button field backend (#1722)

The field no longer creates a database column. It held nothing but an
always-null boolean, and that boolean leaked into the API docs and the
Local Baserow schema. `get_model_field` returns None and a
`NoDatabaseColumnField` is contributed to the generated model instead,
which Django treats as non concrete. A `ButtonFieldConverter` handles
conversion in both directions, since the lenient schema editor cannot
alter into or out of a column-less field, and the serializer is now
always-null while staying writable so the read-only validator still
rejects a write.

Also from review: only creation is gated by the feature flag, so an
existing button field stays editable with the flag off; dependencies are
read off the cached table model rather than two queries per field; and
the client is only told to re-fetch when a referenced field appears or
disappears, not when one is renamed or retyped.

* fix: address review on the button field frontend (#1722)

Without a label the button showed the percent-encoded URL. The URL is
now resolved once as the user built it and only the href is encoded, so
the label reads `https://example.com/Red Button` while the link points
at `Red%20Button`. With no label and no URL it reads "Click me".

Also from review: a read-only field the search cannot match no longer
disables optimistic row updates for every edit in a searched view, which
a valueless field like this one did; the parse tree cache evicts the
least recently used entry rather than the oldest inserted one; and the
field type reports its icon class statically and no longer claims its
cells are booleans in the API docs.

* fix: hide button fields from public views and require a label (#1722)

Button fields are no longer handed to visitors of a publicly shared view.
A new `FieldType.can_be_in_public_view` flag drives the exclusion, applied
to the public view info endpoint, the public rows queryset and the two
public websocket signal paths, so a visible field option isn't enough to
expose the label and the URL formula.

The label is now mandatory. It's the only text a button shows, so it must
be set when the field is created or converted into a button, and it can't
be emptied afterwards. The client-side fallbacks to the resolved URL and
to a default label are gone with it.
2026-07-29 14:53:38 +02:00
Tsering Paljor e5c9ee178e fix: Escape backslash chars in formula field (#5514)
* Ensure backslash chars are escaped in formula field.

* Add changelog entry
2026-06-23 09:00:55 +07:00
Jonathan Adeline 552ce22d16 chore: Bump to Nuxt4 (#5197) 2026-06-17 16:10:09 +04:00
Tsering Paljor 472e877d79 feat: Improve duration support in advanced formulas (#5426)
* Refactor to_duration() to accept an optional format arg.

* Add tests for duration utils

* Add tests for new DurationFormation* arg type

* Expand tests for RuntimeToDuration

* Add duration_format()

* Add tests for RuntimeDurationFormat

* Add a Utility formula category, and recategorize some functions

* Allow formula validation visitor allows validating deferred args.

* Improve test coverage

* Add changelog

* Fix frontend test failure

* Remove changes around deferred arg validation

* Clean up stale logic

* Fix docstring

* Ensure tokenize_duration_format/tokenizeDurationFormat supports fractional seconds.

* Use rounding instead of truncating for fractional precision to match the existing format_duration_value()

* Add missing test coverage for duration field formatting.

* Add support to tokenizer to escape tokens.

* format_duration_value/formatDurationFalue is now just a shim that wraps a call to the unified formatValueWithDurationFormat.

* Fix to_duration() example.
2026-06-15 15:09:34 +07:00
Jonathan Adeline f63563aa93 feat: FormulaInputField expert mode enhancements (#4866) 2026-05-05 14:05:57 +04:00
Peter Evans d7115aefb8 feat: improve Baserow formula function argument validation (#4536) 2026-03-30 16:33:15 +01:00
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00
Peter Evans 06dd5c15c9 Changing the ampersand/pipe ordering, or otherwise complex formulas using them don't work. At the moment with the previous code, 1 > 2 || 3 < 4 is being parsed as 1 > (2 || 3) < 4 instead of (1 > 2) || (3 < 4). (#4516) 2026-01-08 11:10:38 +00:00
Jonathan Adeline 3996f93075 Fix data node usage in HTML content (#4379) 2025-12-10 15:31:54 +04:00
Jonathan Adeline 2d54f8d33e Fix FormulaInputField data record assignment in AB collection element (#4335)
* fix: ensure arrays of inline content are wrapped in a `wrapper` node in `toTipTapVisitor` output.

* refactor visitRoot

* fix tests
2025-11-26 11:36:03 +00:00
Jonathan Adeline 09d9757c64 Improve formula editor 2025-11-25 18:26:38 +04:00
Jonathan Adeline 0c0ed17faf Advanced formula editor enhancements (#4246)
* handle logical operator

* fix linebreak management

* fix i18n key

* fix doFunc function

* display linebreak as a ... linebreak

* fix test

* fix premium and entreprise test config

* fix linebreak in advanced mode
2025-11-14 11:11:06 +00:00
Jonathan Adeline 7bd7569acb Advanced formula editor fixings (#4203) 2025-11-13 21:02:28 +01:00
Tsering Paljor 782a130605 Tests for Advanced Formulas (#4193)
* Initial batch of tests

* Ensure castToInt/castToFloat is taken care of by parser for random int/float

* Fix tests after rebase

* Update Boolean arg type to use ensurer in test()

* Add remaining tests for argument types

* 'and' and 'or' should be operator types

* Add 'and' and 'or' operators to formula visitor

* Add frontend tests

* Add integration tests for runtime formulas

* Disable flakey test

* Replace manual field name construction with db_column
2025-11-13 15:00:41 +04:00
Jérémie Pardou 3554e61e88 Don't validate formula parameter value (#4207) 2025-11-11 18:01:33 +01:00
Bram 8d25a43324 Add new formula editor 2025-11-11 12:47:46 +04:00
Jérémie Pardou eda3db2a2d Wab pre 2.0 bug fixes (#4167)
* Support raw formulas in the backend

* Fix import with operator

* Fix new edge addition delay

* Fix the double undo necessary for local baserow node creation

* Show error on simulate dispatch error

* Follow up of AI agent node

* Datasource without table were breaking the application

* Fix filter value mode

* Change ai node name
2025-11-10 15:57:48 +01:00
Jérémie Pardou e769c2730f fix #4147 - iterator node can be placed after itself (#4151)
* fix #4147 - iterator node can be placed after itself

* Make the formula error log less verbose
2025-11-04 16:01:19 +01:00
Jérémie Pardou 96d4d1bc65 feat: local baserow services return human field names (#4143)
See related issue.
2025-11-03 14:22:46 +01:00
Tsering Paljor 108c3ce793 Advanced formula improvements (#4144)
* Formula should be considered invalid if it can't be resolved.

* Add boolean argument type

* Improve formula validation

* Improve validators.

* Lint fix

* Add changelog

* Clean up import
2025-10-30 18:33:48 +04:00
Jérémie Pardou 88326062e1 Fix tag collection field type after data migration (#4134) 2025-10-30 08:34:40 +01:00
Jérémie Pardou 0c27a31851 Fix formula migration data source filter compat on template import (#4125)
* Fix formula migration data source filter compat

* Remove formula error log to prevent noise
2025-10-28 12:08:27 +01:00
44ca4f812e Advanced formulas + new formula functions (#4082)
* Changes to allow testing literal formula in table field mappings

* Add formula function: upper()

* Use ensure*() in the test/parse methods. Add more functions.

* Add operators, description, and examples.

* Add addable and subtractable types

* Add random generator functions

* Add tests.

* Working formula input

* Simplify

* Further simplify

* Still working - simplified further

* Lint

* Undo changes in FieldMappingForm

* Use advanced mode, not raw

* Temp fix to align the checkbox and button

* Lint fix backend

* Lint fix frontend

* Lint fix

* Add translations

* Add advanced formulas to application builder

---------

Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2025-10-28 09:21:58 +04:00
Bramandpeter_baserow 9898aa1156 Migrate baserow formulas to object (#4080)
* Iimplement the migration

* Further improvements to FormulaField. Introducing JSONFormulaField so that CollectionField.config works correctly. Updating so.. so many tests.

* Further backend tweaks. Found issues in builder and dashboard.

* Further backend tweaks to support the 'used properties' checks.

* Add support for view filter component placeholders. For now it just used in ViewFilterTypeText.

* Lots of frontend changes in AB/WA/Integrations to support the new formula object.

* Fix link resolution

* Re-create the migrations

* Improvements added to JSONFormulaField to support multiple formula properties. Fixing oh-so-many tests in builder, premium and database.

* Fixing frontend tests.

* Addressing AI field feedback, adding BaserowFormulaObjectSerializer

* Fixing e2e tests.

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2025-10-22 17:06:00 +02:00
Davide Silvestri dbb847f88d Add && and || operators to the formula language 2024-04-10 07:51:40 +00:00
Jérémie Pardou 092708c89a Smal fixes: Fix error when deleting an element without selected one, Fix empty formula not being empty. 2024-01-26 13:39:41 +00:00
Jérémie Pardou 4cc667e551 Attempt to fix formula issues 2024-01-23 14:47:04 +00:00
Jérémie Pardou 907222e74b Add fields to table element 2023-10-04 12:46:19 +00:00
Alexander Haller 5efdd27a39 Move formula to core 2023-09-04 12:17:41 +00:00
Alexander Haller d3de9e94d0 Resolve "Formula Input Field" 2023-08-16 13:16:52 +00:00