From 7af8b6eb742fe3961fa7aba178ca1c9fd7c65aab Mon Sep 17 00:00:00 2001 From: Manon Bourgognon <manon.bourgognon@epitech.eu> Date: Tue, 2 Mar 2021 17:37:26 +0100 Subject: [PATCH] add empty-[set] and empty-[set]-value attributes --- .../Mixins/sorter-mixin.rst | 2 +- .../Mixins/widget-mixin.rst | 27 +++++++++++++++++++ .../import_documentation/attributes-list.rst | 8 ++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/source/import_documentation/Mixins/sorter-mixin.rst b/source/import_documentation/Mixins/sorter-mixin.rst index 6ef23ef..33b70e0 100644 --- a/source/import_documentation/Mixins/sorter-mixin.rst +++ b/source/import_documentation/Mixins/sorter-mixin.rst @@ -53,7 +53,7 @@ Attributes The ``fields`` attribute of ``<solid-form-search>`` must at least contain ``field``. ``Field`` attribute contains the fields of the resource to be offered to the user for sorting the data. - ``Order`` attribute allows you to propose 2 sorting orders: ascending (``asc`) and descending (``desc``). + ``Order`` attribute allows you to propose 2 sorting orders: ascending (``asc``) and descending (``desc``). By default, the order is ascending. The ``<solid-display>`` cannot combine ``order-asc`` or ``order-desc`` attribute AND ``sorted-by`` attribute. diff --git a/source/import_documentation/Mixins/widget-mixin.rst b/source/import_documentation/Mixins/widget-mixin.rst index 083585f..29319da 100644 --- a/source/import_documentation/Mixins/widget-mixin.rst +++ b/source/import_documentation/Mixins/widget-mixin.rst @@ -136,6 +136,33 @@ Attributes Set the alt for the field ``[field]``. +``empty-[set]`` +~~~~~~~~~~~~~~~ + *Available from version 0.17* + + Name of the widget to display when all the fields in ``[set]`` are empty. + +``empty-[set]-value`` +~~~~~~~~~~~~~~~~~~~~~ + *Available from version 0.17* + + Value to pass to the empty widget if all fields in ``[set]`` are empty. It is accessible in ``${value}`` + + .. code:: html + + <solid-display + data-src="http://server/users/" + fields="fullname(first_name, last_name)" + empty-fullname="no-name-widget" + empty-fullname-value="add-name" + ></solid-display> + + <solid-widget name="no-name-widget"> + <template> + <small>No fullname filled in. <solid-link next="${value}">click here to add one</solid-link></small> + </template> + </solid-widget> + ``multiple-[field]`` ~~~~~~~~~~~~~~~~~~~~ Allows to display the container ``[field]`` nested in the current resource. diff --git a/source/import_documentation/attributes-list.rst b/source/import_documentation/attributes-list.rst index 3ac73e4..930c093 100644 --- a/source/import_documentation/attributes-list.rst +++ b/source/import_documentation/attributes-list.rst @@ -83,6 +83,14 @@ List of attributes (core framework) ~~~~~~~~~~~~~~~~~~~~ * :ref:`widget-mixin <widget-mixin>` +``empty-[set]`` +~~~~~~~~~~~~~~~ + * :ref:`widget-mixin <widget-mixin>` + +``empty-[set]-value`` +~~~~~~~~~~~~~~~~~~~~~ + * :ref:`widget-mixin <widget-mixin>` + ``empty-value`` ~~~~~~~~~~~~~~~ * :ref:`list-mixin <list-mixin>` -- GitLab