From 11e64cf9523793b88918c0ce6d107a9e61fae234 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 14 Sep 2019 16:20:46 +0100 Subject: [PATCH] Reverted form description name to "schema". Backwards compatible --- docs/source/plugins/example/forms.json | 4 +- docs/source/plugins/forms_example.json | 4 +- docs/source/plugins/schema/json_schema.rst | 5 - docs/source/plugins/schema/schema.json | 187 ------------------ .../plugins/testing/form_example/forms.json | 4 +- 5 files changed, 6 insertions(+), 198 deletions(-) delete mode 100644 docs/source/plugins/schema/json_schema.rst delete mode 100644 docs/source/plugins/schema/schema.json diff --git a/docs/source/plugins/example/forms.json b/docs/source/plugins/example/forms.json index 8832a944..58364150 100644 --- a/docs/source/plugins/example/forms.json +++ b/docs/source/plugins/example/forms.json @@ -7,7 +7,7 @@ "isTask": false, "selfUpdate": true, "route": "/hello", - "form": [ + "schema": [ { "fieldType": "textInput", "placeholder": "Enter a string", @@ -21,7 +21,7 @@ "isTask": true, "route": "/timelapse", "submitLabel": "Start timelapse", - "form": [ + "schema": [ { "fieldType": "numberInput", "name": "n_images", diff --git a/docs/source/plugins/forms_example.json b/docs/source/plugins/forms_example.json index 9b8358f1..07b348d2 100644 --- a/docs/source/plugins/forms_example.json +++ b/docs/source/plugins/forms_example.json @@ -9,7 +9,7 @@ "selfUpdate": true, "route": "/do", "submitLabel": "Do things", - "form": [ + "schema": [ { "fieldType": "numberInput", "placeholder": "Some integer", @@ -75,7 +75,7 @@ "selfUpdate": true, "route": "/task", "submitLabel": "Start task", - "form": [ + "schema": [ { "fieldType": "numberInput", "name": "run_time", diff --git a/docs/source/plugins/schema/json_schema.rst b/docs/source/plugins/schema/json_schema.rst deleted file mode 100644 index 59cbf401..00000000 --- a/docs/source/plugins/schema/json_schema.rst +++ /dev/null @@ -1,5 +0,0 @@ -Full JSON Form -================ - -.. literalinclude:: schema.json - :language: JSON diff --git a/docs/source/plugins/schema/schema.json b/docs/source/plugins/schema/schema.json deleted file mode 100644 index 0a216944..00000000 --- a/docs/source/plugins/schema/schema.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "definitions": {}, - "$form": "http://json-form.org/draft-07/form#", - "$id": "http://example.com/root.json", - "type": "object", - "title": "The Root Form", - "required": [ - "id", - "icon", - "forms" - ], - "properties": { - "id": { - "$id": "#/properties/id", - "type": "string", - "title": "Unique ID", - "description": "A unique name for the plugin UI", - "default": "", - "examples": [ - "test-plugin" - ], - "pattern": "^(.*)$" - }, - "icon": { - "$id": "#/properties/icon", - "type": "string", - "title": "Icon name", - "description": "Name of the Material Design icon to use for the plugin tab", - "default": "", - "examples": [ - "pets" - ], - "pattern": "^(.*)$" - }, - "forms": { - "$id": "#/properties/forms", - "type": "array", - "title": "Forms array", - "description": "Array of form descriptions to be displayed", - "default": null, - "items": { - "$id": "#/properties/forms/items", - "type": "object", - "title": "The Items Form", - "required": [ - "name", - "route", - "form" - ], - "properties": { - "name": { - "$id": "#/properties/forms/items/properties/name", - "type": "string", - "title": "Form name", - "description": "Human-readable form name", - "default": "", - "examples": [ - "Simple request" - ], - "pattern": "^(.*)$" - }, - "isCollapsible": { - "$id": "#/properties/forms/items/properties/isCollapsible", - "type": "boolean", - "title": "The isCollapsible Form", - "description": "Should the form be rendered as a collapsible item", - "default": false, - "examples": [ - true - ] - }, - "isTask": { - "$id": "#/properties/forms/items/properties/isTask", - "type": "boolean", - "title": "The isTask Form", - "description": "Should the form's submit function be treated as a long-running task", - "default": false, - "examples": [ - false - ] - }, - "selfUpdate": { - "$id": "#/properties/forms/items/properties/selfUpdate", - "type": "boolean", - "title": "The selfUpdate Form", - "description": "Should the form's component values be automatically updated with a GET request", - "default": false, - "examples": [ - true - ] - }, - "route": { - "$id": "#/properties/forms/items/properties/route", - "type": "string", - "title": "The Route Form", - "description": "Form submit POST request's corresponding api_views route", - "default": "", - "examples": [ - "/do" - ], - "pattern": "^(.*)$" - }, - "submitLabel": { - "$id": "#/properties/forms/items/properties/submitLabel", - "type": "string", - "title": "The submitLabel Form", - "description": "String to place in submit button", - "default": "Submit", - "examples": [ - "Do my function" - ], - "pattern": "^(.*)$" - }, - "form": { - "$id": "#/properties/forms/items/properties/form", - "type": "array", - "title": "Form component array", - "items": { - "$id": "#/properties/forms/items/properties/form/items", - "type": "object", - "title": "A form component", - "required": [ - "fieldType", - "name" - ], - "properties": { - "fieldType": { - "$id": "#/properties/forms/items/properties/form/items/properties/fieldType", - "type": "string", - "title": "Component type", - "default": "", - "examples": [ - "numberInput", - "textInput", - "radioList", - "checkList", - "htmlBlock", - "selectList", - "textInput", - "keyvalList", - "taglList" - ], - "pattern": "^(.*)$" - }, - "placeholder": { - "$id": "#/properties/forms/items/properties/form/items/properties/placeholder", - "type": "string", - "title": "Component placeholder value", - "default": "", - "examples": [ - "Enter your name" - ], - "pattern": "^(.*)$" - }, - "name": { - "$id": "#/properties/forms/items/properties/form/items/properties/name", - "type": "string", - "title": "Unique component name", - "examples": [ - "my_form_component_1" - ], - "pattern": "^(.*)$" - }, - "label": { - "$id": "#/properties/forms/items/properties/form/items/properties/label", - "type": "string", - "title": "Component label (if applicable)", - "default": "", - "examples": [ - "My form component" - ], - "pattern": "^(.*)$" - }, - "value": { - "$id": "#/properties/forms/items/properties/form/items/properties/value", - "type": ["array", "boolean", "integer", "number", "object", "string"], - "title": "Component value", - "pattern": "^(.*)$" - } - } - } - } - } - } - } - } - } \ No newline at end of file diff --git a/openflexure_microscope/plugins/testing/form_example/forms.json b/openflexure_microscope/plugins/testing/form_example/forms.json index ab99d8c5..4aee4dcd 100644 --- a/openflexure_microscope/plugins/testing/form_example/forms.json +++ b/openflexure_microscope/plugins/testing/form_example/forms.json @@ -9,7 +9,7 @@ "selfUpdate": true, "route": "/do", "submitLabel": "Do things", - "form": [ + "schema": [ [ { "fieldType": "numberInput", @@ -66,7 +66,7 @@ "selfUpdate": true, "route": "/task", "submitLabel": "Start task", - "form": [ + "schema": [ { "fieldType": "numberInput", "placeholder": "",