Skip to content

ui: migrate intentions UI to HDS - #23835

Open
suresh-hashicorp wants to merge 6 commits into
suresh/nodes-hds-migrationfrom
suresh/intentions-hds-migration
Open

ui: migrate intentions UI to HDS#23835
suresh-hashicorp wants to merge 6 commits into
suresh/nodes-hds-migrationfrom
suresh/intentions-hds-migration

Conversation

@suresh-hashicorp

Copy link
Copy Markdown
Contributor

Summary

This PR migrates the Consul UI Intentions components to the HashiCorp Design System (HDS).

Commits

  • 2a73a6333f ui: migrate intentions index to HDS card layout
  • 3d0bd92496 ui: HDS migration for Create Intention form
  • 9cf3824eca ui: migrate Add Permission modal to HDS components
  • 476cef3ae9 Migrate intention permission list components to HDS
  • f4a74e34fe feat(ui): migrate intentions components to HDS

Changes

Intentions Index

  • Migrated intentions list (dc/intentions/index.hbs) to HDS layout and table components
  • Updated intention/list and intention/list/table templates to use HDS components
  • Added route-level styles (styles/routes/dc/intentions/index.scss)

Create / Edit Intention Form

  • Refactored intention/form/index.hbs and .js to use HDS form controls and layout primitives
  • Updated form/fieldsets/index.hbs and layout.scss to use HDS grid/fieldset patterns
  • Added form/index.scss for HDS-specific overrides

Permission Form & List (Add Permission modal)

  • Migrated intention/permission/form to HDS modal and form components
  • Migrated intention/permission/list to HDS table/badge components, updating JS, layout, and skin styles
  • Updated permission/header/form and permission/header/list templates to HDS

Intention View

  • Migrated intention/view/index.hbs to HDS layout
  • Added intention/view/index.scss

Shared Components

  • Updated radio-card component (.hbs, layout.scss, skin.scss) for HDS compatibility
  • Updated super-select-with-create and composite-row for HDS alignment

Tests

  • Updated acceptance test dc/intentions/create-test.js and Cucumber feature permissions/create.feature for new selectors

Testing

  • Acceptance tests updated
  • Manually verified intention create/edit/view flows

- Move toolbar inside the card (above the table) via a named :toolbar
  slot on Consul::Intention::List::Table, replacing the outer <:toolbar>
  block on the page template
- Expose isManagedByCRDs and card args through Consul::Intention::List
  so the CRD notice renders above the card and the table gets the card
  context it needs
- Refactor intentions/index.hbs to use Consul::Intention::List::Table
  directly, removing the DataCollection wrapper indirection and the
  now-redundant <label for='toolbar-toggle'>
- Change confirm-delete modal from @color='warning' to @color='critical'
  and icon from alert-triangle to alert-diamond to match HDS design spec
- Update toolbar SCSS: replace padding-bottom/margin-bottom with padding
  and faint-surface background; add border-bottom separator on the
  filter-bar actions row to match nodes/services toolbar appearance
- Rename page title 'New Intention' → 'Create Intention'
- Migrate Source/Destination selects into bordered card panels with legend headings
- Replace plain Description input with Hds::Form::TextInput::Field
- Migrate Allow/Deny/Application aware radio cards to vertical RadioCard layout with icons
- Add Hds::Separator before Permissions section
- Add permissions-header (flex justify-between) and permissions-content (bordered card)
- Rewrite radio-card to flex-col with content area + bottom radio strip
- Update radio-card layout/skin for HDS border tokens, elevation, and typography
- Fix SuperSelectWithCreate to render label via <F.Label> yield slot
- Scope-remove fieldset border-bottom/margin-bottom on intentions routes
- Update acceptance tests for new page title
- Replace ModalDialog with Hds::Modal; open/close via isPermissionModalOpen flag
- Replace raw radio inputs with Hds::Form::Radio::Group for Allow/Deny
- Replace raw checkbox with Hds::Form::Toggle::Field for All Methods
- Replace raw checkboxes with Hds::Form::Checkbox::Field for HTTP methods
- Move methods description above toggle as standalone paragraph
- Replace ListCollection + overflow menu with flat header rows using 4-col grid
- Each header row (saved and entry form) shows its own column labels
  (Header type / Header name / Header information) with trash icon in col 4
- Trash button uses @color='secondary' (not critical)
- Grid uses align-items:start so error messages expand downward without
  shifting sibling column labels; ::before spacer keeps trash beside inputs
- Replace full-width secondary Add Another Header button with compact
  secondary small button with leading plus icon
- Add Hds::Separator between Action/Path/Methods/Headers sections
- Remove legacy ModalDialog CSS overrides
The HDS migration replaced the inline ConfirmationDialog with an
Hds::Modal for the intention delete flow, but introduced three bugs:

1. Page object selector: createDeletable() maps confirmDelete to
   [data-test-delete], which matched the old inline DeleteConfirmation
   component. The new modal's confirm button uses data-test-confirm-delete
   and renders in a portal outside <main>. Override confirmDelete in
   the intention edit page object to target the modal directly, using
   resetScope/testContainer like the KV edit page does.

2. Untracked pendingDelete: pendingDelete was a plain (untracked)
   property. Mark it @Tracked so Glimmer re-evaluates template
   expressions reading it when it changes.

3. queue helper captures args at render time: (queue closeDeleteModal
   pendingDelete) evaluates pendingDelete when the helper runs, not
   when the button is clicked. Replace with a new confirmDelete()
   action that reads this.pendingDelete at invocation time, closes
   the modal, then calls the delete function.
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