Skip to content

fix: Add fragment list to model for custom fragments#4601

Merged
mmilko01 merged 5 commits into
mainfrom
fix/add-custom-section
May 11, 2026
Merged

fix: Add fragment list to model for custom fragments#4601
mmilko01 merged 5 commits into
mainfrom
fix/add-custom-section

Conversation

@mmilko01
Copy link
Copy Markdown
Contributor

@mmilko01 mmilko01 commented Apr 27, 2026

#4602

  • Previously, the fragment list was only added to the model when the dialog type was tableColumn. This meant other dialog types (e.g., custom fragments not tied to table columns) were missing the fragment list in the model entirely. This change ensures addFragmentListToModel() is always called, regardless of the dialog type.

@mmilko01 mmilko01 self-assigned this Apr 27, 2026
@mmilko01 mmilko01 added bug Something isn't working preview-middleware-client labels Apr 27, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: 355ebcc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@sap-ux-private/preview-middleware-client Patch
@sap-ux/preview-middleware Patch
@sap-ux/create Patch

Not sure what this means? Click here to learn what changesets are.

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

@mmilko01 mmilko01 requested a review from Jimmy-Joseph19 April 27, 2026 12:55
@mmilko01 mmilko01 marked this pull request as ready for review April 27, 2026 12:55
@mmilko01 mmilko01 requested a review from a team as a code owner April 27, 2026 12:55
@hyperspace-insights
Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Fix: Add Fragment List to Model for All Custom Fragment Dialog Types

Bug Fix

🐛 Resolved an issue where the fragment list was not being added to the model for custom fragments when the dialog type was not tableColumn. This caused an error during name validation, preventing the Create button from becoming enabled.

Previously, addFragmentListToModel() was only called when this.options.type === 'tableColumn'. For any other dialog type (e.g., adding a custom section for non-table elements), the fragment list was missing from the model, causing the duplicate name validation to fail with an error.

The fix ensures addFragmentListToModel() is always called unconditionally, regardless of the dialog type.

Changes

  • .changeset/olive-seahorses-bow.md: Added changeset entry marking a patch fix for @sap-ux-private/preview-middleware-client and @sap-ux-private/preview-middleware.
  • packages/preview-middleware-client/src/adp/controllers/AddCustomFragment.controller.ts: Refactored buildDialogData() to unconditionally call addFragmentListToModel(), and simplified the isCustomColumnFragment assignment to a single-line expression.

GitHub Issues

  • #4602: BUG - Add custom section fails when type is not Table Column

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.33

Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights Bot left a comment

Choose a reason for hiding this comment

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

Looking at the diff, the change is straightforward: addFragmentListToModel() is now always called regardless of dialog type, and isCustomColumnFragment is simplified to a const boolean expression.

The logic change is correct and matches the PR description. Let me check one thing about the AddCustomFragmentOptions type to confirm all possible type values are accounted for.

Looking at line 44 of the controller: type: 'section' | 'tableColumn' — only two values exist, and the fix correctly handles both. The isCustomColumnFragment flag still correctly identifies tableColumn type.

The change is clean, the tests cover the behavior, and no existing comments need follow-up. The simplification is correct — the fragment list should be available for all dialog types.

The PR makes a focused, correct fix: unconditionally calling addFragmentListToModel() so all dialog types have the fragment list available in the model, while also simplifying the boolean assignment to use const. The changeset is properly included and covers both affected packages.

PR Bot Information

Version: 1.20.33

  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 84a2623d-801d-4373-a873-8f4831d08252
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Agent Instructions:

Copy link
Copy Markdown
Contributor

@Jimmy-Joseph19 Jimmy-Joseph19 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. Approving.
Did not test locally and Integration test passed - https://github.com/SAP/open-ux-tools/actions/runs/24999167357
Changeset found.

@nikmace nikmace self-requested a review May 11, 2026 08:34
Copy link
Copy Markdown
Contributor

@nikmace nikmace left a comment

Choose a reason for hiding this comment

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

Change looks good
Did not test manually
Changeset is OK

@sonarqubecloud
Copy link
Copy Markdown

@mmilko01 mmilko01 merged commit 17de742 into main May 11, 2026
18 checks passed
@mmilko01 mmilko01 deleted the fix/add-custom-section branch May 11, 2026 08:46
devinea added a commit that referenced this pull request May 12, 2026
…t_take2

* origin/main:
  Project modules update 12.05.2026 (5242) (#4661)
  update skill name (#4658)
  chore: apply latest changesets
  feat: Display unhandled exceptions from the Controller extension inside the Info Center. (#4627)
  chore: apply latest changesets
  feat: update splitter for new ui (#4648)
  chore: apply latest changesets
  tbi(generator-odata-downloader): Make self contained (#4656)
  chore: apply latest changesets
  fix: change confirm replace additional message based on environment (#4628)
  chore: apply latest changesets
  fix(sap-systems-ext): add new create new command (#4645)
  chore: apply latest changesets
  (fiori-mcp-server) add additional guidance on the adding of extension in fiori (#4643)
  test: update skill (#4651)
  chore: apply latest changesets
  fix: Add fragment list to model for custom fragments (#4601)
  chore: apply latest changesets
  Docs(eslint-plugin-fiori-tools): add cds code snippets to rule documentation (#4623)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working preview-middleware-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants