feat(glossary): change a term's lifecycle stage and create a new version from the UI

Merged
MA
1mo ago
+1032-37

Summary

Glossary term pages get two actions in the entity menu, and glossary views show each term's version and lifecycle stage.

  • Change stage: for users with Edit Lifecycle Stage (or Edit Entity). The modal offers only the stages the term can move to under each stage's allowedPreviousStages, and shows server rejections inline.
  • New version: with entity versioning on, for users who can manage the term, on the latest (or a not yet versioned) term. Creates the new version as a draft and opens it. On a versioned term, Delete reads Delete version.
  • Badges: the version and stage show in the glossary sidebar, glossary list cards and the hierarchy module. Search cards show the stage when one is set.
  • Hidden-stage terms: users who can manage a glossary node also see its terms in hidden stages (such as drafts) in the sidebar.
  • Change history: glossary terms gain a Lifecycle stage filter.
  • Fix: validateCustomUrnId accepted ids starting with a space, comma, parenthesis or colon.

Stack

  1. #20630 Authorize and validate setLifecycleStage
  2. #20631 Glossary term versioning and default glossary stages
  3. #20632 UI: change stage, new version, badges šŸ‘ˆ this PR
  4. #20633 Business Glossary guide

Origin

Ported from DataHub Cloud: acryldata/datahub-fork#9192 (badges), acryldata/datahub-fork#13480 (Change stage), acryldata/datahub-fork#13510 (New version). Left out: proposing a stage change (Cloud-only proposals), the Cloud feature flag around the menu (the action already shows only when the user can edit and a stage is reachable), and the glossary relationship changes from #9192. Strings are in OSS namespaces, English only.

Testing

  • Vitest: LifecycleStageModal, CreateGlossaryTermVersionModal, EntityDropdown/utils, useGlossaryChildren, HistorySidebar.utils, validateCustomUrnId, and the existing glossary, hierarchy module and preview suites.
  • yarn type-check, yarn format-check and eslint pass locally. lint-jobs only runs on PRs into master, so it runs here once the earlier PRs merge.
  • A manual run in the browser is still to do.

Checklist

šŸ¤– Generated with Claude Code