Split Policy Store catalog categories into ids and labels

What does this MR do and why?

Splits the Policy Store catalog's categories into untranslated id constants and a translated label map, in catalog/categories.js.

Catalog entries declared translated category strings (category: s__('PolicyStore|Enforcement')) while the drawer's sort order held raw English, so CATEGORY_ORDER.indexOf only matched in English — every other locale would lose the drawer's grouping order. The eslint-disable on the raw strings was masking exactly this defect. Ids are now the grouping and sorting keys; CATEGORY_LABELS supplies display names, defined only for categories the catalogs use so translators never see an unreachable string.

The catalog shape spec gains the guard that keeps this honest: every entry's category must be in CATEGORY_ORDER and have a label.

No gitlab.pot change: the label msgids are identical to the strings the catalogs declared inline before.

First of a three-MR chain extracted from !247891 (merged) to keep each reviewable:

  1. This MR — catalog categories
  2. !248394 (merged) — the Build step's building blocks
  3. !247891 (merged) — the Build policy step itself (all UI)

References

Screenshots or screen recordings

No UI change. Nothing on master renders the catalog yet — the fix manifests once the Build policy step (!247891 (merged)) ships the drawer.

How to set up and validate locally

yarn jest ee/spec/frontend/policy_store/catalog

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Artur Fedorov

Merge request reports

Loading
Loading