#3572908 Include default working widget

Closes #3572908

This adds a default widget for very basic usage, where the schema and UI schema are defined in the field form settings.

Heavily uses code contributed by @viappidu in !7.

Also adds a ddev-init script to make local dev/testing easier, and removes some (though unfortunately not all) lingering DKAN references.

Testing

  1. Enable the json_form_widget_basic module
  2. Create a new content type, and add a long string field
  3. Go to form settings, and chose the JSON Form Widget (Basic) widget
  4. Open the widget settings, and copy/paste in the schema and UI schema included below
  5. Create a new node for your content type, confirm that the form looks as expected (you see address fields, certain fields are required, and the PO Box field is unreasonably long)

Example schemas

{
    "$id": "https://example.com/address.schema.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "An address similar to http://microformats.org/wiki/h-card",
    "type": "object",
    "properties": {
        "postOfficeBox": {
            "title": "PO Box",
            "type": "string"
        },
        "extendedAddress": {
            "title": "Extended Address",
            "type": "string"
        },
        "streetAddress": {
            "title": "Street Address",
            "type": "string"
        },
        "locality": {
            "title": "Locality",
            "type": "string"
        },
        "region": {
            "title": "Region",
            "type": "string"
        },
        "postalCode": {
            "title": "Postal Code",
            "type": "string"
        },
        "countryName": {
            "title": "Country Name",
            "type": "string"
        }
    },
    "required": [
        "locality",
        "region",
        "countryName"
    ]
}
{
  "postOfficeBox": {
    "ui:options": {
      "widget": "textarea",
      "rows": 10,
      "description": "Much longer description of PO box",
      "weight": 1
    }
  }
}
Edited by Dan Feder

Merge request reports

Loading