FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

Adds support for nested models and array elements in DisplayLookup

Open Dejiah opened this issue 1 year ago • 1 comments

fixes #86.

I found a simple way to implement a deep lookup in the object via a path without adding additional dependencies.

The syntax looks like this:

  • fieldName for a plain (not-nested) lookup.
  • arrayField.0 for looking up the 1st element of the array stored in arrayField. Can take .x for looking up the x-th element.
  • nested.attribute_1 for looking up the (nested) field attribute_1 in the top-level attribute nested.
  • any combinations of the above such as nested.arrayField.1.attribute_1

Also, added an example to the demo page for the Users table.

Dejiah avatar Dec 30 '23 20:12 Dejiah

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Dec 30 '23 20:12 codecov[bot]