jmix-projects / jmix-ui

DEPRECATED. Use https://github.com/jmix-framework/jmix
https://www.jmix.io
3 stars 7 forks source link

Filter component should allow filtering by references to entities from other data stores #636

Closed knstvk closed 3 years ago

knstvk commented 3 years ago

Now the filter doesn't show in "Add condition" dialog attributes which are references to entities from other data stores.


Changes

Now Filter can perform filtering by property that is association with entity from another DataStore.

For instance, we have the following stores and entities:

GuestInfo has Person property with single value cardinality. The code of GuestInfo:

@JmixEntity
@Table(name = "GUEST_INFO")
@Entity(name = "master_GuestInfo")
public class GuestInfo {
    @JmixGeneratedValue
    @Column(name = "ID", nullable = false)
    @Id
    private UUID id;

    @SystemLevel
    @Column(name = "PERSON_ID")
    private UUID personId;

    @DependsOnProperties({"personId"})
    @JmixProperty
    @Transient
    private Person person;

    // other fields

    // getters and setters

For the GuestInfo entity will able to show the Person attribute in conditions:

image

Limitations

Filter with KeyValueEntity does not support this functionality and won't show such properties in the UI.

QA

Download demo project: demo.zip

  1. Check that property is shown in "Add condition" dialog and in the Add condition -> Create -> Create Property Condition dialog. Try to filter by this property.
  2. Check that property is not shown for the KeyValueEntity.
maistrenkoIulia commented 3 years ago

verifid