You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/04/27 19:44:26 UTC

[airavata-django-portal] 01/02: AIRAVATA-2769 Documenting expected schema for application input metadata

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit e669c8ea9ce69255e022c61a1268c10f90522952
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Fri Apr 27 15:43:42 2018 -0400

    AIRAVATA-2769 Documenting expected schema for application input metadata
---
 .../js/models/InputDataObjectType.js               | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js b/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
index 6b27ad6..06cd623 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
@@ -27,6 +27,18 @@ export default class InputDataObjectType extends BaseModel {
         super(FIELDS, data);
     }
 
+    /**
+     * Get the UI component id for the editor component to use for this input.
+     * Returns null if there is no editor UI component id.
+     *
+     * The expected JSON schema for the editor UI component id is the following:
+     * {
+     *   "editor": {
+     *     "ui-component-id": "input-editor-component-id",
+     *     ...
+     *   }
+     * }
+     */
     get editorUIComponentId() {
         const metadata = this._getMetadata();
         if (metadata && 'editor' in metadata && 'ui-component-id' in metadata['editor']) {
@@ -36,6 +48,21 @@ export default class InputDataObjectType extends BaseModel {
         }
     }
 
+    /**
+     * Get the configuration for the editor component, which will be available
+     * to the editor component for customizing its look and functionality.
+     * Returns empty object if there is no editor config.
+     *
+     * The expected JSON schema for the editor config is the following:
+     * {
+     *   "editor": {
+     *     "config": {
+     *       ... anything can go here ...
+     *     }
+     *     ...
+     *   }
+     * }
+     */
     get editorConfig() {
         const metadata = this._getMetadata();
         if (metadata && 'editor' in metadata && 'config' in metadata['editor']) {
@@ -45,6 +72,28 @@ export default class InputDataObjectType extends BaseModel {
         }
     }
 
+    /**
+     * Get the validations for the editor component. See ValidatorFactory for a
+     * list of available validations. Returns empty array if there are no
+     * validations.
+     *
+     * The expected JSON schema for the editor validations is the following:
+     * {
+     *   "editor": {
+     *     "validations": [
+     *       {
+     *         "type": "validation-name",
+     *         "value": "some value for configuring validation, passed to validator constructor",
+     *         "message": "(Optional) custom validation error message"
+     *       },
+     *       ... additional validations go here ...
+     *     ]
+     *     ...
+     *   }
+     * }
+     *
+     * Note: "message" is optional for all validations.
+     */
     get editorValidations() {
         const metadata = this._getMetadata();
         if (metadata && 'editor' in metadata && 'validations' in metadata['editor']) {

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.