Skip to content

Add Page Building Block with Full Layout option during FPM app generation#4869

Open
kjose90 wants to merge 6 commits into
mainfrom
feat/add-page-template-support-app-gen
Open

Add Page Building Block with Full Layout option during FPM app generation#4869
kjose90 wants to merge 6 commits into
mainfrom
feat/add-page-template-support-app-gen

Conversation

@kjose90

@kjose90 kjose90 commented Jun 22, 2026

Copy link
Copy Markdown
Member
  • Generate an FPM custom page app and verify the Page Building Block prompt appears
Screenshot 2026-06-22 at 13 43 33
  • Select Full layout and verify the warning message is shown & in project attribute step min ui5 version >= 1.145
  • Select Basic Layout and verify the warning message is shown & in project attribute step min ui5 version >= 1.136
  • Basic layout should be selected by default
  • Page title should be mandatory for both Full and Basic Layout

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d456eb7

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

This PR includes changesets to release 36 packages
Name Type
@sap-ux/fe-fpm-writer Minor
@sap-ux/odata-service-inquirer Minor
@sap-ux/fiori-app-sub-generator Minor
@sap-ux/fiori-elements-writer Minor
@sap-ux/fiori-generator-shared Patch
@sap-ux/fe-fpm-cli Patch
@sap-ux/deploy-config-sub-generator Patch
@sap-ux/generator-odata-downloader Patch
@sap-ux/repo-app-import-sub-generator Patch
@sap-ux/ui-service-inquirer Patch
@sap-ux/generator-simple-fe Patch
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/abap-deploy-config-sub-generator Patch
@sap-ux/adp-flp-config-sub-generator Patch
@sap-ux/cap-config-writer Patch
@sap-ux/cf-deploy-config-sub-generator Patch
@sap-ux/deploy-config-generator-shared Patch
@sap-ux/fiori-freestyle-writer Patch
@sap-ux/flp-config-inquirer Patch
@sap-ux/flp-config-sub-generator Patch
@sap-ux/generator-adp Patch
@sap-ux/inquirer-common Patch
@sap-ux/ui-service-sub-generator Patch
@sap-ux/ui5-library-reference-sub-generator Patch
@sap-ux/ui5-library-sub-generator Patch
@sap-ux/ui5-test-writer Patch
@sap-ux/create Patch
@sap-ux/ui5-application-inquirer Patch
@sap-ux/adp-tooling Patch
@sap-ux/cf-deploy-config-inquirer Patch
@sap-ux/deploy-tooling Patch
@sap-ux/ui5-library-inquirer Patch
@sap-ux/ui5-library-reference-inquirer Patch
@sap-ux/backend-proxy-middleware-cf Patch
@sap-ux/preview-middleware Patch
@sap-ux-private/preview-middleware-client 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

@cla-assistant

cla-assistant Bot commented Jun 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kjose90 kjose90 marked this pull request as ready for review June 22, 2026 12:45
@kjose90 kjose90 requested review from a team as code owners June 22, 2026 12:45
@hyperspace-insights

Copy link
Copy Markdown
Contributor

Summary

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


Add Page Building Block Full Layout Option During FPM App Generation

New Features

✨ Introduces a Full Layout option for the Page Building Block when generating FPM (Flexible Programming Model) custom page applications. Users can now choose between Basic (default, requires UI5 ≥ 1.136) and Full layout (requires UI5 ≥ 1.145) during app generation. Warning messages are shown for each layout option, and the minimum UI5 version requirement is automatically adjusted based on the selected layout.

Changes

  • .changeset/page-building-block-full-layout.md: Added changeset entry marking minor version bumps across affected packages.
  • packages/fe-fpm-writer/src/building-block/types.ts: Added constants MIN_UI5_VERSION_PAGE_BUILDING_BLOCK (1.136.0) and MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT (1.145.0).
  • packages/fe-fpm-writer/src/index.ts: Exported the new version constants and existing page template type constants from the package.
  • packages/fe-fpm-writer/src/page/custom.ts: Updated handlePageBuildingBlock to accept pageBuildingBlockTemplateType, validate the UI5 version for full layout, fall back to basic layout with a warning if the version requirement isn't met, and pass the template type to generateBuildingBlock.
  • packages/fe-fpm-writer/src/page/types.ts: Added pageBuildingBlockTemplateType field to CustomPage configuration interface.
  • packages/fe-fpm-writer/src/prompts/translations/i18n.ts: Added minUi5VersionRequirementFullLayout warning message; updated existing message to use dynamic version placeholders.
  • packages/fe-fpm-writer/test/unit/page/custom.test.ts & __snapshots__/custom.test.ts.snap: Added tests and snapshots for full layout generation and version-mismatch fallback behavior.
  • packages/fiori-elements-writer/src/types.ts & fpmConfig.ts & index.ts: Added pageBuildingBlockTemplateType to FPMSettings, passed it through to the page generator, and re-exported the new constants.
  • packages/fiori-app-sub-generator/src/fiori-app-generator/transforms.ts: Included pageBuildingBlockTemplateType (defaulting to basic) in the page building block config transform.
  • packages/fiori-app-sub-generator/src/utils/common.ts & types/constants.ts: Replaced local minUi5VersionForPageBuildingBlock constant with shared constants from fe-fpm-writer; getMinSupportedUI5Version now returns the full layout minimum version when full layout is selected.
  • packages/odata-service-inquirer/src/prompts/edmx/questions.ts: Added a new pageBuildingBlockLayout confirm prompt (Basic/Full toggle with per-choice warning messages) that appears when the Page Building Block is enabled.
  • packages/odata-service-inquirer/src/translations/odata-service-inquirer.i18n.json: Added layoutMessage, choiceFull, choiceBasic, basicLayoutWarning, and fullLayoutWarning translation keys; updated tooltip to use dynamic version placeholder.
  • packages/odata-service-inquirer/src/types.ts: Added pageBuildingBlockLayout to EntityPromptNames and PageBuildingBlockAnswers.
  • packages/odata-service-inquirer/test/unit/prompts/edmx/questions.test.ts & related test files: Updated and added tests covering the new layout prompt behavior and version constant references.

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

Version: 1.26.4

  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet
  • Summary Prompt: Default Prompt
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 738b52c4-acdf-4a8c-8da1-72e4e1399f0e
  • File Content Strategy: Full file content

@hyperspace-insights hyperspace-insights Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR adds a well-structured feature with clear separation of concerns. Two issues were flagged: the additionalMessages callback in the layout question always shows a "Full layout" warning even before the user interacts with the prompt (missing undefined guard), and the full-layout version check in handlePageBuildingBlock silently allows full layout through when no UI5 version is specified (minVersion is null), bypassing the intended fallback to basic layout.

PR Bot Information

Version: 1.26.4

  • LLM: anthropic--claude-4.6-sonnet
  • Agent Instructions:
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 738b52c4-acdf-4a8c-8da1-72e4e1399f0e
  • File Content Strategy: Full file content

Comment on lines +263 to 280
additionalMessages: (input?: unknown) => {
// input is true when the user selects Basic layout (default/true = Basic)
if (input === true) {
return {
message: t('prompts.pageBuildingBlock.warning'),
message: t('prompts.pageBuildingBlock.basicLayoutWarning', {
minUi5VersionForPageBuildingBlock: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK
}),
severity: Severity.warning
};
}
// input is false when the user selects Full layout
return {
message: t('prompts.pageBuildingBlock.fullLayoutWarning', {
minUi5VersionForFullLayout: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT
}),
severity: Severity.warning
};
}

@hyperspace-insights hyperspace-insights Bot Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logic Error: additionalMessages always returns a warning (even when input is undefined), meaning a "Full layout" warning is shown before the user has interacted with this prompt at all. When input is undefined (initial render, no answer yet), no message should be returned.

Suggested change
additionalMessages: (input?: unknown) => {
// input is true when the user selects Basic layout (default/true = Basic)
if (input === true) {
return {
message: t('prompts.pageBuildingBlock.warning'),
message: t('prompts.pageBuildingBlock.basicLayoutWarning', {
minUi5VersionForPageBuildingBlock: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK
}),
severity: Severity.warning
};
}
// input is false when the user selects Full layout
return {
message: t('prompts.pageBuildingBlock.fullLayoutWarning', {
minUi5VersionForFullLayout: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT
}),
severity: Severity.warning
};
}
additionalMessages: (input?: unknown) => {
// input is true when the user selects Basic layout (default/true = Basic)
if (input === true) {
return {
message: t('prompts.pageBuildingBlock.basicLayoutWarning', {
minUi5VersionForPageBuildingBlock: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK
}),
severity: Severity.warning
};
}
// input is false when the user selects Full layout
if (input === false) {
return {
message: t('prompts.pageBuildingBlock.fullLayoutWarning', {
minUi5VersionForFullLayout: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT
}),
severity: Severity.warning
};
}
return undefined;
}

Double-check suggestion before committing. Edit this comment for amendments.


Thank you for submitting your feedback: 🤷 Neutral.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The prompt is of type confirm where default is set to true. So user at run time will either select true or false - so there is no scope for anything other than this.
But to make it clean - added an explicit check as suggested by bot for clarity.

Comment on lines +130 to +134
if (
templateType === PAGE_TEMPLATE_TYPE_FULL &&
minVersion &&
lt(minVersion.version, MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT)
) {

@hyperspace-insights hyperspace-insights Bot Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logic Error: When minVersion is null (i.e. data.minUI5Version is absent or unparseable), the full-layout version check is skipped entirely due to the minVersion && guard, so templateType stays as PAGE_TEMPLATE_TYPE_FULL and gets passed through without the version check. The fallback to PAGE_TEMPLATE_TYPE_BASIC and the warning should also apply when no version is specified, or at minimum the guard should be documented as intentional.

Suggested change
if (
templateType === PAGE_TEMPLATE_TYPE_FULL &&
minVersion &&
lt(minVersion.version, MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT)
) {
if (
templateType === PAGE_TEMPLATE_TYPE_FULL &&
(!minVersion || lt(minVersion.version, MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT))
) {
log?.warn(
t('minUi5VersionRequirementFullLayout', {
minUI5Version: data.minUI5Version,
minUi5VersionForFullLayout: MIN_UI5_VERSION_PAGE_BUILDING_BLOCK_FULL_LAYOUT
})
);
templateType = PAGE_TEMPLATE_TYPE_BASIC;
}

Double-check suggestion before committing. Edit this comment for amendments.


Thank you for submitting your feedback: 🤷 Neutral.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK

@lfindlaysap lfindlaysap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@kjose90, I did touch some adjacent lines as well. Hope that's okay.

'The Page building block feature requires SAPUI5 1.136.0 or higher. The current version is {{ minUI5Version }}, so the Page building block will not be added.'
'The Page building block feature requires SAPUI5 {{ minUi5VersionForPageBuildingBlock }} or higher. The current version is {{ minUI5Version }}, so the Page building block will not be added.',
'minUi5VersionRequirementFullLayout':
'The Page building block full layout requires SAPUI5 {{ minUi5VersionForFullLayout }} or higher. The current version is {{ minUI5Version }}, so Basic layout will be applied instead.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'The Page building block full layout requires SAPUI5 {{ minUi5VersionForFullLayout }} or higher. The current version is {{ minUI5Version }}, so Basic layout will be applied instead.'
'Full Layout requires SAPUI5 {{ minUi5VersionForFullLayout }} or higher. The current version is {{ minUI5Version }}, so Basic Layout will be applied instead.'

"titleMessage": "Page Title"
"tooltip": "The Page building block is supported from SAPUI5 version {{ minUi5VersionForPageBuildingBlock }}. By choosing this option, you will be restricting the minimum SAPUI5 versions available for the application to be {{ minUi5VersionForPageBuildingBlock }} and above.",
"titleMessage": "Page Title",
"layoutMessage": "Choose Page Building Block layout",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"layoutMessage": "Choose Page Building Block layout",
"layoutMessage": "Page Building Block Layout",

"tooltip": "The Page building block is supported from SAPUI5 version {{ minUi5VersionForPageBuildingBlock }}. By choosing this option, you will be restricting the minimum SAPUI5 versions available for the application to be {{ minUi5VersionForPageBuildingBlock }} and above.",
"titleMessage": "Page Title",
"layoutMessage": "Choose Page Building Block layout",
"choiceFull": "Full layout",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"choiceFull": "Full layout",
"choiceFull": "Full Layout",

"titleMessage": "Page Title",
"layoutMessage": "Choose Page Building Block layout",
"choiceFull": "Full layout",
"choiceBasic": "Basic layout",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"choiceBasic": "Basic layout",
"choiceBasic": "Basic Layout",

"choiceFull": "Full layout",
"choiceBasic": "Basic layout",
"basicLayoutWarning": "The Page building block is supported with SAPUI5 version {{ minUi5VersionForPageBuildingBlock }} and above.",
"fullLayoutWarning": "Full Page Layout is supported with SAPUI5 version {{ minUi5VersionForFullLayout }} and above."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"fullLayoutWarning": "Full Page Layout is supported with SAPUI5 version {{ minUi5VersionForFullLayout }} and above."
"fullLayoutWarning": "Full Layout is supported with SAPUI5 version {{ minUi5VersionForFullLayout }} and above."

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants