Skip to content

chore: new secondary-danger generic modal variant#37223

Merged
kodiakhq[bot] merged 6 commits intodevelopfrom
chore/danger-secondary-generic-modal
Oct 20, 2025
Merged

chore: new secondary-danger generic modal variant#37223
kodiakhq[bot] merged 6 commits intodevelopfrom
chore/danger-secondary-generic-modal

Conversation

@MartinSchoeler
Copy link
Member

@MartinSchoeler MartinSchoeler commented Oct 14, 2025

Proposed changes (including videos or screenshots)

Create a new secondary-danger variant for the GenericModal component

Issue(s)

ABAC-56

Further comments

Summary by CodeRabbit

  • New Features

    • Added a new GenericModal variant "danger-secondary" to support a secondary-styled danger confirmation.
    • Added a Storybook example to preview the new variant.
  • Tests

    • Added render tests (including snapshot coverage) for the new variant to ensure visual consistency.
    • Existing callback tests remain present and unchanged.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 14, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

⚠️ No Changeset found

Latest commit: 45594c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Caution

Review failed

The head commit changed during the review from 1101720 to 746447f.

Walkthrough

Adds a new GenericModal variant danger-secondary, updates modal button-prop mapping and icon handling, adds a Storybook story for the variant, and introduces rendering-focused tests for the new variant.

Changes

Cohort / File(s) Summary
Component logic
packages/ui-client/src/components/Modal/GenericModal/GenericModal.tsx
Added 'danger-secondary' to VariantType; updated getButtonProps to return { secondary: true, danger: true } for it; adjusted icon rendering check to treat missing iconMap entries as no-icon.
Stories
packages/ui-client/src/components/Modal/GenericModal/GenericModal.stories.tsx
Added exported story DangerSecondary with DangerSecondary.args = { variant: 'danger-secondary' }.
Tests
packages/ui-client/src/components/Modal/GenericModal/GenericModal.spec.tsx
Added a new "renders" test suite that renders the modal (including danger-secondary variant) via renderModal, asserts heading and dialog role, and performs snapshot comparisons; existing "callbacks" suite left unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant GM as GenericModal
  participant BTN as ConfirmButton

  U->>GM: open modal (variant="danger-secondary")
  GM->>GM: getButtonProps("danger-secondary")
  Note right of GM #DDEBF7: returns { secondary: true, danger: true }
  GM->>BTN: render confirm button with props
  U-->>BTN: click confirm
  BTN-->>GM: onConfirm()
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibble code and test a bit,
A new bold hue where carrots sit.
Danger softened, two-tone care,
Stories told and snapshots there.
Hoppity hop — the modal's fair! 🐇

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the main change of adding a new danger-secondary variant to the GenericModal component and follows the repository’s conventional format without extraneous details.
Linked Issues Check ✅ Passed The pull request fully implements the objective from ABAC-56 by extending the variant type, updating button properties, adding a Storybook story, and creating corresponding tests for the danger-secondary variant of the GenericModal component.
Out of Scope Changes Check ✅ Passed All changes in this pull request are directly related to implementing the danger-secondary variant for the GenericModal component and do not include any unrelated or extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.69%. Comparing base (038431f) to head (45594c3).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37223   +/-   ##
========================================
  Coverage    67.68%   67.69%           
========================================
  Files         3342     3342           
  Lines       114028   114030    +2     
  Branches     20677    20677           
========================================
+ Hits         77185    77192    +7     
+ Misses       34166    34163    -3     
+ Partials      2677     2675    -2     
Flag Coverage Δ
e2e 57.31% <ø> (-0.01%) ⬇️
unit 71.68% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MartinSchoeler MartinSchoeler marked this pull request as ready for review October 14, 2025 19:00
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

Until now we survived with no secondary-danger variant.
Do we really need this? Can u share the designs with me, please?!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/ui-client/src/components/Modal/GenericModal/GenericModal.spec.tsx (1)

28-44: Consider verifying variant-specific behavior rather than just rendering.

Per your own comment on line 28, testing all variants may not add much value if the tests only verify basic rendering. If you decide to keep variant-specific tests, consider asserting on the actual differences between variants (e.g., button props, icon presence) rather than just snapshot testing.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4d10ea8 and 38492e7.

⛔ Files ignored due to path filters (1)
  • packages/ui-client/src/components/Modal/GenericModal/__snapshots__/GenericModal.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • packages/ui-client/src/components/Modal/GenericModal/GenericModal.spec.tsx (1 hunks)

@dougfabris dougfabris added this to the 7.12.0 milestone Oct 16, 2025
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Oct 20, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 20, 2025
@dougfabris dougfabris changed the title chore: new danger-secondary generic modal variant chore: new secondary-danger generic modal variant Oct 20, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Oct 20, 2025
@dougfabris dougfabris added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Oct 20, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 20, 2025
@kodiakhq kodiakhq bot merged commit 08b2d4f into develop Oct 20, 2025
83 of 86 checks passed
@kodiakhq kodiakhq bot deleted the chore/danger-secondary-generic-modal branch October 20, 2025 20:32
gabriellsh pushed a commit that referenced this pull request Oct 28, 2025
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
gabriellsh pushed a commit that referenced this pull request Oct 28, 2025
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants