Skip to content

Conversation

@JamalAlabdullah
Copy link
Contributor

@JamalAlabdullah JamalAlabdullah commented Dec 14, 2025

Description

closes: #16422

Changes:

  • Hided edit=Rediger button in summery for repeating group.

Test:

Add this to RepeatingGroup in json file.

 "edit": {
        "editButton": true
       },

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

    • Per-row edit button visibility in repeating-group tables can be controlled via layout configuration.
  • Tests

    • Added tests validating that the edit button is shown or hidden per row based on configuration, preserving existing scenarios.

✏️ 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

Per-row control was added for the repeating-group Summary2 Edit button: the component computes row-specific edit state and can hide the Edit button per-row via edit.editButton; tests updated to allow configuring editButton and to assert visibility behavior.

Changes

Cohort / File(s) Summary
RepeatingGroupTableSummary (component + tests)
src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx, src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.test.tsx
Component: uses RepGroupHooks.useRowWithExpressions(...) to derive editRow, computes hiddenEditButton = editRow?.editButton === false, and conditionally suppresses the right-aligned Edit button cell when hiddenEditButton or pdfModeActive is true. Tests: layoutWithHidden(hidden, editButton?) helper accepts an optional editButton; added tests assert Edit button rendered when edit.editButton is true and not rendered when false.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title is partially related to the changeset—it refers to hiding an edit button in Summary2, which matches the implementation, but contains a typo ('summery' instead of 'summary') and lacks specificity about it being for repeating groups.
Description check ✅ Passed The description covers the main changes and provides verification/QA checkboxes, but lacks technical detail on how the implementation works and is missing some checklist items (labels, sprint board, accessibility testing details).
✨ 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

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf071bf and fd81601.

📒 Files selected for processing (1)
  • src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Type-checks, eslint, unit tests and SonarCloud
  • GitHub Check: Install

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.

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.

@JamalAlabdullah JamalAlabdullah moved this from 🔎 In review to 🧪 Test in Team Altinn Studio Jan 5, 2026
@JamalAlabdullah JamalAlabdullah added backport This PR should be cherry-picked onto older release branches and removed backport-ignore This PR is a new feature and should not be cherry-picked onto release branches labels Jan 5, 2026
@lassopicasso lassopicasso self-assigned this Jan 6, 2026
@lassopicasso
Copy link
Contributor

@JamalAlabdullah noen tester feiler, kan du se på de?

@olemartinorg
Copy link
Contributor

Tror disse testene løser seg selv hvis du merger fra main en gang, @JamalAlabdullah - det er en del som har blitt fikset der nå.

Copy link
Contributor

@lassopicasso lassopicasso left a comment

Choose a reason for hiding this comment

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

Jeg har testet den, ser bra ut. Edit knappen vises ikke i tabellen hvis man setter editButton: false. Men skal denne knappen også skjules hvis repeterende gruppe vises som gruppe i oppsummeringen? Den gjør den ikke nå.

image

La forresten merke til at skillelinjene ikke tar full bredde når edit-knapp ikke er tilstede. Er dette ønskelig?

@JamalAlabdullah
Copy link
Contributor Author

JamalAlabdullah commented Jan 6, 2026

Jeg har testet den, ser bra ut. Edit knappen vises ikke i tabellen hvis man setter editButton: false. Men skal denne knappen også skjules hvis repeterende gruppe vises som gruppe i oppsummeringen? Den gjør den ikke nå.

image La forresten merke til at skillelinjene ikke tar full bredde når edit-knapp ikke er tilstede. Er dette ønskelig?

I am not sure if we need this also? i just followed the description in the issue , I fixed the dividing lines width.

Screenshot 2026-01-06 at 17 34 46

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Copy link
Contributor

@lassopicasso lassopicasso left a comment

Choose a reason for hiding this comment

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

I am not sure if we need this also? i just followed the description in the issue , I fixed the dividing lines width.

Perhaps it is not necessary, do you have any thoughts about it @olemartinorg ? I approve this.

@olemartinorg
Copy link
Contributor

Hmm, I tested this now, and there are a lot of edit buttons showing up in ttd/component-library when I have added a few rows and turned off the edit button afterwards.. However, the edit buttons showing up in other modes are rendered for the individual components (i.e. 'name', 'points', 'date'), not the repeating group row itself. So if you just set edit.editButton: false on the row without somehow making the components inside editable (such as setting editInTable) you've also removed any possibility for the user to see that component, let alone edit it... So, a fully 'proper' fix for this should probably check all child-components to make sure they are somehow editable (either inside the edit mode or in the table), but that could become very complex.

On the flip side, even if you turn edit.editButton: false, components can still be editable in the table, so removing the edit button in this case would possibly also break some apps where that is the case.

In the older Summary component we have the EditButtonFirstVisible component - maybe we could do something like that here as well? Looking to find the first editable component in a row, show the edit button in that case, otherwise hide the edit button for that row.

TL;DR: When thinking about it more, this is probably more complex than it seemed at first glance. The current fix might even break some configurations.

@JamalAlabdullah I can take a look at this one for you, if you want!

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: 🧪 Test

Development

Successfully merging this pull request may close these issues.

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

3 participants