Description
A ZType/Z4 will be generally (always?) be a root ZObject. It has three keys:
- Z4K1/Identity: which should NEVER be editable and is also the Zid shown in the page title
- Z4K2/Keys: which is a typed list of Z3/Key and is the main content of a type
- Z4K3/Validator: which is a reference to a function ID and should be editable (for users with the right privileges, of course)
NOTE: We should consider making different designs of this component depending on the privileges of the user seeing it.
For example, a type can only be created by a functioneer and only be edited by a functionmaintainer, so when anyone below functionmaintainer's rights is seeing or editing it:
1) should we hide the add/delete key buttons? and 2) should we hide the whole validator function field?
Desired behavior/Acceptance criteria
- On a first glance, it should show the list of Keys that compose the Type
- ⚠️ Consider whether type component should have expanded more or not: maybe this can be the only way to see and edit the validator function field and we can only show expansion toggle to users with privileges of functionmaintainer
- It should allow to delete keys from the list
- When removing a key from the list, it should reset the ZKey ids to sequential numbers (E.g. when removing Z999K2, it should not leave gaps like [Z999K1, Z999K3])
- It should allow to add new keys to the list
- When initializing a new key, it should set the ZKey id to the next available key (E.g. for type Z999, automatically assign the keys Z999K1, Z999K2, etc.)
Devices and Design (URLs or screenshots)
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist