When a user hits Save categories for the categories they input, we need to give them feedback on:
- Whether the categories they entered were valid/invalid:
- Given that we are storing category titles and not IDs (see comments), we should verify if the category the user entered exists in either the category table or the page table and if so, we consider the category as valid.
- If the category title exists in neither the page table nor the category table, it is invalid.
- Visually the validations work the same way with red and green icons placed in the category title input box. Validation checks are carried out after the user hits Save categories, as with participants.
- If a user navigates away from the page with any invalid categories, those categories are lost and not saved anywhere.
- Give them a way to Remove saved categories
- This can be achieved the same way as with participants with a Remove button next to each of the saved categories.
This is modeled as much after the Participants section as possible.