New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Adds documentation for dynamically hiding editors in Neos UI #2182

Open
wants to merge 5 commits into
base: 3.3
from
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+36 −6
Diff settings

Always

Just for now

@@ -11,9 +11,32 @@ All configuration values that begin with ``ClientEval:`` are dynamically evaluat
the client side. They are written in plain JavaScript (evaluated with ``eval``) and
have ``node`` variable in the scope pointing to the currently focused node, with all
transient inspector changes applied. For now it is only related to the nodetypes
inspector configuration, but in the future may be extended to the other parts of
the user interface.
label and inspector configuration (with the exception of the group and position), but

This comment has been minimized.

@dimaip

dimaip Nov 27, 2018

Member

Label? What label? AFAIK we only do eval on the inspector configuration, no?

in the future may be extended to the other parts of the user interface.

The following data is available in the ``node`` variable:

This comment has been minimized.

@dimaip

dimaip Nov 27, 2018

Member

I'm not really sure it makes sense to describe the full shape of the node object here... It may always change in the future, the data available there is defined by NodeInterface, so we could just say that the node variable holds all data provided by the NodeInterface and give a link to its description. Wdyt?


``children``
An array of all direct children of the node containing an object with the ``nodeType``
of each child.

``depth``
The depth of the node in the node tree.

``identifier``
The identifier of the node.

``label``
The label with which the node is displayed inside the Neos UI.

``name``
The name of the node.

``nodeType``
The Node Type of the node.

``properties``
An object with key–value pairs of all properties of the node.

A few Practical Examples
========================
@@ -22,7 +45,7 @@ Hiding one property when the other one is not set
-------------------------------------------------

Here is an example how to hide the property ``borderColor`` if ``borderWidth`` is empty
by changing its group name to a non-existant value:
by hiding it in the inspector:

.. code-block:: yaml
@@ -37,7 +60,7 @@ by changing its group name to a non-existant value:
type: string
ui:
inspector:
group: 'ClientEval:node.properties.borderWidth ? "style" : "invalid-group"'
hidden: 'ClientEval:node.properties.borderWidth ? false : true'
Dependent SelectBoxes
---------------------
@@ -353,6 +353,9 @@ The following options are allowed:
``position``
Position inside the inspector group, small numbers are sorted on top.

``hidden``
If `true`, the editor of this property won't be shown in the inspector group. May be used for :ref:`dynamic-configuration-processing`.

``editor``
Name of the JavaScript Editor Class which is instantiated to edit this element in the inspector.

@@ -115,9 +115,11 @@ additionalProperties:

'group': { type: ['string', 'null'], description: 'Identifier of the inspector group in which this property should be edited. If not set, will not appear in inspector at all.' }

'position': { type: integer, description: 'Position inside the inspector group, small numbers are sorted on top' }
'position': { type: ['integer', 'null'], description: 'Position inside the inspector group, small numbers are sorted on top.' }

'editor': { type: string, description: 'Name of the JavaScript Editor Class which is instanciated to edit this element in the inspector.' }
'hidden': { type: ['boolean', 'null'], description: 'If TRUE, the editor of this property won't be shown in the inspector group.' }

'editor': { type: ['string', 'null'], description: 'Name of the JavaScript Editor Class which is instanciated to edit this element in the inspector.' }

'editorOptions': { type: dictionary, description: 'options for the given editor' }

@@ -222,6 +224,8 @@ additionalProperties:

'position': { type: integer, description: 'Position of the view, small numbers are sorted on top' }

'hidden': { type: ['boolean', 'null'], description: 'If TRUE, the view won't be shown in the inspector group.' }

'creationDialog':
type: dictionary
additionalProperties: FALSE
ProTip! Use n and p to navigate between commits in a pull request.