Skip to content

feat: improve policy name display and fix policy ID handling#11

Draft
gabrielzepeda1 wants to merge 8 commits intomainfrom
policy-name-display-improvements
Draft

feat: improve policy name display and fix policy ID handling#11
gabrielzepeda1 wants to merge 8 commits intomainfrom
policy-name-display-improvements

Conversation

@gabrielzepeda1
Copy link
Contributor

@gabrielzepeda1 gabrielzepeda1 commented Feb 6, 2026

Summary

Improves policy information display in the management-cli and management-ui and fixes policy ID handling issues. Additionally, minor updates in the management-ui were made to adapt to these changes.

Changes

apps/cli/management-cli

  • README.md - Update documentation to use placeholder in examples
  • src/services/api.service.ts - Encode policy IDs in API URLs to handle special characters (e.g., "/")

apps/services/management-api

  • src/services/opa.service.ts - Refactor getPolicies():
    • Use array map instead of Object.entries for correct data handling
    • Extract clean policy names without paths and file extensions
    • Return both clean "name" and full "id" for each policy

apps/web/management-ui

Components:

  • src/components/PolicyCard.tsx - Refactor layout to better display a longer policy ID
  • src/components/PolicyList.tsx - Replace "primary" color with "blue" for visual consistency
  • src/components/CopyableId.tsx - Update import to use @utils/cn path alias
  • src/components/ui/button.tsx - Update import to use @utils/cn path alias
  • src/components/ui/card.tsx - Update import to use @utils/cn path alias
  • src/components/ui/input.tsx - Update import to use @utils/cn path alias
  • src/components/ui/label.tsx - Update import to use @utils/cn path alias
  • src/components/ui/tooltip.tsx - Update import to use @utils/cn path alias

Pages:

  • src/pages/PoliciesPage.tsx - Adjust padding for consistency across other pages.

Utilities:

  • src/utils/cn.ts (new) - Add cn utility function for className merging (moved from src/lib)

Types:

  • src/types/styra_highlightjs-rego.d.ts (new) - Add TypeScript declarations for @styra/highlightjs-rego package

Screenshots

image image

Todos

  • Extract policy names without paths and file extensions from policy IDs
  • Display both clean policy name and full policy ID in the UI
  • Adjust PolicyCard layout to better accommodate longer policy IDs
  • Fix getPolicies() in opa.service.ts to use array map instead of Object.entries
  • Fix policy ID encoding in API requests from CLI to handle IDs containing "/" characters
  • Replace "primary" color classnames with "blue" in PolicyList for visual consistency with other pages
  • Add cn utility function imported by components to src/utils/cn.ts to avoid errors in the web UI
  • Update component imports to use @utils/cn
  • Add TypeScript declarations for @styra/highlightjs-rego package in src/types/
  • Update CLI README.md with correct placeholder in examples

Steps to Validate

@gabrielzepeda1 gabrielzepeda1 self-assigned this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant