Skip to content

Resolve "When page parameters change, the table link fields pointing to that page are not updated properly"

What is in this MR

This merge request ensures that in both LinkElement and LinkField, when a destination page's parameters change, an error message appears asking the page designer to update the link's parameters.

Screenshot_2024-01-26_at_11.29.38

Improvements have also been made to inform the designer where the error is:

  1. TableElementType now implements isInError, which iterates over its fields, detecting if any are in error.
  2. CollectionFieldType now implements isInError too, which only LinkCollectionFieldType will use. If it detects that its own parameters are in error, it'll return true.

The result is that per TableElement field, we can see if links are invalid when the field is collapsed.

Screenshot_2024-01-26_at_11.39.47

How to test this MR

  • Add a LinkElement to the page.
    • Set its navigation type to a page (destinationPage) with one or more parameters.
  • Add a TableElement to the page.
    • Add a field of type link.
      • Set its navigation type to a page (destinationPage) with one or more parameters.
  • Modify destinationPage so that its page parameter is different.
  • Both LinkElement and TableElement should have a warning circle in the preview editor.
  • In LinkElementForm the "The saved parameters don't match" error box should be visible.
  • In TableElementForm the "The saved parameters don't match" error box should be visible in the relevant field.

Merge Request Checklist

  • changelog.md has been updated if required.
  • New/updated Premium/Enterprise features are separated correctly in the premium or enterprise folder
  • The latest Chrome and Firefox have been used to test any new frontend features
  • Documentation has been updated
  • Quality Standards are met
  • Performance: tables are still fast with 100k+ rows, 100+ field tables
  • The redoc API pages have been updated for any REST API changes
  • Our custom API docs are updated for changes to endpoints accessed via api tokens
  • The UI/UX has been updated following UI Style Guide

Closes #2298 (closed)

Edited by Peter Evans

Merge request reports