jmix-projects / jmix-ui

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

Export of FilterConfiguration does not work #762

Closed GlebDurygin closed 2 years ago

GlebDurygin commented 2 years ago

Forum topic: https://forum.jmix.ru/t/ne-rabotaet-eksport-konfiguraczii-filtrov-v-inspektore-sushhnostej/247

Solution

EntityAttributeSerializationExtension

An extension point (class EntityAttributeSerializationExtension) has been added to the mechanism for serializing and deserializing an entity to JSON, which is implemented in the EntitySerialization bean. The user can use this extension point to define their own logic for serializing and deserializing the entity attribute value to JSON. The desired extension is selected using the EntityAttributeSerializationExtension#supports(MetaProperty) method.

For the filter configuration, its own implementation of the extension was created (see FilterConditionAttributeSerializationExtension). The user can override this behavior by creating an extension as a bean and setting it to a higher order than the FilterConditionAttributeSerializationExtension.

EntityAttributeImportExtension

An extension point (class EntityAttributeImportExtension) has been added to the entity import mechanism, which is implemented in the EntityImportExport bean. The user can use this extension point to define their own logic for importing the entity attribute value. The desired extension is selected using the EntityAttributeImportExtension#supports(MetaProperty) method.

For the filter configuration, its own implementation of the extension was created (see FilterConditionAttributeImportExtension). The user can override this behavior by creating an extension as a bean and setting it to a higher order than the FilterConditionAttributeImportExtension.

QA

Check that user can import and export FilterConfiguration

kendovitskii commented 2 years ago

failed at Navigating to filtered-tab gives NullPointerException error, after importing FilterConfiguration from ZIP archive TC:

  1. Create new project
  2. Add Data Tools addon
  3. Run application -> open app from http://localhost:8080
  4. Go to Users-> Click - add search condition ("contains: adm" for example) -> click properties -> save with values
  5. Go to -> Administration->Entity Inspector
  6. In "Entity type" choose -> Configuration (ui_FilterConfiguration)
  7. Export created configuration as JSON and as ZIP files
  8. Delete configuration
  9. Try import configuration from ZIP and from JSON files

ER: Configuration successfully imported from both files and filter-preset is visible in the Users tab AR: NullPointerException error when importing from ZIP file and navigating to the Users tab

stacktrace in attachments stacktrace8.txt

kendovitskii commented 2 years ago

Verified on platform version 1.2.0-RC1