Skip to content
Snippets Groups Projects
Commit 89305261 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'dev' into f-data-model-tutorial

parents 55d40838 b10cd532
No related branches found
No related tags found
2 merge requests!109Release 0.11.0,!102Extended documentation for Edit Mode
Pipeline #36308 passed
...@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `form_elements.make_form_modal` and * `form_elements.make_form_modal` and
`form_elements.make_scripting_submission_button` functions to create a form `form_elements.make_scripting_submission_button` functions to create a form
modal and an SSS submission button, respectively. modal and an SSS submission button, respectively.
* Allow to supply a function that creates the form instead of a config to
create_show_form_callback
* `BUILD_MODULE_EXT_ENTITY_ACL_USER_MANAGEMENT_BUTTON` build variable with which * `BUILD_MODULE_EXT_ENTITY_ACL_USER_MANAGEMENT_BUTTON` build variable with which
a button to the user management is added to the navbar for users with role a button to the user management is added to the navbar for users with role
administration if `BUILD_MODULE_EXT_ENTITY_ACL=ENABLED`. administration if `BUILD_MODULE_EXT_ENTITY_ACL=ENABLED`.
......
...@@ -20,11 +20,10 @@ ...@@ -20,11 +20,10 @@
* *
* ** end header * ** end header
--> -->
# Build and install the Web Interface
# Getting Started with the Web Interface
Here, we document how to install and build the CaosDB Web Interface. If you are Here, we document how to install and build the CaosDB Web Interface. If you are
only interested in how to use it, please continue [here](tutorials/first_steps.html) only interested in how to use it, please continue [here](tutorials/index).
## Folder Structure ## Folder Structure
...@@ -73,7 +72,7 @@ See `build.properties.d/00_default.properties` for more information. ...@@ -73,7 +72,7 @@ See `build.properties.d/00_default.properties` for more information.
* Run `make clean` to clean up everything. * Run `make clean` to clean up everything.
## Documentation # ## Build the documentation #
Build documentation in `build/` with `make doc`. Build documentation in `build/` with `make doc`.
......
...@@ -65,15 +65,33 @@ var form_panel = new function () { ...@@ -65,15 +65,33 @@ var form_panel = new function () {
}; };
/** /**
* Creates a callback function that toggles the form panel which * Creates a callback function that creates the form inside
* the form panel when called for the first time.
*
* You may supply 'undefined' as form_config and use form_creator
* instead which is supposed to be a function without argument that
* return the form to be added to the panel
*/ */
this.create_show_form_callback = function (panel_id, title, form_config) { this.create_show_form_callback = function (
panel_id, title, form_config, form_creator=undefined
) {
return (e) => { return (e) => {
logger.trace("enter show_form_panel", e); logger.trace("enter show_form_panel", e);
const panel = $(form_panel.get_form_panel(panel_id, title)); const panel = $(form_panel.get_form_panel(panel_id, title));
if (panel.find("form").length === 0) { if (panel.find("form").length === 0) {
const form = form_elements.make_form(form_config); if (form_config != undefined && form_creator!=undefined){
throw new Error("create_show_form_callback takes either a FormConfig or a function that creates the form");
}
var form;
if (form_config != undefined ){
form = form_elements.make_form(form_config);
} else if (form_creator != undefined ){
form = form_creator();
} else {
throw new Error("create_show_form_callback takes a FormConfig or a function that creates the form");
}
panel.append(form); panel.append(form);
$(form).find(".selectpicker").selectpicker(); $(form).find(".selectpicker").selectpicker();
......
...@@ -70,7 +70,7 @@ master_doc = 'index' ...@@ -70,7 +70,7 @@ master_doc = 'index'
# #
# This is also used if you do content translation via gettext catalogs. # This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases. # Usually you set "language" from the command line for these cases.
language = None language = "en"
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
......
...@@ -7,15 +7,19 @@ Welcome to the documentation of CaosDB's web UI! ...@@ -7,15 +7,19 @@ Welcome to the documentation of CaosDB's web UI!
:caption: Contents: :caption: Contents:
:hidden: :hidden:
Getting started <getting_started> Manual installation <install>
Tutorials <tutorials/index> Tutorials <tutorials/index>
Concepts <concepts> Concepts <concepts>
administration/index.rst administration/index.rst
Extending the UI <extension> Extending the UI <extension>
API <api/index> API <api/index>
.. note::
This documentation helps you to :doc:`get started<getting_started>`, explains the most important Go to `demo.indiscale.com <https://demo.indiscale.com>`__ and take the interactive tour to learn
how to use LinkAhead's web interface.
This documentation helps you to :doc:`install the web UI <install>`, explains the most important
:doc:`concepts<concepts>` and offers a range of :doc:`tutorials<tutorials/index>`. :doc:`concepts<concepts>` and offers a range of :doc:`tutorials<tutorials/index>`.
......
File moved
...@@ -58,6 +58,15 @@ QUnit.test("create_show_form_callback ", function (assert) { ...@@ -58,6 +58,15 @@ QUnit.test("create_show_form_callback ", function (assert) {
const cb = form_panel.create_show_form_callback(panel_id, title, csv_form_config); const cb = form_panel.create_show_form_callback(panel_id, title, csv_form_config);
assert.equal(typeof cb, "function", "function created"); assert.equal(typeof cb, "function", "function created");
cb() cb()
const creator = function() {
return form_elements.make_form(csv_form_config);
}
const cb2 = form_panel.create_show_form_callback(
panel_id, title, undefined, creator
);
assert.equal(typeof cb2, "function", "function created");
cb2()
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment