skohub-io / skohub-editor

Apache License 2.0
5 stars 4 forks source link

Support placeholders #25

Closed acka47 closed 4 years ago

acka47 commented 4 years ago

I would like to configure a placeholder for a field in the web form. This could look something like this:

{
        "isBasedOn":{
            "title":"Based on",
            "type":"string",
            "format":"uri",
            "_placeholder": "Another OER this resource is derived from"
        }
}
acka47 commented 4 years ago

@literarymachine let me know that there already exists something but it is not clear whether and how it is currently supported. I will try it out.

"name":{
            "title":"Title",
            "type":"string",
            "_display":{
                "placeholder": "foobar"
            }
        }
acka47 commented 4 years ago

This seems to work in general, see "Creation Date" and "Language" in https://test.skohub.io/editor/?schema=https://raw.githubusercontent.com/hbz/skohub-editor/updateSchema/src/json/generic-oer-schema.json.

I don't understand why the placeholder is not shown in the "Based on" field, see the relevant schema lines: https://github.com/hbz/skohub-editor/blob/6d3df5a3cfbd8d6dcb0d89b6805179fe95053057/src/json/generic-oer-schema.json#L276-L278

acka47 commented 4 years ago

don't understand why the placeholder is not shown in the "Based on" field

It works, when moving the _placeholder to the items object, see https://github.com/hbz/skohub-editor/blob/4c9280f02a73112a3ce956ccd1722e261cc4c75d/src/json/generic-oer-schema.json#L272-L278

Closing.