Skip to content

feat(eslint-pligin-fiori-tools): report page section name in table rules#4572

Open
AlinaGovoruhina wants to merge 22 commits intomainfrom
feat/eslint-fiori/report-page-section-name
Open

feat(eslint-pligin-fiori-tools): report page section name in table rules#4572
AlinaGovoruhina wants to merge 22 commits intomainfrom
feat/eslint-fiori/report-page-section-name

Conversation

@AlinaGovoruhina
Copy link
Copy Markdown
Contributor

@AlinaGovoruhina AlinaGovoruhina commented Apr 17, 2026

Report Page Section Name in ESLint Plugin Fiori Tools Table Rules

New Features

✨ ESLint rule diagnostic messages for table-related rules in the eslint-plugin-fiori-tools package now include the page section name when the table is located inside an Object Page section. This provides more precise and context-aware error messages to help developers identify which specific section's table is misconfigured.

Changes

  • diagnostics.ts: Added optional pageSectionName?: string field to several diagnostic interfaces: WidthIncludingColumnHeaderDiagnostic, CreationModeForTable, CopyToClipboard, EnableExport, EnablePaste, TablePersonalization, and CondensedTableLayout.

  • annotations.ts: Extended AnnotationBasedNode with an optional label field. Section label is now extracted from UI.Facets annotation PropertyValue records and passed into createTableSection and addHeaderSection, which in turn populate label on the resulting nodes.

  • fe-v2.ts / fe-v4.ts: Added optional label?: string to the AnnotationBasedNode interface in both V2 and V4 linkers.

  • sap-copy-to-clipboard.ts: Unified V2/V4 handling into a single handleCopyInTable function and a shared checkConfiguration helper. Object page sections are now iterated to pass tableSection.annotation?.label as pageSectionName. Error message updated to include {{sectionText}}.

  • sap-creation-mode-for-table.ts: Updated reportDiagnostic, validateCreateModeV2, processTableV2, validateCreationModeV4, and processTableV4 to accept and propagate pageSectionName. Object page table iteration now uses sections instead of flat lookup. Error messages updated to include {{sectionText}}.

  • sap-enable-export.ts: Refactored handleExportInTableV4 to distinguish list report and object page sections. Extracted checkConfiguration helper with pageSectionName support. Message now uses {{sectionText}}.

  • sap-enable-paste.ts: Same refactoring pattern as sap-enable-export.ts, with section-aware iteration and updated message template.

  • sap-table-personalization.ts: Extracted checkTableConfiguration helper that passes tableSection.annotation?.label for object pages. checkPersonalizationValue now accepts pageSectionName and propagates it to all reported diagnostics. Error messages updated.

  • sap-width-including-column-header.ts: Extracted checkTable helper with tableSectionName support. checkTablesInPage now handles list report and object page separately. Message changed to use {{sectionText}} instead of table annotation path.

  • annotation.xml (test data): Fixed a typo ("Prducts""Products") and minor formatting cleanup.

  • test-helper.ts: Fixed label typo in V4_FACETS_ANNOTATIONS ("Prducts""Products").

  • sap-copy-to-clipboard.test.ts, sap-enable-export.test.ts, sap-enable-paste.test.ts, sap-table-personalization.test.ts, sap-width-including-column-header.test.ts: Updated existing tests to assert full messages (including section names) instead of messageId, and added new invalid test cases covering object page section scenarios.

  • 🔄 Regenerate and Update Summary

📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

PR Bot Information

Version: 1.20.11 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Output Template: Default Template
  • Summary Prompt: Default Prompt
  • Correlation ID: bc301571-3a96-4115-b847-53de15401511
  • Event Trigger: pull_request.opened

@AlinaGovoruhina AlinaGovoruhina added the eslint-plugin-fiori-tools @sap-ux/eslint-plugin-fiori-tools label Apr 17, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 6c17091

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

This PR includes changesets to release 1 package
Name Type
@sap-ux/eslint-plugin-fiori-tools 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

@AlinaGovoruhina AlinaGovoruhina marked this pull request as ready for review April 27, 2026 07:55
@AlinaGovoruhina AlinaGovoruhina requested a review from a team as a code owner April 27, 2026 07:55
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.

The PR introduces a useful feature but has several issues: a typo producing "settingis disabled" in the table-personalization message, a dead if (copyIssue) guard in sap-copy-to-clipboard.ts, a minor JSDoc typo ("oject"), and — most critically — both processV2Apps and processV4Apps in sap-creation-mode-for-table.ts now silently skip list-report pages because the refactoring only handles object-page sections, which is a regression compared to the original behavior.

PR Bot Information

Version: 1.20.33

  • Correlation ID: 4de836de-2881-4e0a-bfea-418f6ee48eca
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.ready_for_review
  • LLM: anthropic--claude-4.6-sonnet
  • Agent Instructions:

Comment thread packages/eslint-plugin-fiori-tools/src/rules/sap-table-personalization.ts Outdated
Comment thread packages/eslint-plugin-fiori-tools/src/rules/sap-copy-to-clipboard.ts Outdated
Comment thread packages/eslint-plugin-fiori-tools/src/rules/sap-width-including-column-header.ts Outdated
Comment thread packages/eslint-plugin-fiori-tools/src/language/diagnostics.ts
Comment thread packages/eslint-plugin-fiori-tools/src/project-context/linker/annotations.ts Outdated
Comment on lines 267 to 273
function createTableSection(
facets: IndexedAnnotation,
index: number,
referencedEntityType: string,
qualifier: string | undefined,
config: SectionConfig,
annotationPath: string,
aliasInfo: AliasInformation,
service: ParsedService
): TableSectionNode | undefined {
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.

I prefer object as param of method as this is easier to extend. here we only did for config to keep changes low :) would be nice if we could have one object as param :). Not necessary in this PR as changes might be a lot.

node,
messageId: COPY_TO_CLIPBOARD,
data: {
sectionText: diagnostic.pageSectionName ? `${diagnostic.pageSectionName} ` : ''
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.

See previous comment? Can we have empty pageSectionName? if yes, we can not make it optional. In that case instead of ternary operator will this not be enough. diagnostic.pageSectionName??'' or

`${diagnostic.pageSectionName ?? ''}`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There can be no sectionName in case of a list report table. Also, to get sectionText we need to add a space after section name. That's why I modified rule unit tests to check than a message text is not adding or missing spaces in cases when there is or isn't a section name.

Comment thread packages/eslint-plugin-fiori-tools/src/rules/sap-copy-to-clipboard.ts Outdated
Comment thread packages/eslint-plugin-fiori-tools/src/rules/sap-enable-paste.ts
Comment thread packages/eslint-plugin-fiori-tools/src/utils/helpers.ts
Copy link
Copy Markdown
Contributor

@marufrasully marufrasully left a comment

Choose a reason for hiding this comment

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

@AlinaGovoruhina thanks.

  • review comment addressed
  • unit tested

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

eslint-plugin-fiori-tools @sap-ux/eslint-plugin-fiori-tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants