Skip to content

Conversation

@JamalAlabdullah
Copy link
Contributor

@JamalAlabdullah JamalAlabdullah commented Dec 14, 2025

Description

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • New Features

    • Edit buttons in repeating group tables can now be conditionally hidden or displayed based on configuration settings.
  • Tests

    • Added comprehensive test coverage for edit button visibility control in repeating group tables.

✏️ Tip: You can customize this high-level summary in your review settings.

@JamalAlabdullah JamalAlabdullah added kind/bug Something isn't working backport-ignore This PR is a new feature and should not be cherry-picked onto release branches squad/utforming Issues that belongs to the named squad. labels Dec 14, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 14, 2025

📝 Walkthrough

Walkthrough

Modified RepeatingGroupTableSummary test helper to accept an optional editButton parameter for test configuration. Updated the component to compute row-specific editing state and conditionally render the edit button based on the edit.editButton configuration flag.

Changes

Cohort / File(s) Summary
RepeatingGroupTableSummary test and component
src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.test.tsx, src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx
Enhanced test helper layoutWithHidden() to accept optional editButton parameter and conditionally apply edit configuration. Implemented row-specific editing state using RepGroupHooks.useRowWithExpressions to derive hiddenEditButton flag. Added conditional rendering to suppress Edit button cell when hiddenEditButton is true or pdfModeActive is true. Added two new test cases validating edit button visibility based on edit.editButton configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify the row-specific state derivation logic using RepGroupHooks.useRowWithExpressions() and confirm correct extraction of editRow and hiddenEditButton values
  • Validate the conditional rendering logic gates the Edit button correctly when hiddenEditButton or pdfModeActive flags are set
  • Review test cases for completeness, including edge cases around edit button visibility with various configuration combinations

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The pull request description follows the template but is largely incomplete, lacking a detailed technical summary of changes and context. Add a clear technical description of what was changed (hiding the edit button in Summary2), why the changes were made, and how they work. Include non-technical summary for release notes as specified in the template.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'hide edit button in summery 2' directly relates to the main change: adding logic to conditionally hide the edit button in the RepeatingGroupTableSummary component based on configuration.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 16422-endre-knapp-vises-i-summary2-på-en-ikke-redigerbar-repeterende-gruppe

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.

@sonarqubecloud
Copy link

Copy link
Contributor

@olemartinorg olemartinorg left a comment

Choose a reason for hiding this comment

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

Looks good! 🙌

@olemartinorg
Copy link
Contributor

@JamalAlabdullah Maybe you should backport this? Since this is a bugfix, we can backport it and release it in a patch-release. Just switch to the backport label and it will be done mostly automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/bug Something isn't working squad/utforming Issues that belongs to the named squad.

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

Endre-knapp vises i Summary2 på en ikke-redigerbar repeterende gruppe

2 participants