What this form does
The category form creates or edits a top-level casino category. Categories are the first grouping layer used to organize casino games, so name quality, active state, and icon choice affect how operators and downstream catalog views recognize the group.
The create flow is intentionally smaller. It lets an operator enter category-name translations, set Active Status, preview the category, and submit the new category. The edit flow loads an existing category and adds settings for built-in icons, custom icon assets, reset, dirty-state markers, and a fuller preview.
What operators can change
- Category Name translations for active languages.
- Active Status, which stores the category as active or inactive.
- System Icons on the edit flow.
- Custom Icon on the edit flow, selected from existing category icon assets.
- No Image on the edit flow, which clears the custom icon selection.
How save works
Create becomes available when at least one translation has a non-empty category name. After a successful create, the page briefly shows success feedback and returns to the Categories list. New categories are appended after the current highest stored category order.
Edit loads the category from the category list data by the route id. Save Changes becomes available only when the form is valid and at least one value changed. Reset restores the values that were loaded when the edit form opened. Cancel or Back leaves the form, and if there are unsaved local changes the page asks the operator to confirm leaving.
Translation rules
The form reads active languages and creates one translation row for each active language. A language row can be expanded, edited, collapsed, and marked as filled. Edit puts languages that already have a value first and marks changed values with an Edited indicator.
The page only requires one non-empty translation to enable submit, but the verified duplicate checks use the English name path. For predictable category management, fill the English category name even when another language is the immediate business priority.
Icon rules
Create does not expose icon controls. Edit can store a built-in icon name and optionally a custom icon selected from the category icon asset catalog. When a custom icon is selected, the preview and saved category depend on the asset still being available through the Core asset service. If the selected custom icon is an SVG, the save flow stores processed SVG text for later use.
Known caveats
- The create flow does not choose an icon. Use edit after creation when the category needs a specific system or custom icon.
- The page validity rule is "at least one translation is non-empty", while duplicate-name checks are English-name oriented. Missing English names can make validation and audit wording harder to reason about.
- Edit reads the category through the category list data and then matches the route id locally. If the list data does not contain the category, the edit form cannot initialize the record.
- Custom icon save depends on the selected Core asset path. Missing or non-SVG assets can still leave the stored custom icon value, but processed SVG text may be empty.
- Translation completeness matters because categories can appear in multilingual player-facing contexts.