In order to better capture recommendation cycles that are specific to the different HR bodies, we are introducing nested categories. Specifically this is the ability to mark categories of one taxonomy (eg cycle) as sub-categories of another taxonomy (eg body). This is only allowed though when the taxonomy has also been marked as a sub-taxonomy of the other taxonomy. While the taxonomy relationship can only be configured on the server, the category relationship shall be made accessible in the client.
The first task will be to allow assigning a parent category to a category if the category's taxonomy has a parent taxonomy. The parent options should be limited to those categories that are of that taxonomy's parent taxonomy (eg for any category of the cycle taxonomy the parent category options are all the categories of the HR body taxonomy).
Specifically:
[x] the CategoryEdit and CategoryNew containers should offer a Dropdown form element (position "BodyAside", introducing a new renderParentCategoryControl function in utils/forms.js similar to renderUserControl function) that allows selecting one of the valid categories and submit the parent category's id as parent_id when saving (creating/updating);
[x] the CategoryView container should show the parent category (position "BodyAside) if present (using getEntityLinkField of utils/fields.js, requires the parent_id attribute added to containers/App/messages.js)
In order to better capture recommendation cycles that are specific to the different HR bodies, we are introducing nested categories. Specifically this is the ability to mark categories of one taxonomy (eg cycle) as sub-categories of another taxonomy (eg body). This is only allowed though when the taxonomy has also been marked as a sub-taxonomy of the other taxonomy. While the taxonomy relationship can only be configured on the server, the category relationship shall be made accessible in the client.
This has already been implemented for the server and deployed to the staging site but is pending further review (see https://github.com/hrcnz/impactoss-server/compare/master...hrcnz:add-sub-relations).
The first task will be to allow assigning a parent category to a category if the category's taxonomy has a parent taxonomy. The parent options should be limited to those categories that are of that taxonomy's parent taxonomy (eg for any category of the cycle taxonomy the parent category options are all the categories of the HR body taxonomy).
Specifically:
renderParentCategoryControl
function in utils/forms.js similar torenderUserControl
function) that allows selecting one of the valid categories and submit the parent category's id asparent_id
when saving (creating/updating);getEntityLinkField
of utils/fields.js, requires theparent_id
attribute added to containers/App/messages.js)