28 Jun 2022
01:28 AM
- last edited on
29 Jun 2022
07:16 AM
by
MaciejNeumann
Use case: Enabling filtering and filter bars to entity lists of screens created from an Extension 2.0 YAML.
Example context: I have an entity type "my:interface" that has a RUNS_ON relationship to an entity type "my:device". I have an Entities List card which already lists all "my:interface" entities I want to filter.
All definitions are given based on schema version 1.239 and may or may not change in the future.
Example 1: I want to filter my list by the interface names.
YAML definition:
filtering:
entityFilters:
- displayName: Interface
filters:
- type: entityName
displayName: Name
freeText: true
modifier: contains
defaultSearch: true
distinct: false
entityTypes:
- my:interface
YAML explanation:
Example 2: Given example 1, I also want to filter by the device these interfaces are running on
YAML definition:
filtering:
relationships:
- type(my:device),toRelationships.runsOn($(entityConditions))
entityFilters:
- displayName: Interface
filters:
- type: entityName
displayName: Name
freeText: true
modifier: contains
defaultSearch: true
distinct: false
entityTypes:
- my:interface
- displayName: Related entity
filters:
- type: entityName
displayName: Device name
freeText: false
defaultSearch: false
distinct: true
entityTypes:
- my:device
YAML Explanation:
Most of the definition is the same as above. Changes include: