Demo JsonForms / ConditionFlow

ConditionFlow

From Wikisphere
Jump to navigation Jump to search

This page demonstrates the use of JsonForms to create forms with interactive/conditional flows, and specifically the following features:

  • OO.ui.ButtonSelectWidget for the select (this input allows indeterminate state)
  • x-compact to remove padding and title from the relevant subschema
  • use of x-description-format (set to "wikitext") to display the description of the schema "Request information" using wikitext
  • use of x-dependency to conditionally display a given subschema based on a condition. Only this syntax is used for this form
"x-dependency": {
	"complaint_or_info": "Lodge a complaint"
},

although more complex syntaxes are supported.

  • pagename_formula with a counter (expressed as #count) to create a target article with a dynamic title
  • return_page to redirect the user to a given page after submission
  • remove the form's frame using the parameter no_frame
  • add custom submit buttons using a schema with type "null" and "x-format" equal to "button". The button action if omitted corresponds to its key and the "submit" action is defined here MediaWiki:DefaultEditorOptions (the buttons appear conditionally based on the flow)

Schemas:


Parser function:

{{#jsonforms:Default
|schema=CheckYourCriteria
|action=create
|slot=main
|pagename_formula=CheckYourCriteria/#count
|return_page=CheckYourCriteriaCompleted
|no_frame=true
}}


loading form



See also