Commit Graph
148 Commits
Author SHA1 Message Date
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
Bram 1fd27d407c feat: Added admin views listing (#5751) 2026-07-22 16:30:17 +02:00
Davide Silvestri 3486ba237a feat: data sync run history - record every sync as a job and show it to users (#5706)
* fix: call JobType.on_error hook again when a job fails

The call was accidentally dropped in e0a07588a, leaving the documented
post-transaction error hook dead. Job types rely on it to persist error
details that would otherwise be lost to the rolled-back job transaction.

* feat: record data sync runs as jobs and show the sync history

Periodic data syncs now run through the job system on behalf of the
authorized user, so every sync run (manual or periodic) is recorded as a
SyncDataSyncTableJob with a triggered_by discriminator. A new JobType
scoping hook lets the generic jobs listing expose runs started by other
users after a ListDataSyncJobsOperationType permission check, on both the
type-filter and job_ids polling paths. The frontend shows a paginated run
history (state, trigger, user, time, duration, error) in the data sync
configuration modal and below the manual sync modal, live-updating
through the existing job store poller.

* fix: address feedback
2026-07-22 13:35:50 +02:00
alamin-br 52f28b77a4 feat(database): add "starts with" view filter type (#5624)
* feat(database): add starts with view filter type

Adds a new "starts_with" view filter that keeps rows whose field value
begins with the filter value (case-insensitive), with both backend and
web-frontend implementations including the real-time row-match check.

Supported field types: text, long text, url, email, phone number, number,
autonumber, single select, and text/char/url/number/single_select formulas.

Closes #1943

* test(web-frontend): update view filter form snapshot for starts with filter

* fix(database): address review feedback on starts with filter

- Use toSearchableString in the frontend startsWithFilter so real-time
  matching stays consistent with the backend for formatted number fields;
  delegate FormulaFieldType.startsWithFilter to the underlying field type so
  number/select formulas stay consistent too
- Don't trim the row value in genericStartsWithFilter (backend only strips the
  filter value, not the stored cell), avoiding leading-whitespace divergence
- Fix misleading docstrings on StartsWithViewFilterType and starts_with_query
- Add backend coverage for a non-text (number) formula and a frontend test for
  a formatted number field
- Link changelog entry to issue #1943

* fix(database): delegate starts_with filter on AI fields

Address review feedback on PR #5624:
- Delegate starts_with_query / getStartsWithFilterFunction on the premium
  AIFieldType so AI fields filter correctly instead of silently matching
  every row (backend Q() / frontend () => false fallthrough).
- Add backend and frontend regression tests for the AI-field gap.
- Remove the unreachable FormulaFieldType.getStartsWithFilterFunction.
- Rename genericStartsWithFilter's second arg to searchableRowValue.
- Trim the StartsWithViewFilterType docstring to its behavioral sentence.

* docs(database): note starts_with compatibility via get_compatible_filter_field_type
2026-07-03 11:07:07 +02:00
Bram 3b56679cb8 feat: Add Excel import (#5265) 2026-05-06 14:34:44 +02:00
Davide Silvestri c3958f264b feat (database): first and last formulas (#5066)
* feat: add first(), last() and generalized index() formula functions

* fix: address PR review feedback and handle NaN index argument

- Rename _BaserowIndexShortcut to BaserowIndexShortcut (drop leading _)
- Remove unnecessary comments and section separators
- Rename variable c to clone in JSONBArrayGetElement
- Rename test to test_first_and_last_return_scalar_values, drop docstring
- Remove step comments in test_index_generalized.py
- Handle NaN/div-by-zero as index() argument (returns null instead of crash)

* feat: update index() formula examples to include array fields
2026-04-03 07:47:21 +00:00
Davide Silvestri ee1371ff55 feat (database): array_slice formula (#5062)
* feat: add array_slice() database formula function

* fix(formula): handle NaN arguments in array_slice to prevent DB crash

Wrap start/count args with handle_arg_being_nan before truncating to
int, so expressions like tonumber('x') no longer cause
"cannot convert NaN to integer" at the PostgreSQL level.
NaN is treated as 0 for both arguments.
2026-04-03 09:10:16 +02:00
Davide Silvestri 3670bf42c1 feat (database): add array_unique db formula function (#2326) (#5056)
* feat: add ARRAYUNIQUE() database formula function (#2326)

Add array_unique() formula that removes duplicate values from lookup
arrays, preserving first-occurrence order. Mirrors Airtable's
ARRAYUNIQUE() — operates on true arrays from lookup fields, not plain
text.

Supports text, number, boolean, date, duration, URL, email, phone,
rating, single select, multiple select, link row, created_on, and
autonumber sub-types. Rejects file fields (different JSONB structure).

* feat: enable count() and join() composability with array_unique()

Add internal non-aggregate functions (array_length, array_join_values)
that operate on JSONB arrays directly, and wire them into count() and
join() so that count(array_unique(...)) and join(array_unique(...), sep)
work. The existing many-expression paths remain unchanged.

* docs: add array_unique to formula docs, mark internals as exceptions

Add array_unique to formula_docs.md so the formula prompt completeness
tests pass. Add array_length and array_join_values (internal delegation
targets) to the formula_exceptions lists in both test files.

* chore: ensure tests works also for formulas referencing different field types
2026-04-03 08:43:12 +02:00
Bram 019d02e93d feat: edit row via form view field (#4886) 2026-03-17 09:44:33 +01:00
Bram c0137f227b Reorganize onboarding and add Kuma AI (#4606) 2026-02-10 11:30:29 +01:00
Petr Stříbný 62ebe6c703 Add missing job types (#4546) 2026-01-23 13:23:17 +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
dimmur-brw 35784df37c Improve UX for search items that don't have anything to navigate to (#4367)
Improve UX for search items that don't have anything to navigate to
2026-01-07 10:17:28 +01:00
Jérémie Pardouandpeter_baserow 8e9a0dec3b Wab post release minor bug fixes (#4283)
* Fix missing early return when data source is missing

* Fix missing file_import job type in frontend registry

* Restore trigger waiting message

* Tweak the margin-bottom if the first alert. If there's an alert below it, the combination of bottom+top is too much.

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2025-11-18 13:24:00 +01:00
Bram 4a9d4ec334 Workspace search (#4076)
Adds ability to search various items in workspace
2025-10-22 20:09:40 +02:00
Cezary Statkiewicz 37ddb0f7d5 Date dependency #3735 2025-09-12 15:11:29 +02:00
Bram Wiepjes efab3a05a8 PostgreSQL two-way data sync 2025-08-21 20:15:49 +00:00
Przemyslaw Kukulski 6d88a982a3 Handle default value and constraints 2025-07-10 08:22:37 +02:00
Przemyslaw Kukulski a30bf63524 Field value constraints: Unique with empty 2025-07-08 05:03:04 +00:00
Davide Silvestri 87848ac91d Resolve "Field level edit permissions" 2025-04-29 14:25:11 +02:00
Bram Wiepjes eb5c734a0a Introduce guided tours 2025-04-01 20:52:11 +00:00
Davide Silvestri 89fa7ea651 Add payload pagination for webhooks 2025-03-12 17:08:38 +01:00
Bram Wiepjes fa9048f584 Send notification when webhook is deactivated 2025-02-25 10:52:35 +00:00
Bram Wiepjes b5f191a5f8 Baserow distribution aggregation 2025-02-04 23:01:02 +00:00
Davide Silvestri fadc768d7a Resolve "Use "Collaborator" field type in formulas" 2025-01-31 14:01:04 +00:00
Davide Silvestri 2fffac0fc6 Resolve "Filter support for lookups of date fields" 2025-01-23 17:15:06 +00:00
Bram Wiepjes 25378704a5 Periodic data sync 2025-01-20 12:28:14 +00:00
Petr Stribny cf714d69a7 Add count aggregation to summary widget 2025-01-10 14:19:48 +01:00
Cezary Statkiewicz 244d6050bd #3112 number lookup field filters 2025-01-02 09:19:28 +00:00
Bram Wiepjes 8814f1347b added korean language 2024-11-26 19:09:48 +01:00
Cezary Statkiewicz e6b4eb05dd #3103 boolean lookup filters 2024-11-15 11:48:19 +00:00
Davide Silvestri be27e89fb0 Add filters support for lookups of single select fields 2024-11-12 19:22:38 +00:00
Bram Wiepjes 9fd4f23608 PostgreSQL data sync 2024-11-11 09:41:45 +00:00
Bram Wiepjes 1c13d4673e Webhook changes [2/4]: Introduced field and view webhook types 2024-09-27 16:54:38 +00:00
Bram Wiepjes 037124219c Data sync final branch 2024-09-24 15:06:35 +00:00
Przemyslaw Kukulski 06aee7e14d Resolve "Add onboarding step that adds fields to the created table" 2024-09-02 09:17:01 +00:00
Przemyslaw Kukulski 19a84d4c5d Resolve "Add tourl formula to support operations on url field type" 2024-08-01 19:50:43 +00:00
Petr Stribny 1bd4e4a7ea Allow filtering text-based lookups 2024-07-16 15:04:20 +00:00
Przemyslaw Kukulski dbf820e315 Resolve "Make URL types hyperlinks in Lookup fields" 2024-07-15 10:19:55 +00:00
Davide Silvestri 441877f278 Resolve "Improve date filters by allowing multi step combinations" 2024-05-28 16:45:46 +00:00
Bram Wiepjes 2a07ac3f0e Improved onboarding 2024-05-24 13:26:26 +00:00
Davide Silvestri aeb4ff6684 Draft: Resolve "Support for division/multiplication/tonumber formula for duration field" 2024-05-08 09:21:55 +00:00
Eimantas Stonys 8e91943f98 Merge branch '1988-introduce-greater-than-or-equal-and-less-than-or-equal-filter-types' into 'develop'
Resolve "Introduce “greater than or equal” (>=) and “less than or equal” (<=) filter types"

Closes #1988

See merge request baserow/baserow!2235
2024-04-05 15:43:08 +00:00
Eimantas Stonys 5664304685 Resolve "Introduce “greater than or equal” (>=) and “less than or equal” (<=) filter types" 2024-04-05 15:43:08 +00:00
Davide Silvestri a41ab1ac87 003 📚: Support for mentions in long text field 2024-04-05 15:25:38 +00:00
Bram Wiepjes 017e093221 Merge branch '1472-categorical-filter-is-any-of-is-none-of' into 'develop'
Introduce `is any of` and `is none of` filters

Closes #1472, #1979, #1978, and #2102

See merge request baserow/baserow!2223
2024-04-05 08:38:16 +00:00
Bram Wiepjes 0a4e5f938d Introduce is any of and is none of filters 2024-04-05 08:38:15 +00:00
Bram Wiepjes 6502267872 Move AI field into premium 2024-04-05 08:18:41 +00:00
Bram Wiepjes 1298aa7eec AI field 2024-04-02 19:50:44 +00:00
Bram Wiepjes 4b1fad7d30 Password field type 2024-02-28 19:06:11 +00:00