From d6c8c8b4b00d53a98fa888a817ae0137792d4e6c Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 13 May 2026 16:42:39 +0100 Subject: [PATCH 1/2] Fix snapshot ordering for multi-slot container elements (#5366) * Regenerating the builder-related templates, as the order+id combination was proving difficult to replicate on the graph side. * Lint fix --- .../contrib/builder/application_types.py | 24 +- .../templates/__snapshots__/ab-testing.ambr | 4 +- .../__snapshots__/ab_agency_theme.ambr | 14 +- .../__snapshots__/ab_baserow_theme.ambr | 14 +- .../__snapshots__/ab_coral_theme.ambr | 14 +- .../__snapshots__/ab_corporate_theme.ambr | 14 +- .../__snapshots__/ab_eclipse_theme.ambr | 14 +- .../__snapshots__/ab_education_theme.ambr | 14 +- .../__snapshots__/ab_finance_theme.ambr | 14 +- .../__snapshots__/ab_forest_theme.ambr | 14 +- .../__snapshots__/ab_healthcare_theme.ambr | 14 +- .../__snapshots__/ab_ivory_theme.ambr | 14 +- .../__snapshots__/ab_lavender_theme.ambr | 14 +- .../__snapshots__/ab_legal_theme.ambr | 14 +- .../__snapshots__/ab_luxury_theme.ambr | 14 +- .../__snapshots__/ab_midnight_theme.ambr | 14 +- .../__snapshots__/ab_mint_theme.ambr | 14 +- .../__snapshots__/ab_neon_theme.ambr | 14 +- .../__snapshots__/ab_ocean_theme.ambr | 14 +- .../__snapshots__/ab_realestate_theme.ambr | 14 +- .../__snapshots__/ab_slate_theme.ambr | 14 +- .../__snapshots__/ab_startup_theme.ambr | 14 +- .../__snapshots__/ab_sunset_theme.ambr | 14 +- .../__snapshots__/ab_tech_theme.ambr | 14 +- .../__snapshots__/ab_terracotta_theme.ambr | 14 +- .../__snapshots__/action-plan-management.ambr | 60 +- .../__snapshots__/asset-management.ambr | 120 ++-- .../__snapshots__/brand-assets-manager.ambr | 24 +- .../business-goal-tracker-okrs.ambr | 20 +- .../__snapshots__/campaign-management.ambr | 100 +-- .../car-dealership-inventory.ambr | 66 +- .../commercial-property-management.ambr | 18 +- .../compliance-assessment-builder.ambr | 14 +- .../electronic-health-record.ambr | 6 +- .../__snapshots__/esg-management.ambr | 28 +- .../templates/__snapshots__/formulas.ambr | 36 +- .../__snapshots__/incident-management.ambr | 132 ++-- .../__snapshots__/lead-management.ambr | 12 +- .../__snapshots__/lightweight-crm.ambr | 38 +- .../__snapshots__/objectives-key-results.ambr | 20 +- .../online-freelancer-management.ambr | 4 +- .../templates/__snapshots__/order-kiosk.ambr | 22 +- .../__snapshots__/policy-management.ambr | 8 +- .../purchase-order-management.ambr | 20 +- .../risk-assessment-and-management.ambr | 48 +- .../sales-pipeline-management.ambr | 4 +- .../__snapshots__/santa-logistics.ambr | 170 ++--- .../standard-operating-procedures.ambr | 34 +- .../supply-chain-procurement-management.ambr | 32 +- .../__snapshots__/task-management.ambr | 104 +-- .../work-management-platform.ambr | 598 +++++++++--------- 51 files changed, 1053 insertions(+), 1035 deletions(-) diff --git a/backend/src/baserow/contrib/builder/application_types.py b/backend/src/baserow/contrib/builder/application_types.py index 65d24a69f1..e60ae5aba6 100755 --- a/backend/src/baserow/contrib/builder/application_types.py +++ b/backend/src/baserow/contrib/builder/application_types.py @@ -586,24 +586,42 @@ def serialize_for_regression_testing(self, builder: Builder) -> dict: keyed by page name. Used by snapshot tests to detect element-hierarchy regressions across template changes. + Children are grouped by slot (place_in_container) and slots are ordered by + the minimum ``order`` value among their members, so the output is stable + regardless of cross-slot insertion history. + :param builder: The builder application instance to serialize. :return: A dict mapping page names to their element-tree representation. """ + from collections import defaultdict + from baserow.contrib.builder.elements.handler import ElementHandler from baserow.contrib.builder.pages.handler import PageHandler result = {} for page in PageHandler().get_pages(builder): elements = list(ElementHandler().get_elements(page)) - # Elements are already ordered by (order, id) via Element.Meta.ordering. + by_parent: dict[int | None, list] = {} for el in elements: by_parent.setdefault(el.parent_element_id, []).append(el) def build_tree(parent_id): + children = by_parent.get(parent_id, []) + by_slot: dict[str, list] = defaultdict(list) + for el in children: + by_slot[el.place_in_container or ""].append(el) + ordered = [] + for slot in sorted( + by_slot, key=lambda s: min(e.order for e in by_slot[s]) + ): + ordered.extend(sorted(by_slot[slot], key=lambda e: (e.order, e.id))) return [ - {"type": el.get_type().type, "children": build_tree(el.id)} - for el in by_parent.get(parent_id, []) + { + "type": element.get_type().type, + "children": build_tree(element.id), + } + for element in ordered ] result[page.name] = build_tree(None) diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab-testing.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab-testing.ambr index 03f84a2a00..94fa9ba530 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab-testing.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab-testing.ambr @@ -55,7 +55,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -125,7 +125,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_agency_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_agency_theme.ambr index 57f1aae05c..f48721d3fc 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_agency_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_agency_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_baserow_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_baserow_theme.ambr index 561e253c14..c3080e168f 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_baserow_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_baserow_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_coral_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_coral_theme.ambr index ebda3cb05b..b836c84719 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_coral_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_coral_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_corporate_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_corporate_theme.ambr index 3d62ee5ca9..e2984ec101 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_corporate_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_corporate_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_eclipse_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_eclipse_theme.ambr index de8f7c8802..7511521bf2 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_eclipse_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_eclipse_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_education_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_education_theme.ambr index 9547b1b3ab..71a7d3bef7 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_education_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_education_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_finance_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_finance_theme.ambr index ffdbd43c40..4253bf8586 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_finance_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_finance_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_forest_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_forest_theme.ambr index 98c68228b1..32f02a76f9 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_forest_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_forest_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_healthcare_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_healthcare_theme.ambr index 2f0d444fc7..8a4fa4a71a 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_healthcare_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_healthcare_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_ivory_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_ivory_theme.ambr index 7e47b6acfa..50450ccb17 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_ivory_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_ivory_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_lavender_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_lavender_theme.ambr index 70292a0918..ef4c4f7c34 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_lavender_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_lavender_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_legal_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_legal_theme.ambr index 4e4695b1d0..07a6b174b2 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_legal_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_legal_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_luxury_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_luxury_theme.ambr index fede026dfa..c041c0bfe6 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_luxury_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_luxury_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_midnight_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_midnight_theme.ambr index 31d16109bd..b9e80481ef 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_midnight_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_midnight_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_mint_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_mint_theme.ambr index 07f3def917..cf7d876a04 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_mint_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_mint_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_neon_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_neon_theme.ambr index c439697e84..2b15be6bce 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_neon_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_neon_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_ocean_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_ocean_theme.ambr index 1ecfc247b7..e9b2ce5a5d 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_ocean_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_ocean_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_realestate_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_realestate_theme.ambr index bf4bd596b9..15cb7aab8f 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_realestate_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_realestate_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_slate_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_slate_theme.ambr index 4a3d5bd8de..d095fb1fa8 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_slate_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_slate_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_startup_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_startup_theme.ambr index cf7a7292ff..ccbafccc4c 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_startup_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_startup_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_sunset_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_sunset_theme.ambr index 0841d92188..411e4c978e 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_sunset_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_sunset_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_tech_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_tech_theme.ambr index b9c2c9cac9..ac96f3b4a7 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_tech_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_tech_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/ab_terracotta_theme.ambr b/backend/tests/baserow/core/templates/__snapshots__/ab_terracotta_theme.ambr index fa91c5c392..f0a62285a4 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/ab_terracotta_theme.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/ab_terracotta_theme.ambr @@ -170,6 +170,11 @@ ]), 'type': 'iframe', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -190,11 +195,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -429,7 +429,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -459,7 +459,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/action-plan-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/action-plan-management.ambr index f78dc7ae98..6f8bd78ef1 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/action-plan-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/action-plan-management.ambr @@ -305,43 +305,18 @@ }), dict({ 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), dict({ 'children': list([ ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_text', + 'type': 'link', }), ]), - 'type': 'form_container', + 'type': 'repeat', }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), ]), - 'type': 'repeat', + 'type': 'text', }), dict({ 'children': list([ @@ -368,6 +343,31 @@ ]), 'type': 'text', }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), + ]), + 'type': 'form_container', + }), ]), 'type': 'column', }), @@ -461,12 +461,12 @@ dict({ 'children': list([ ]), - 'type': 'iframe', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'iframe', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/asset-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/asset-management.ambr index 4b13e20d49..df3f73fc53 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/asset-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/asset-management.ambr @@ -109,11 +109,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), dict({ 'children': list([ ]), @@ -144,6 +139,11 @@ ]), 'type': 'form_container', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), dict({ 'children': list([ dict({ @@ -321,7 +321,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -336,7 +336,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -351,7 +351,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -366,7 +366,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', @@ -501,38 +501,13 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), ]), - 'type': 'form_container', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -561,8 +536,33 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), ]), - 'type': 'text', + 'type': 'form_container', }), ]), 'type': 'column', @@ -632,33 +632,13 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), ]), - 'type': 'form_container', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -677,8 +657,28 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), ]), - 'type': 'text', + 'type': 'form_container', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/brand-assets-manager.ambr b/backend/tests/baserow/core/templates/__snapshots__/brand-assets-manager.ambr index dbda4e7836..aea0a8ea50 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/brand-assets-manager.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/brand-assets-manager.ambr @@ -17,18 +17,8 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), ]), - 'type': 'form_container', + 'type': 'text', }), dict({ 'children': list([ @@ -52,8 +42,18 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), ]), - 'type': 'text', + 'type': 'form_container', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/business-goal-tracker-okrs.ambr b/backend/tests/baserow/core/templates/__snapshots__/business-goal-tracker-okrs.ambr index cefdd5d60d..32daeb6b2a 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/business-goal-tracker-okrs.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/business-goal-tracker-okrs.ambr @@ -18,7 +18,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -58,7 +58,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), ]), 'type': 'column', @@ -189,7 +189,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'input_text', }), dict({ 'children': list([ @@ -199,22 +199,22 @@ dict({ 'children': list([ ]), - 'type': 'input_text', + 'type': 'button', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'link', }), dict({ 'children': list([ @@ -310,17 +310,17 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'button', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'link', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/campaign-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/campaign-management.ambr index fb0b13a216..d3aab5074a 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/campaign-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/campaign-management.ambr @@ -15,56 +15,6 @@ ]), 'type': 'text', }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - ]), - 'type': 'simple_container', - }), dict({ 'children': list([ ]), @@ -120,6 +70,56 @@ ]), 'type': 'link', }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + ]), + 'type': 'simple_container', + }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/car-dealership-inventory.ambr b/backend/tests/baserow/core/templates/__snapshots__/car-dealership-inventory.ambr index eb8d49c756..785b20a7db 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/car-dealership-inventory.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/car-dealership-inventory.ambr @@ -192,7 +192,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -267,7 +267,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -277,17 +277,17 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -342,12 +342,12 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -387,7 +387,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', @@ -530,18 +530,8 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), ]), - 'type': 'form_container', + 'type': 'text', }), dict({ 'children': list([ @@ -625,8 +615,18 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), ]), - 'type': 'text', + 'type': 'form_container', }), ]), 'type': 'column', @@ -648,7 +648,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -683,7 +683,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), dict({ 'children': list([ @@ -978,11 +978,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'image', - }), dict({ 'children': list([ ]), @@ -1013,6 +1008,11 @@ ]), 'type': 'link', }), + dict({ + 'children': list([ + ]), + 'type': 'image', + }), ]), 'type': 'column', }), @@ -1359,17 +1359,17 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -1379,7 +1379,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'heading', }), dict({ 'children': list([ @@ -1399,12 +1399,12 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'heading', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/commercial-property-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/commercial-property-management.ambr index c54031e76e..ccebe7f5c5 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/commercial-property-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/commercial-property-management.ambr @@ -15,11 +15,6 @@ ]), 'type': 'text', }), - dict({ - 'children': list([ - ]), - 'type': 'image', - }), dict({ 'children': list([ ]), @@ -55,6 +50,11 @@ ]), 'type': 'repeat', }), + dict({ + 'children': list([ + ]), + 'type': 'image', + }), ]), 'type': 'column', }), @@ -206,7 +206,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -236,7 +236,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), ]), 'type': 'column', @@ -307,12 +307,12 @@ dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'button', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/compliance-assessment-builder.ambr b/backend/tests/baserow/core/templates/__snapshots__/compliance-assessment-builder.ambr index 53068f6ac0..401d3a8d34 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/compliance-assessment-builder.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/compliance-assessment-builder.ambr @@ -52,11 +52,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), dict({ 'children': list([ dict({ @@ -67,6 +62,11 @@ ]), 'type': 'repeat', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), dict({ 'children': list([ dict({ @@ -280,12 +280,12 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/electronic-health-record.ambr b/backend/tests/baserow/core/templates/__snapshots__/electronic-health-record.ambr index 2595d4d158..c8fc6f9ec1 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/electronic-health-record.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/electronic-health-record.ambr @@ -204,17 +204,17 @@ dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'choice', }), dict({ 'children': list([ ]), - 'type': 'choice', + 'type': 'button', }), dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'table', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/esg-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/esg-management.ambr index 9c9aebd049..0ac6e18a62 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/esg-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/esg-management.ambr @@ -63,7 +63,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -83,12 +83,12 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -98,7 +98,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -808,7 +808,7 @@ dict({ 'children': list([ ]), - 'type': 'iframe', + 'type': 'text', }), dict({ 'children': list([ @@ -838,7 +838,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'iframe', }), dict({ 'children': list([ @@ -848,12 +848,12 @@ dict({ 'children': list([ ]), - 'type': 'iframe', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'iframe', }), ]), 'type': 'column', @@ -910,7 +910,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -920,12 +920,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -935,7 +935,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -1309,7 +1309,7 @@ dict({ 'children': list([ ]), - 'type': 'iframe', + 'type': 'text', }), dict({ 'children': list([ @@ -1319,7 +1319,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'iframe', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/formulas.ambr b/backend/tests/baserow/core/templates/__snapshots__/formulas.ambr index 3ed43ddc7f..fef1e1c64a 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/formulas.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/formulas.ambr @@ -23,12 +23,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -37,23 +37,13 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), ]), - 'type': 'repeat', + 'type': 'text', }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'image', - }), ]), - 'type': 'repeat', + 'type': 'text', }), dict({ 'children': list([ @@ -93,22 +83,32 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'image', + }), ]), - 'type': 'text', + 'type': 'repeat', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), ]), - 'type': 'text', + 'type': 'repeat', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/incident-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/incident-management.ambr index 77cfc1f7b2..0c5183eb14 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/incident-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/incident-management.ambr @@ -196,53 +196,8 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), - dict({ - 'children': list([ - ]), - 'type': 'checkbox', - }), - dict({ - 'children': list([ - ]), - 'type': 'checkbox', - }), ]), - 'type': 'form_container', + 'type': 'text', }), dict({ 'children': list([ @@ -281,18 +236,63 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), ]), - 'type': 'text', + 'type': 'repeat', }), dict({ 'children': list([ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'checkbox', + }), + dict({ + 'children': list([ + ]), + 'type': 'checkbox', }), ]), - 'type': 'repeat', + 'type': 'form_container', }), ]), 'type': 'column', @@ -359,12 +359,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'table', }), dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'heading', }), dict({ 'children': list([ @@ -550,21 +550,6 @@ ]), 'type': 'text', }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'choice', - }), - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), - ]), - 'type': 'form_container', - }), dict({ 'children': list([ ]), @@ -605,6 +590,21 @@ ]), 'type': 'repeat', }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'choice', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), + ]), + 'type': 'form_container', + }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/lead-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/lead-management.ambr index 384743aa04..332bf399e2 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/lead-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/lead-management.ambr @@ -75,12 +75,12 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -90,7 +90,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -115,7 +115,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -125,7 +125,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -140,7 +140,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/lightweight-crm.ambr b/backend/tests/baserow/core/templates/__snapshots__/lightweight-crm.ambr index a3d28f24da..b708786e56 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/lightweight-crm.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/lightweight-crm.ambr @@ -202,7 +202,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -217,7 +217,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -294,12 +294,12 @@ dict({ 'children': list([ ]), - 'type': 'input_text', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -309,22 +309,22 @@ dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'input_text', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'button', }), ]), 'type': 'column', @@ -879,12 +879,12 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -899,7 +899,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -909,7 +909,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'image', }), ]), 'type': 'column', @@ -986,7 +986,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'input_text', }), dict({ 'children': list([ @@ -1001,12 +1001,12 @@ dict({ 'children': list([ ]), - 'type': 'input_text', + 'type': 'button', }), dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'image', }), ]), 'type': 'column', @@ -1195,7 +1195,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'link', }), dict({ 'children': list([ @@ -1205,12 +1205,12 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'image', }), dict({ 'children': list([ @@ -1220,7 +1220,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'image', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/objectives-key-results.ambr b/backend/tests/baserow/core/templates/__snapshots__/objectives-key-results.ambr index 34396e5914..9a92a8020d 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/objectives-key-results.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/objectives-key-results.ambr @@ -89,6 +89,16 @@ ]), 'type': 'heading', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -114,16 +124,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/online-freelancer-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/online-freelancer-management.ambr index 8d16f802dc..b32199af2b 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/online-freelancer-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/online-freelancer-management.ambr @@ -298,12 +298,12 @@ dict({ 'children': list([ ]), - 'type': 'button', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'button', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/order-kiosk.ambr b/backend/tests/baserow/core/templates/__snapshots__/order-kiosk.ambr index ee5dabec73..fab437d1db 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/order-kiosk.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/order-kiosk.ambr @@ -95,7 +95,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -115,7 +115,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), ]), 'type': 'column', @@ -181,12 +181,12 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'heading', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -201,17 +201,17 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), dict({ 'children': list([ @@ -271,7 +271,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -291,7 +291,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), dict({ 'children': list([ @@ -375,7 +375,7 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ @@ -395,7 +395,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/policy-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/policy-management.ambr index ae3f6389ab..9d2cdd99b7 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/policy-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/policy-management.ambr @@ -333,7 +333,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -348,7 +348,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -517,7 +517,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -532,7 +532,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/purchase-order-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/purchase-order-management.ambr index 16c3dc803d..fff7fc4205 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/purchase-order-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/purchase-order-management.ambr @@ -137,16 +137,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'table', - }), dict({ 'children': list([ dict({ @@ -162,6 +152,16 @@ ]), 'type': 'form_container', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'table', + }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/risk-assessment-and-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/risk-assessment-and-management.ambr index 239bc48809..73307cd756 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/risk-assessment-and-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/risk-assessment-and-management.ambr @@ -268,13 +268,8 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), ]), - 'type': 'form_container', + 'type': 'text', }), dict({ 'children': list([ @@ -288,8 +283,13 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), ]), - 'type': 'text', + 'type': 'form_container', }), ]), 'type': 'column', @@ -355,6 +355,21 @@ ]), 'type': 'text', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -375,21 +390,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -592,12 +592,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'table', }), dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'heading', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/sales-pipeline-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/sales-pipeline-management.ambr index 222a16b521..6e3dec39f7 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/sales-pipeline-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/sales-pipeline-management.ambr @@ -48,7 +48,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -78,7 +78,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/santa-logistics.ambr b/backend/tests/baserow/core/templates/__snapshots__/santa-logistics.ambr index c3b6cb2663..9a172795f2 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/santa-logistics.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/santa-logistics.ambr @@ -40,6 +40,91 @@ ]), 'type': 'heading', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'iframe', + }), dict({ 'children': list([ dict({ @@ -155,91 +240,6 @@ ]), 'type': 'repeat', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'iframe', - }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/standard-operating-procedures.ambr b/backend/tests/baserow/core/templates/__snapshots__/standard-operating-procedures.ambr index 329e94c878..12761b9fbf 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/standard-operating-procedures.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/standard-operating-procedures.ambr @@ -20,12 +20,12 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', @@ -148,6 +148,21 @@ ]), 'type': 'text', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -168,21 +183,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), diff --git a/backend/tests/baserow/core/templates/__snapshots__/supply-chain-procurement-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/supply-chain-procurement-management.ambr index fd8061b75a..902f09238e 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/supply-chain-procurement-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/supply-chain-procurement-management.ambr @@ -263,7 +263,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -278,7 +278,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -298,7 +298,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -308,7 +308,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -496,7 +496,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -531,7 +531,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -541,12 +541,12 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -586,7 +586,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -606,7 +606,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), ]), 'type': 'column', @@ -807,7 +807,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -842,12 +842,12 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -862,7 +862,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -877,7 +877,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -887,7 +887,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), ]), 'type': 'column', diff --git a/backend/tests/baserow/core/templates/__snapshots__/task-management.ambr b/backend/tests/baserow/core/templates/__snapshots__/task-management.ambr index 4fc11d0b4b..5742fc8489 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/task-management.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/task-management.ambr @@ -331,12 +331,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ @@ -361,7 +361,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -396,7 +396,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ @@ -456,7 +456,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'table', }), dict({ 'children': list([ @@ -471,7 +471,7 @@ dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'heading', }), dict({ 'children': list([ @@ -619,8 +619,13 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), ]), - 'type': 'text', + 'type': 'repeat', }), dict({ 'children': list([ @@ -634,18 +639,13 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), ]), - 'type': 'repeat', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -660,7 +660,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), ]), 'type': 'column', @@ -949,12 +949,12 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'link', }), dict({ 'children': list([ @@ -964,27 +964,17 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), - 'type': 'repeat', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -999,7 +989,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -1009,17 +999,12 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'record_selector', - }), ]), - 'type': 'form_container', + 'type': 'text', }), dict({ 'children': list([ @@ -1079,17 +1064,32 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'heading', }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), ]), - 'type': 'text', + 'type': 'repeat', }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'record_selector', + }), ]), - 'type': 'text', + 'type': 'form_container', }), ]), 'type': 'column', @@ -1213,7 +1213,7 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'text', }), dict({ 'children': list([ @@ -1228,7 +1228,7 @@ dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'link', }), dict({ 'children': list([ @@ -1237,13 +1237,8 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), ]), - 'type': 'repeat', + 'type': 'link', }), dict({ 'children': list([ @@ -1252,8 +1247,13 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), ]), - 'type': 'link', + 'type': 'repeat', }), ]), 'type': 'column', @@ -1276,7 +1276,7 @@ dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'table', }), dict({ 'children': list([ @@ -1291,7 +1291,7 @@ dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'heading', }), dict({ 'children': list([ diff --git a/backend/tests/baserow/core/templates/__snapshots__/work-management-platform.ambr b/backend/tests/baserow/core/templates/__snapshots__/work-management-platform.ambr index c42d9f5801..9b07bd416e 100644 --- a/backend/tests/baserow/core/templates/__snapshots__/work-management-platform.ambr +++ b/backend/tests/baserow/core/templates/__snapshots__/work-management-platform.ambr @@ -15,11 +15,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), dict({ 'children': list([ dict({ @@ -40,6 +35,11 @@ ]), 'type': 'repeat', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), dict({ 'children': list([ dict({ @@ -119,56 +119,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - ]), - 'type': 'simple_container', - }), - ]), - 'type': 'repeat', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - ]), - 'type': 'simple_container', - }), - ]), - 'type': 'repeat', - }), dict({ 'children': list([ dict({ @@ -234,6 +184,56 @@ ]), 'type': 'form_container', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + ]), + 'type': 'simple_container', + }), + ]), + 'type': 'repeat', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + ]), + 'type': 'simple_container', + }), + ]), + 'type': 'repeat', + }), ]), 'type': 'column', }), @@ -271,11 +271,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), dict({ 'children': list([ dict({ @@ -286,6 +281,11 @@ ]), 'type': 'simple_container', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), dict({ 'children': list([ dict({ @@ -306,11 +306,6 @@ ]), 'type': 'heading', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), dict({ 'children': list([ dict({ @@ -321,6 +316,11 @@ ]), 'type': 'simple_container', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), dict({ 'children': list([ dict({ @@ -417,33 +417,28 @@ }), dict({ 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), - dict({ - 'children': list([ - ]), - 'type': 'datetime_picker', - }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), ]), - 'type': 'record_selector', + 'type': 'simple_container', }), ]), - 'type': 'form_container', + 'type': 'simple_container', }), dict({ 'children': list([ @@ -495,6 +490,11 @@ ]), 'type': 'simple_container', }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ dict({ @@ -509,26 +509,26 @@ 'children': list([ dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), - 'type': 'simple_container', + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'datetime_picker', + }), + dict({ + 'children': list([ + ]), + 'type': 'record_selector', }), ]), - 'type': 'simple_container', + 'type': 'form_container', }), ]), 'type': 'column', @@ -564,33 +564,33 @@ }), dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_file', - }), ]), - 'type': 'form_container', + 'type': 'table', }), dict({ 'children': list([ ]), - 'type': 'table', + 'type': 'heading', }), dict({ 'children': list([ ]), - 'type': 'heading', + 'type': 'table', }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_file', + }), ]), - 'type': 'table', + 'type': 'form_container', }), ]), 'type': 'column', @@ -614,6 +614,26 @@ ]), 'type': 'link', }), + dict({ + 'children': list([ + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + ]), + 'type': 'simple_container', + }), + ]), + 'type': 'repeat', + }), dict({ 'children': list([ dict({ @@ -659,51 +679,6 @@ ]), 'type': 'simple_container', }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'input_text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - ]), - 'type': 'form_container', - }), dict({ 'children': list([ dict({ @@ -736,7 +711,12 @@ dict({ 'children': list([ ]), - 'type': 'link', + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', }), dict({ 'children': list([ @@ -747,7 +727,7 @@ 'type': 'simple_container', }), ]), - 'type': 'repeat', + 'type': 'simple_container', }), dict({ 'children': list([ @@ -778,26 +758,46 @@ 'children': list([ dict({ 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), - 'type': 'simple_container', + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'input_text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', }), ]), - 'type': 'simple_container', + 'type': 'form_container', }), ]), 'type': 'column', @@ -868,6 +868,56 @@ ]), 'type': 'simple_container', }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + ]), + 'type': 'repeat', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + ]), + 'type': 'repeat', + }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + ]), + 'type': 'repeat', + }), + ]), + 'type': 'simple_container', + }), dict({ 'children': list([ dict({ @@ -943,56 +993,6 @@ ]), 'type': 'repeat', }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - ]), - 'type': 'repeat', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - ]), - 'type': 'repeat', - }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - ]), - 'type': 'repeat', - }), - ]), - 'type': 'simple_container', - }), dict({ 'children': list([ dict({ @@ -1351,6 +1351,61 @@ }), dict({ 'children': list([ + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'link', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), + dict({ + 'children': list([ + ]), + 'type': 'text', + }), dict({ 'children': list([ ]), @@ -1436,61 +1491,6 @@ ]), 'type': 'simple_container', }), - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'link', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), - dict({ - 'children': list([ - ]), - 'type': 'text', - }), ]), 'type': 'column', }), @@ -1558,6 +1558,16 @@ ]), 'type': 'table', }), + dict({ + 'children': list([ + ]), + 'type': 'heading', + }), + dict({ + 'children': list([ + ]), + 'type': 'table', + }), dict({ 'children': list([ dict({ @@ -1573,16 +1583,6 @@ ]), 'type': 'form_container', }), - dict({ - 'children': list([ - ]), - 'type': 'heading', - }), - dict({ - 'children': list([ - ]), - 'type': 'table', - }), ]), 'type': 'column', }), @@ -1804,12 +1804,12 @@ dict({ 'children': list([ ]), - 'type': 'image', + 'type': 'text', }), dict({ 'children': list([ ]), - 'type': 'text', + 'type': 'image', }), ]), 'type': 'column', From 2daacc7bea01e1fd668d8b96a205a2a24c70dfd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Pardou?= <571533+jrmi@users.noreply.github.com> Date: Wed, 13 May 2026 21:36:30 +0200 Subject: [PATCH 2/2] chore: improve error handling in frontend (#5109) --- .env.example | 1 + backend/src/baserow/config/settings/base.py | 12 ++++ backend/src/baserow/core/sentry.py | 59 +++++++++++++++ backend/tests/baserow/core/test_sentry.py | 43 ++++++++++- .../improve_error_handling_in_frontend.json | 9 +++ .../pages/admin/dataScanner.vue | 13 +++- .../baserow_enterprise/pages/auditLog.vue | 26 ++++++- .../baserow_premium/pages/admin/license.vue | 19 ++++- .../baserow_premium/pages/admin/licenses.vue | 14 +++- web-frontend/modules/automation/middleware.js | 0 .../selectWorkspaceAutomationWorkflow.js | 43 +++++++++++ web-frontend/modules/automation/module.js | 6 ++ .../automation/pages/automationWorkflow.vue | 62 ++++++---------- .../components/PublicSiteErrorPage.vue | 28 +++++--- web-frontend/modules/builder/middleware.js | 3 - .../middleware/selectWorkspaceBuilderPage.js | 18 ++++- .../modules/builder/pages/pageEditor.vue | 20 +++++- .../modules/builder/pages/publicPage.vue | 20 ++++++ .../core/components/DefaultErrorPage.vue | 28 +++++--- web-frontend/modules/core/middleware.js | 19 ----- web-frontend/modules/core/middleware/staff.js | 11 ++- web-frontend/modules/core/module.js | 1 - .../core/pages/notificationRedirect.vue | 8 +++ web-frontend/modules/core/pages/settings.vue | 9 ++- .../modules/core/pages/styleGuide.vue | 72 ++++++++++++++++++- .../modules/core/pages/verifyEmailAddress.vue | 12 ++++ web-frontend/modules/core/pages/workspace.vue | 8 +++ .../modules/core/plugins/errorHandler.js | 14 ---- web-frontend/modules/dashboard/middleware.js | 6 -- .../dashboard/middleware/dashboardLoading.js | 13 +++- .../modules/dashboard/pages/dashboard.vue | 60 +++++++++++----- web-frontend/modules/dashboard/routes.js | 5 -- web-frontend/modules/database/middleware.js | 5 -- .../selectWorkspaceDatabaseTable.js | 17 ++++- web-frontend/modules/database/module.js | 33 --------- web-frontend/modules/database/pages/form.vue | 18 ++++- .../modules/database/pages/publicView.vue | 9 ++- web-frontend/sentry.client.config.ts | 7 +- web-frontend/sentry.server.config.ts | 6 +- 39 files changed, 565 insertions(+), 192 deletions(-) create mode 100644 changelog/entries/unreleased/refactor/improve_error_handling_in_frontend.json delete mode 100644 web-frontend/modules/automation/middleware.js create mode 100644 web-frontend/modules/automation/middleware/selectWorkspaceAutomationWorkflow.js delete mode 100644 web-frontend/modules/builder/middleware.js delete mode 100644 web-frontend/modules/core/middleware.js delete mode 100644 web-frontend/modules/core/plugins/errorHandler.js delete mode 100644 web-frontend/modules/dashboard/middleware.js delete mode 100644 web-frontend/modules/database/middleware.js diff --git a/.env.example b/.env.example index 3fc42ca322..99c577cd5b 100644 --- a/.env.example +++ b/.env.example @@ -182,6 +182,7 @@ DATABASE_NAME=baserow # BASEROW_TOTP_ISSUER_NAME= +# Set SENTRY_DSN to `fake` if you want to test sentry logging without sentry itself # SENTRY_DSN= # SENTRY_BACKEND_DSN= diff --git a/backend/src/baserow/config/settings/base.py b/backend/src/baserow/config/settings/base.py index 1caf089e29..c7b09420f7 100644 --- a/backend/src/baserow/config/settings/base.py +++ b/backend/src/baserow/config/settings/base.py @@ -1439,10 +1439,12 @@ def __setitem__(self, key, value): if SENTRY_DSN: import sentry_sdk import sentry_sdk.integrations as _sentry_integrations + from loguru import logger from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber from baserow.core.sentry import ( + ConsoleSentryTransport, drop_expected_asyncio_websocket_ping_timeout_events, ) @@ -1457,6 +1459,15 @@ def __setitem__(self, key, value): ] SENTRY_DENYLIST = DEFAULT_DENYLIST + ["username", "email", "name"] + sentry_transport = None + + if SENTRY_DSN == "fake": + logger.info( + "[SENTRY] Using fake backend Sentry DSN, events will be logged to the " + "console." + ) + SENTRY_DSN = "https://public@example.invalid/1" + sentry_transport = ConsoleSentryTransport() sentry_sdk.init( dsn=SENTRY_DSN, @@ -1465,6 +1476,7 @@ def __setitem__(self, key, value): before_send=drop_expected_asyncio_websocket_ping_timeout_events, event_scrubber=EventScrubber(recursive=True, denylist=SENTRY_DENYLIST), environment=os.getenv("SENTRY_ENVIRONMENT", ""), + transport=sentry_transport, ) else: BASEROW_LAZY_LOADED_LIBRARIES.append("sentry_sdk") diff --git a/backend/src/baserow/core/sentry.py b/backend/src/baserow/core/sentry.py index 2d4bda4b41..a683d90f8f 100644 --- a/backend/src/baserow/core/sentry.py +++ b/backend/src/baserow/core/sentry.py @@ -1,8 +1,67 @@ +import json import logging from typing import Any from django.contrib.auth import get_user_model +from loguru import logger +from sentry_sdk.transport import Transport + +SENTRY_LOG_PREFIX = "[SENTRY]" + + +def _get_sentry_event_message(event: dict[str, Any]) -> str: + exception_values = event.get("exception", {}).get("values", []) + if exception_values: + exception = exception_values[-1] + exception_type = exception.get("type", "UnknownError") + exception_value = exception.get("value", "") + if exception_value: + return f"{exception_type}: {exception_value}" + return exception_type + + log_entry = event.get("logentry", {}) + if log_entry.get("formatted"): + return log_entry["formatted"] + if log_entry.get("message"): + return log_entry["message"] + if event.get("message"): + return str(event["message"]) + + return "Sentry event captured without a message." + + +def log_sentry_event_to_console(event: dict[str, Any]) -> None: + level = str(event.get("level", "error")).upper() + event_id = event.get("event_id", "unknown") + message = _get_sentry_event_message(event) + logger.error(f"{SENTRY_LOG_PREFIX} [{level}] [{event_id}] {message}") + + +class ConsoleSentryTransport(Transport): + """ + A transport that logs Sentry events locally instead of sending them to Sentry. + """ + + def capture_event(self, event): + log_sentry_event_to_console(event) + + def capture_envelope(self, envelope): + for item in envelope.items: + item_type = item.headers.get("type", "unknown") + payload = item.get_bytes().decode("utf-8", errors="replace") + + if item_type == "event": + try: + log_sentry_event_to_console(json.loads(payload)) + continue + except json.JSONDecodeError: + pass + + logger.error( + f"{SENTRY_LOG_PREFIX} [ENVELOPE] [{item_type.upper()}] {payload}" + ) + def drop_expected_asyncio_websocket_ping_timeout_events( event: dict[str, Any], hint: dict[str, Any] diff --git a/backend/tests/baserow/core/test_sentry.py b/backend/tests/baserow/core/test_sentry.py index 18769933d4..ff598e1344 100644 --- a/backend/tests/baserow/core/test_sentry.py +++ b/backend/tests/baserow/core/test_sentry.py @@ -1,6 +1,13 @@ import logging +from unittest.mock import patch -from baserow.core.sentry import drop_expected_asyncio_websocket_ping_timeout_events +from sentry_sdk.envelope import Envelope + +from baserow.core.sentry import ( + ConsoleSentryTransport, + drop_expected_asyncio_websocket_ping_timeout_events, + log_sentry_event_to_console, +) def test_drop_expected_asyncio_websocket_ping_timeout_events(): @@ -44,3 +51,37 @@ def test_drop_expected_asyncio_websocket_ping_timeout_events_keeps_other_errors( ) == event ) + + +@patch("baserow.core.sentry.logger") +def test_log_sentry_event_to_console_logs_exception_with_prefix(mock_logger): + log_sentry_event_to_console( + { + "event_id": "event-123", + "level": "error", + "exception": { + "values": [ + { + "type": "ValueError", + "value": "broken", + } + ] + }, + } + ) + + mock_logger.error.assert_called_once_with( + "[SENTRY] [ERROR] [event-123] ValueError: broken" + ) + + +@patch("baserow.core.sentry.logger") +def test_console_sentry_transport_logs_envelope_payload(mock_logger): + envelope = Envelope(headers={"event_id": "event-123"}) + envelope.add_event({"event_id": "event-123", "message": "Envelope event"}) + + ConsoleSentryTransport().capture_envelope(envelope) + + mock_logger.error.assert_called_once_with( + "[SENTRY] [ERROR] [event-123] Envelope event" + ) diff --git a/changelog/entries/unreleased/refactor/improve_error_handling_in_frontend.json b/changelog/entries/unreleased/refactor/improve_error_handling_in_frontend.json new file mode 100644 index 0000000000..0a9c4b6f2c --- /dev/null +++ b/changelog/entries/unreleased/refactor/improve_error_handling_in_frontend.json @@ -0,0 +1,9 @@ +{ + "type": "refactor", + "message": "Improve error handling in frontend", + "issue_origin": "github", + "issue_number": null, + "domain": "core", + "bullet_points": [], + "created_at": "2026-04-16" +} \ No newline at end of file diff --git a/enterprise/web-frontend/modules/baserow_enterprise/pages/admin/dataScanner.vue b/enterprise/web-frontend/modules/baserow_enterprise/pages/admin/dataScanner.vue index 334825a409..2b2b3596c5 100644 --- a/enterprise/web-frontend/modules/baserow_enterprise/pages/admin/dataScanner.vue +++ b/enterprise/web-frontend/modules/baserow_enterprise/pages/admin/dataScanner.vue @@ -44,10 +44,21 @@ if (!$hasFeature(EnterpriseFeatures.DATA_SCANNER)) { throw createError({ statusCode: 401, message: 'Available in the enterprise version', + data: { + report: false, + }, + fatal: true, }) } if (!store.getters['auth/isStaff']) { - throw createError({ statusCode: 403, message: 'Forbidden.' }) + throw createError({ + statusCode: 403, + message: 'Forbidden.', + data: { + report: false, + }, + fatal: true, + }) } diff --git a/enterprise/web-frontend/modules/baserow_enterprise/pages/auditLog.vue b/enterprise/web-frontend/modules/baserow_enterprise/pages/auditLog.vue index 66b659759c..6931bddd14 100644 --- a/enterprise/web-frontend/modules/baserow_enterprise/pages/auditLog.vue +++ b/enterprise/web-frontend/modules/baserow_enterprise/pages/auditLog.vue @@ -161,6 +161,10 @@ if (workspaceId) { throw createError({ statusCode: 401, message: 'Available in the advanced/enterprise version', + data: { + report: false, + }, + fatal: true, }) } else if ( !$hasPermission( @@ -169,15 +173,33 @@ if (workspaceId) { workspaceId ) ) { - throw createError({ statusCode: 404, message: 'Page not found' }) + throw createError({ + statusCode: 404, + message: 'Page not found', + data: { + report: false, + }, + fatal: true, + }) } } else if (!$hasFeature(EnterpriseFeatures.AUDIT_LOG)) { throw createError({ statusCode: 401, message: 'Available in the advanced/enterprise version', + data: { + report: false, + }, + fatal: true, }) } else if (!store.getters['auth/isStaff']) { - throw createError({ statusCode: 403, message: 'Forbidden.' }) + throw createError({ + statusCode: 403, + message: 'Forbidden.', + data: { + report: false, + }, + fatal: true, + }) } // Template refs diff --git a/premium/web-frontend/modules/baserow_premium/pages/admin/license.vue b/premium/web-frontend/modules/baserow_premium/pages/admin/license.vue index d0136a1004..2a11802625 100644 --- a/premium/web-frontend/modules/baserow_premium/pages/admin/license.vue +++ b/premium/web-frontend/modules/baserow_premium/pages/admin/license.vue @@ -224,10 +224,23 @@ const { data, error } = await useAsyncData( route.params.id ) return licenseData - } catch { + } catch (e) { + const statusCode = e.response?.status || 500 + + if (statusCode === 404) { + throw createError({ + statusCode: 404, + message: 'The license was not found.', + data: { + report: false, + }, + fatal: true, + }) + } throw createError({ - statusCode: 404, - message: 'The license was not found.', + statusCode: statusCode, + message: 'Something went wrong while fetching the licenses.', + fatal: true, }) } } diff --git a/premium/web-frontend/modules/baserow_premium/pages/admin/licenses.vue b/premium/web-frontend/modules/baserow_premium/pages/admin/licenses.vue index d3f262cd66..67c8a39671 100644 --- a/premium/web-frontend/modules/baserow_premium/pages/admin/licenses.vue +++ b/premium/web-frontend/modules/baserow_premium/pages/admin/licenses.vue @@ -181,8 +181,20 @@ const { data, error } = await useAsyncData('licensesPage', async () => { instanceId: instanceData.instance_id, } } catch (e) { + const statusCode = e.response?.status || 500 + + if (statusCode === 404) { + throw createError({ + statusCode: 404, + message: 'Licenses not found.', + data: { + report: false, + }, + fatal: true, + }) + } throw createError({ - statusCode: 400, + statusCode: statusCode, message: 'Something went wrong while fetching the licenses.', fatal: true, }) diff --git a/web-frontend/modules/automation/middleware.js b/web-frontend/modules/automation/middleware.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/web-frontend/modules/automation/middleware/selectWorkspaceAutomationWorkflow.js b/web-frontend/modules/automation/middleware/selectWorkspaceAutomationWorkflow.js new file mode 100644 index 0000000000..adc7e3721a --- /dev/null +++ b/web-frontend/modules/automation/middleware/selectWorkspaceAutomationWorkflow.js @@ -0,0 +1,43 @@ +import { StoreItemLookupError } from '@baserow/modules/core/errors' +import { normalizeError } from '@baserow/modules/database/utils/errors' + +export default defineNuxtRouteMiddleware(async (to) => { + const { $store } = useNuxtApp() + + const automationId = parseInt(to.params.automationId) + const workflowId = parseInt(to.params.workflowId) + + try { + const automation = await $store.dispatch( + 'application/selectById', + automationId + ) + + await $store.dispatch('workspace/selectById', automation.workspace.id) + + await $store.dispatch('automationWorkflow/selectById', { + automation, + workflowId, + }) + } catch (e) { + const isStoreLookupError = e instanceof StoreItemLookupError + if (e.response === undefined && !isStoreLookupError) { + throw e + } + + const errorStatus = + isStoreLookupError || !e.response?.status ? 404 : e.response.status + + throw createError({ + statusCode: errorStatus, + message: + errorStatus === 404 + ? 'Automation workflow not found.' + : normalizeError(e).message, + data: { + report: errorStatus !== 404, + }, + fatal: true, + }) + } +}) diff --git a/web-frontend/modules/automation/module.js b/web-frontend/modules/automation/module.js index 4780193bc9..a4f29e3ad4 100644 --- a/web-frontend/modules/automation/module.js +++ b/web-frontend/modules/automation/module.js @@ -3,6 +3,7 @@ import { addPlugin, createResolver, extendPages, + addRouteMiddleware, } from 'nuxt/kit' import { routes } from './routes' import { locales } from '../../config/locales.js' @@ -24,6 +25,11 @@ export default defineNuxtModule({ src: resolve('./plugins/realtime.js'), }) + addRouteMiddleware({ + name: 'selectWorkspaceAutomationWorkflow', + path: resolve('./middleware/selectWorkspaceAutomationWorkflow.js'), + }) + extendPages((pages) => { pages.push(...routes) }) diff --git a/web-frontend/modules/automation/pages/automationWorkflow.vue b/web-frontend/modules/automation/pages/automationWorkflow.vue index c3f44d805f..03b2706465 100644 --- a/web-frontend/modules/automation/pages/automationWorkflow.vue +++ b/web-frontend/modules/automation/pages/automationWorkflow.vue @@ -16,6 +16,7 @@ import { onBeforeRouteUpdate, onBeforeRouteLeave } from 'vue-router' import AutomationWorkflowContent from '@baserow/modules/automation/components/AutomationWorkflowContent' import { AutomationApplicationType } from '@baserow/modules/automation/applicationTypes' import { StoreItemLookupError } from '@baserow/modules/core/errors' +import { normalizeError } from '@baserow/modules/database/utils/errors' definePageMeta({ layout: 'app', @@ -23,6 +24,7 @@ definePageMeta({ 'settings', 'authenticated', 'workspacesAndApplications', + 'selectWorkspaceAutomationWorkflow', 'pendingJobs', ], }) @@ -38,29 +40,6 @@ const workflowLoading = ref(false) const route = useRoute() const { $store, $registry } = useNuxtApp() -// Parse route params once at setup time -const automationId = computed(() => { - const param = route.params.automationId - if (typeof param === 'string') { - return parseInt(param, 10) - } - if (typeof param === 'number') { - return param - } - return null -}) - -const workflowId = computed(() => { - const param = route.params.workflowId - if (typeof param === 'string') { - return parseInt(param, 10) - } - if (typeof param === 'number') { - return param - } - return null -}) - // Load page data const automationApplicationType = $registry.get( 'application', @@ -68,26 +47,16 @@ const automationApplicationType = $registry.get( ) const { data: pageData, error } = await useAsyncData( - () => `automation-workflow-${automationId.value}-${workflowId.value}`, + () => + `automation-workflow-${route.params.automationId}-${route.params.workflowId}`, async () => { try { - const automation = await $store.dispatch( - 'application/selectById', - automationId.value - ) - - const workspace = await $store.dispatch( - 'workspace/selectById', - automation.workspace.id - ) + const automation = $store.getters['application/getSelected'] + const workspace = $store.getters['workspace/getSelected'] + const workflow = $store.getters['automationWorkflow/getSelected'] await automationApplicationType.loadExtraData(automation) - const workflow = await $store.dispatch('automationWorkflow/selectById', { - automation, - workflowId: workflowId.value, - }) - await $store.dispatch('automationWorkflowNode/fetch', { workflow, }) @@ -100,9 +69,22 @@ const { data: pageData, error } = await useAsyncData( workflow, } } catch (e) { + if (e.response === undefined && !(e instanceof StoreItemLookupError)) { + throw e + } + + const statusCode = e.response?.status || 500 + throw createError({ - statusCode: 404, - message: 'Automation workflow not found.', + statusCode, + message: + statusCode === 404 + ? 'Automation workflow not found.' + : normalizeError(e).message, + data: { + report: statusCode >= 500, + }, + fatal: true, }) } } diff --git a/web-frontend/modules/builder/components/PublicSiteErrorPage.vue b/web-frontend/modules/builder/components/PublicSiteErrorPage.vue index 28ad28987b..b71fa6673e 100644 --- a/web-frontend/modules/builder/components/PublicSiteErrorPage.vue +++ b/web-frontend/modules/builder/components/PublicSiteErrorPage.vue @@ -1,15 +1,22 @@ - +