Data model editor
Request
User story
As a Bip administrator, I want a GUI to create data models, instead of having to write yaml files.
Detailed problematic
The data model is a descriptor used at a project creation to generate all the entities tags that define the project's workflow. It also can can pre-populate some of those tags.
A model describes:
- Item tags
- Component tags
- Task tags
- Group tags
- Groups
- Definitions
See an example of a data model here.
Current workflow
- The model is written is a yml file.
- The model is registered to the database with
link.model.register_from_file()
.
Suggested workflow
- Open Clafoutis, go to Administration > Projects > Models
- Existing models are listed
- Hit "New model" opens the editor
- The user compose their model by adding tags, and editing their properties
Needed features
- Create a descriptor from a GUI.
- Slug automatically generated from name by default, optionnaly editable.
-
limits
,required_memberships
oroptional_memberships
must be linked to existing entities in the draft. - Export to yml.
- Import from yml.
Optional features
- Path pattern compositor: Dynamic and intuitive widget for composing a path pattern?
- Name pattern tester: Overlay for quickly testing name_pattern regex with a test input?
- Passive on-the-fly validation for as much fields as possible. For example, if a folder name is not valid when the focus leaves the QEditLine widget, highlight the field in red with an explanatory text.
- Check if
name_hint
matchesname_pattern
's regex. - ...
Implementation
- The view should be in Administration > Projects > Model
- See the following template files for the application dataflow:
clafoutis/ui/admin/models/main.py
clafoutis/ui/admin/models/list.py
clafoutis/ui/admin/models/edit.py
Development notes
-
Mandatory fields vs optionnal: Since the API is not yet documented, you have to check the
_validate()
method of the corresponding entity in the API to know what attributes are mandatory. - **Hardocoded default values: Since the API is not yet documented, you have to check the
__init__()
method of the corresponding entity in the API to know what are the hardcoded default values of attributes. -
Dynamic default values: Since the API is not yet documented, you have to check the
_default()
method of the corresponding entity in the API to know how default values are generated. -
Descriptor validation rules: Check
link.model._validate_descriptor()
in order to know the validation rules of a model descriptor (mandatory fields...) -
Validation is handled by the
link
API, so it is not up to the UI to check if the model built is valid. Although for a better user experience, some of the validation rules might need to be replicated on the UI side so that inconsistencies are highlighted before hitting "save".
Suggested development workflow
- Follow the UX workflow: Drawing > Wireframing > Prototyping (Check UX tools such as Figma, Penpot... They are more web-oriented, but it's a good excuse to see how UX designer work)
- Design several UI proposal, with different approaches (property side panel or popup? list? tabs?)
Design
To be filled by the developer
This section's structure really depends on the request. But essentially, any developer reading the design should be able to start implementing it without thinking.
Scenario
How will the request be implemented. Which design pattern will be used...
Structure
How will the implementation be organized. Logical diagrams, UML charts, scripts file structure...
Research and development
Optional. If the request necessities exploring new territories (e.g. use of external libs), report here the conclusions of your tests.
Needed modifications
Optional. If existing code must be changed, list those changes here and check the effects of those modifications.
Pseudo-code
Optional. Fake-code can be very useful for finding the best structure, especially if building API features.
UI Mock-ups
Optional. Add here any draft of how should look the result of your request, if GUI.
Material
Sandbox material, used for tests, demos and research. Depending on the domain, it can be a scene, some files, a dataset...
Tasks
Tasks are to be updated at each major step of the sprint. Tasks must be as granular as possible. Tasks must be time-estimated.
-
Redact request