Arkisto-Platform / describo-online

https://describo.github.io
GNU General Public License v3.0
7 stars 2 forks source link

Property grouping in the UI #46

Closed marcolarosa closed 2 years ago

marcolarosa commented 2 years ago

Following discussion with @ptsefton

Add a layout property to each class defined in the profile that is an array of objects as follows:

    "Dataset": {
            "definition": "override",
            "subClassOf": [],
            "layout": [
                { name: "group1", description: "", inputs: [ "location", "name", "place"] },
                { name: "group2", description: "", inputs: [ "contributor", "annotator" ] }
                { name: "...", leftover things not grouped }
            ],
           ...

Any properties not defined in the layout must be added to the final tab in alphabetical order.

If a class does not have a layout property then properties must be listed in alphabetical order.

marcolarosa commented 2 years ago

Update:

In order to support entities with a plurality of types (e.g. Dataset, SoftwareSourceCode) the layouts prop will be moved to the root of the profile and be an object keyed on the sorted and then stringified type.

Something like:

"layouts": {
    "Dataset": [
            { name: "group1", description: "", inputs: [ "location", "name", "place"] },
            { name: "group2", description: "", inputs: [ "contributor", "annotator" ] }
            { name: "...", leftover things not grouped }
    ],
    "Dataset, SoftwareSourceCode": [ ... layout definitions ... ]
  }
marcolarosa commented 2 years ago

Documentation: https://github.com/Arkisto-Platform/describo-online/wiki/Writing-a-domain-specific-profile#layouts