Skip to content

F fix hidden prop in preview

Florian Spreckelsen requested to merge f-fix-hidden-prop-in-preview into dev

Summary

For https://gitlab.indiscale.com/caosdb/customers/leibniz-zmt/management/-/issues/163. Fixes a bug whereby the properties of referenced entities would not be shown in previews if BUILD_MODULE_EXT_PROPERTY_DISPLAY was enabled.

Focus

(Un)hiding of properties is done upon successful retrieval of entities for preview. This is not really unit-testable, since it requires retrieving the referenced entities for preview from the server.

Test Environment

Manual testing only. From !86 (merged):

Start a caosdb-server and caosdb-webui with a valid ext_prop_display.json config file and BUILD_MODULE_EXT_PROPERTY_DISPLAY=ENABLED.

For example, use the LinkAhead demo profile in this branch, add BUILD_MODULE_EXT_PROPERTY_DISPLAY=ENABLED to profiles/demo/custom/caosdb-server/caosdb-webui/build.properties.d/99.demo.conf and add the following contents in a profiles/demo/custom/caosdb-server/caosdb-webui/conf/ext/json/ext_prop_display.json:

{
    "MusicalInstrument": {
        "hide": [
            {"name": "price", "roles": ["anonymous"], "users": []},
            {"name": "Manufacturer", "roles": [], "users": ["admin"]}
        ]
    }
}

(feel free to add to and change the config).

Verify that previews of refernced MusicalInstruments (e.g., FIND RECORD WHICH REFERENCES A MusicalInstrument), the correct properties are shown/hidden.

Then, check that for BUILD_MODULE_EXT_PROPERTY_DISPLAY=DISABLED or after deleting profiles/demo/custom/caosdb-server/caosdb-webui/conf/ext/json/ext_prop_display.json, all properties are shown in these previews.

Check List for the Author

Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines

  • All automated tests pass
  • Reference related issues
  • Up-to-date CHANGELOG.md (or not necessary)
  • Annotations in code (Gitlab comments)
    • Intent of new code
    • Problems with old code
    • Why this implementation?

Check List for the Reviewer

  • I understand the intent of this MR
  • All automated tests pass
  • Up-to-date CHANGELOG.md (or not necessary)
  • The test environment setup works and the intended behavior is reproducible in the test environment
  • In-code documentation and comments are up-to-date.
  • Check: Are there specifications? Are they satisfied?

For further good practices have a look at our review guidelines.

Edited by Daniel Hornung

Merge request reports