sciapp / sampledb

Sample and Measurement Metadata Database
https://scientific-it-systems.iffgit.fz-juelich.de/SampleDB/
MIT License
21 stars 11 forks source link

Current user is not auto-filled with option "default": "self" #42

Closed NilsWeber98 closed 1 year ago

NilsWeber98 commented 1 year ago

Dear all, while creating some actions I came across the nice feature to auto-fill user references with the current user, as it says in the docs. If I understand it correctly, I just need to add the option "default": "self".

Maybe I am wrong, but I think the auto-fill option is currently not working. See below for a minimal action where this problem occurs:

{
    "title": "",
    "type": "object",
    "properties": {
        "name": {
            "title": "Name",
            "type": "text"
        },
        "user": {
            "title": "User",
            "type": "user"
        }
    },
    "required": [
        "name",
        "user"
    ],
    "propertyOrder": [
        "name",
        "user"
    ]
}

In the corresponding action, user is not auto-filled with the current user:

image

NilsWeber98 commented 1 year ago

We are currently working with the version based on https://github.com/sciapp/sampledb/commit/04dff4bc0feae2bb41f606ea8bf2241a45c79d99

FlorianRhiem commented 1 year ago

Thank you for the bug report, I can confirm this is currently broken as the check for a default value is missing. Should be easy to fix.

FlorianRhiem commented 1 year ago

This was fixed in this commit, along with tests for the correct behavior.