Skip to content

Conversation

@TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Feb 3, 2026

Important

This pull request is stacked upon #17588, which should be merged first.

Description

This pull requests adds edit and delete buttons to the published code list interface in the layout editor. The video below demonstrates what happens when the user clicks on them.

Spiller.inn.2026-02-03.142853.mp4

I have added the skip-second-approval label since this is behind a feature flag and it will be better to test when all of #17339 is complete.

Verification

  • Related issues are connected (if applicable)
  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Summary by CodeRabbit

Release Notes

New Features

  • Made the published option list selector trigger button configurable with customisable labels.

Refactor

  • Reorganised published code list editing functionality into a dedicated component for improved maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The changes refactor the published code list editing functionality by extracting a dedicated PublishedCodeListEditor component, renaming the internal edit button callback prop from onEditButtonClick to onEditInternalButtonClick, and making the trigger button configurable through triggerProps.

Changes

Cohort / File(s) Summary
PublishedCodeListEditor Component (New)
src/Designer/frontend/packages/ux-editor/.../PublishedCodeListEditor/PublishedCodeListEditor.tsx, PublishedCodeListEditor.module.css, index.ts
Extracts published code list editor into a dedicated component with grid-based layout. Renders code list information, edit trigger via PublishedOptionListSelector, and delete button with option removal and component state updates.
Component Prop Updates
src/Designer/frontend/packages/ux-editor/.../EditTab.tsx, OptionListEditor.tsx, PublishedOptionListSelector.tsx
Renamed onEditButtonClick to onEditInternalButtonClick in OptionListEditor; added configurable triggerProps to PublishedOptionListSelector; refactored OptionListEditor to use imported PublishedCodeListEditor instead of inline implementation.
Test Updates
OptionListEditor.test.tsx, PublishedOptionListSelector.test.tsx
Updated mock prop names to onEditInternalButtonClick; integrated FeatureFlag for NewCodeLists feature flag in test setup; added test flows for published code list form opening and optionsId removal on deletion; standardised trigger button text constant.

Poem

🐰 A button renamed, a component set free,
Trigger props dance where code lists be,
Grid-based layouts, deletions so neat,
Features now flagged—the refactor's complete! ✨

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically summarises the main change: adding edit and delete buttons for published code lists in the layout editor.
Description check ✅ Passed The description covers the main changes, includes a demonstration video, and all required verification checklist items are completed with checkmarks.

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

✨ 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 add-edit-and-delete-buttons-for-published-code-lists

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.

@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. skip-releasenotes Issues that do not make sense to list in our release notes frontend solution/studio/designer labels Feb 3, 2026
@TomasEng TomasEng changed the title feat: Add edit and delete buttons for published code lists in the lay… feat: Add edit and delete buttons for published code lists in the layout editor Feb 3, 2026
readonly referenceString: string;
};

function PublishedCodeListEditor({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this to a separate file since the component has become more complex.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.00%. Comparing base (635da4e) to head (1ad7a8b).

Additional details and impacted files
@@                         Coverage Diff                         @@
##           add-published-code-lsits-to-editor   #17631   +/-   ##
===================================================================
  Coverage                               96.00%   96.00%           
===================================================================
  Files                                    2437     2439    +2     
  Lines                                   30928    30946   +18     
  Branches                                 3606     3606           
===================================================================
+ Hits                                    29692    29710   +18     
  Misses                                    921      921           
  Partials                                  315      315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

[DEFAULT_LANGUAGE]: textResourcesMock.resources,
};
const onEditButtonClick = jest.fn();
const onEditInternalButtonClick = jest.fn();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed this since it specifically refers to the edit button on the editor for internally defined option lists.

@TomasEng TomasEng added the squad/data Issues that belongs to the named squad. label Feb 3, 2026
@TomasEng TomasEng moved this to 👷 In progress in Team Altinn Studio Feb 3, 2026
@TomasEng TomasEng added the skip-second-approval Pull requests that only need one approval from a reviewer. label Feb 3, 2026
@TomasEng
Copy link
Contributor Author

TomasEng commented Feb 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TomasEng TomasEng moved this from 👷 In progress to 🔎 In review in Team Altinn Studio Feb 3, 2026
@TomasEng TomasEng marked this pull request as ready for review February 3, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. frontend skip-releasenotes Issues that do not make sense to list in our release notes skip-second-approval Pull requests that only need one approval from a reviewer. solution/studio/designer squad/data Issues that belongs to the named squad.

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

Support editing a published code list reference Create basic interface for choosing a published code list

1 participant