Skip to content

fix: fixed missing rowsBefore in summeray2#4204

Open
JamalAlabdullah wants to merge 1 commit into
mainfrom
4188-repeatinggroup-rowsbefore-is-missing-from-summary2
Open

fix: fixed missing rowsBefore in summeray2#4204
JamalAlabdullah wants to merge 1 commit into
mainfrom
4188-repeatinggroup-rowsbefore-is-missing-from-summary2

Conversation

@JamalAlabdullah
Copy link
Copy Markdown
Contributor

@JamalAlabdullah JamalAlabdullah commented May 13, 2026

Description

  • Fix missing rowsBefore rendering in RepeatingGroup Summary2 table view
  • Add test for it.

Before:

before

After:

after

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

@JamalAlabdullah JamalAlabdullah added kind/bug Something isn't working backport This PR should be cherry-picked onto older release branches labels May 13, 2026
@JamalAlabdullah JamalAlabdullah linked an issue May 13, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

This PR extends RepeatingGroupTableSummary to render rows that appear before the main visible rows, complementing the existing after-rows functionality. The implementation introduces a shared renderExtraRows helper to centralize rendering of both before and after row groups, with test coverage verifying the new capability.

Changes

RepeatingGroup table summary before/after rows

Layer / File(s) Summary
Test fixture and layout configuration
src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.test.tsx
Test LayoutOptions type adds withRowsBefore flag, and createLayout conditionally injects rowsBefore block into the layout when enabled.
Core implementation with renderExtraRows helper
src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx
Component imports GridRows type, updates useItemWhenType to retrieve rowsBefore, refactors table body to call shared renderExtraRows helper for both before and after rows, and centralizes row and cell rendering in the new helper function.
Test assertion for before-rows rendering
src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.test.tsx
New test case asserts that summary.before is rendered in the summary table when withRowsBefore is enabled.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions fixing missing rowsBefore in summary2, which aligns with the actual changes that add rowsBefore support to RepeatingGroupTableSummary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description follows the required template with all major sections present: description with visual context, related issue reference, and comprehensive verification/QA checklist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 4188-repeatinggroup-rowsbefore-is-missing-from-summary2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@JamalAlabdullah JamalAlabdullah moved this to 🔎 In review in Team Altinn Studio May 13, 2026
@JamalAlabdullah JamalAlabdullah added the squad/utforming Issues that belongs to the named squad. label May 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Magnusrm Magnusrm left a comment

Choose a reason for hiding this comment

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

It seems like the rowsbefore should come before the header in the summary like it does for the regular component.

Also it seems like the rows are missing a cell in order to take up as mnuch space as the regular rows which contain an edit button. There is logic for this in the Grid components summary2, where the row gets an edit button if the row contains a form component (editable component), and an empty cell if it contains no form components.

image image

In GridSummary.tsx:
image

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

Labels

backport This PR should be cherry-picked onto older 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.

RepeatingGroup rowsBefore is missing from Summary2

2 participants