Skip to content

fix(admin): use btn-primary/btn-cancel in confirm-email modal - #8025

Merged
renemadsen merged 1 commit into
stablefrom
fix/button-conventions-confirm-email-modal
Sep 1, 2026
Merged

fix(admin): use btn-primary/btn-cancel in confirm-email modal#8025
renemadsen merged 1 commit into
stablefrom
fix/button-conventions-confirm-email-modal

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Why

The repo-wide button-conventions check has been red on stable for 5 consecutive runs, blocking every PR in the repo — including #8024.

Root cause: 94bba87d7 ("feat(admin): add confirm-email button to Settings → Users") added confirm-email-modal.component.html with two <button mat-raised-button> in its mat-dialog-actions row. eform-client/scripts/check-button-conventions.js (run by the button-conventions job in both dotnet-core-pr.yml and dotnet-core-master.yml) bans Material button directives in dialog action rows: the theme's override targets .mat-mdc-text-button, a class Angular Material 20 never emits, so mat-*-button silently renders as a pill in the wrong colour.

What

Converted both buttons to the house classes, matching the sibling dialogs in the same folder (remove-user-modal, user-set-password, user-modal):

  • .btn-cancel for the dismissing action
  • .btn-primary for the confirming action — confirming an email is affirmative, not destructive, so .btn-delete would be wrong

Also reordered to the CI-enforced order: cancel first, confirming action rightmost. (The original had Confirm before Cancel; that ordering only escaped the cancel-not-first rule because neither button carried an approved class.)

 <div mat-dialog-actions class="d-flex flex-row justify-content-end">
   <button
-    mat-raised-button
-    color="primary"
-    id="userConfirmEmailBtn"
-    (click)="confirmEmail()"
-  >
-    {{'Confirm' | translate}}
-  </button>
-  <button
-    mat-raised-button
+    class="btn-cancel"
     id="userConfirmEmailCancelBtn"
     (click)="hide()"
   >
     {{'Cancel' | translate}}
   </button>
+  <button
+    class="btn-primary"
+    id="userConfirmEmailBtn"
+    (click)="confirmEmail()"
+  >
+    {{'Confirm' | translate}}
+  </button>
 </div>

Verification

cd eform-client && node scripts/check-button-conventions.js src/app

  • Before: 2 violations (material-button-in-dialog, lines 25 and 33) across 174 templates
  • After: Button conventions: OK — no violations.

Risk checks

  • e2e: dropping the Material directives removes the .mdc-button__label inner element, which can hang specs that click through it. Both ids (userConfirmEmailBtn, userConfirmEmailCancelBtn) are unchanged, and a grep across this repo's e2e/, playwright/ and cypress/ trees and all sibling plugin repos in the workspace found no reference to either id, and no reference to .mdc-button__label outside SCSS and build output. Nothing targets these buttons.
  • Themes: the component's own stylesheet is empty. .btn-primary and .btn-cancel are both defined at top level in scss/styles.scss (covering the default theme-eform) and re-declared under theme-workspace in scss/components/_workspace-mat-overrides.scss. Row spacing also comes from the theme (.mat-mdc-dialog-actions { gap: 10px } under theme-eform, .mdc-dialog__actions { gap: 8px } under theme-workspace), so no extra gap utility is needed — same as remove-user-modal.

🤖 Generated with Claude Code

https://claude.ai/code/session_015sXLtgzZU8QL9m84GqMkoJ

94bba87 added the confirm-email dialog with two `<button mat-raised-button>`
in its action row. Material button directives are not part of this app's button
system — the theme override targets `.mat-mdc-text-button`, which Angular
Material 20 never emits — so `scripts/check-button-conventions.js` flags them
and the repo-wide `button-conventions` job has been red on `stable` ever since,
blocking every PR.

Convert both to the house classes, matching the sibling dialogs in the same
folder (remove-user-modal, user-set-password, user-modal): `.btn-cancel` for
the dismissing action and `.btn-primary` for the confirming one. Confirming
email is affirmative, not destructive, so `.btn-primary` is the right slot.

Reorder to the CI-enforced order — cancel first, confirming action rightmost.
The ids are unchanged and no e2e spec in this repo or the sibling plugin repos
references them, so nothing is clicking through the removed
`.mdc-button__label`. The component's stylesheet is empty, and both
`.btn-primary` and `.btn-cancel` are defined globally and re-declared under
`theme-workspace`, so the dialog holds under both themes.

`node scripts/check-button-conventions.js src/app`: 2 violations before,
0 across 174 templates after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015sXLtgzZU8QL9m84GqMkoJ
Copilot AI lite review requested due to automatic review settings September 1, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a small, localized template update that aligns with existing dialog patterns in the same area and addresses the stated CI enforcement issue without altering behavior-critical selectors (button ids remain unchanged).

Pull request overview

This PR updates the Account Management “Confirm email” dialog to comply with the repo-wide button conventions enforced by CI, unblocking the button-conventions job by removing disallowed Angular Material button directives from a mat-dialog-actions row.

Changes:

  • Replaced mat-raised-button usage in the confirm-email modal with house button classes (.btn-cancel, .btn-primary).
  • Reordered actions so Cancel comes first and the confirming action is rightmost (as required by the conventions check).
File summaries
File Description
eform-client/src/app/modules/account-management/components/users/confirm-email-modal/confirm-email-modal.component.html Converts dialog action buttons to .btn-cancel/.btn-primary and enforces Cancel-first ordering to satisfy CI button conventions.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renemadsen
renemadsen merged commit 35a5e5d into stable Sep 1, 2026
29 of 35 checks passed
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.

2 participants