Pydantic models for UI config.
The UI configuration used in nomad.yaml is not documented and properly validated. Also, the usage of this UI config in javascript should be simplified.
Tasks:
-
The UI configuration should be based on pydantic models. These models should be included in the docs. -
Some of the UI config naming/structure should be refactored: -
The unit systems will become much more configurable in the near future. To prepare for this, the simple default_unit_system
field should be fleshed out into a property unit system setup that will allow the user to define custom unit systems. -
The use of React-specific names should be removed: entry
instead ofentry_context
,apps
instead ofsearch_contexts
.
-
-
Improved the serialization of pydantic models in the docs: -
Fields defined with type Enum
should show up with typestr
, and the options should be spelled out. -
Nested type definitions should be handled correctly. Currently the outermost container is not shown ( field.type_
vsfield.outer_type_
), the pydantic models within these containers are not correctly recursively added to the docs and the names of some pydantic types are too verbose (e.g.typing.Union
vsUnion
).
-
-
Add an example of how you can modify the UI config using the include
/exclude
/options
structure (config.html#user-interface-customization). In principle, we could replace this structure with a simple list of options, but I think that many of the real-life use cases then become harder to achieve with a customnomad.yaml
. -
The UI config in the frontend should be "normalized" once at startup. This should transform all the include
/exclude
/options
objects into a simpler object that only contains the available options.
Edited by Lauri Himanen