From 9fb697b8c839d6531daf0260a0ed0d9b09963a2e Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Wed, 3 Jul 2024 13:52:36 +0200 Subject: [PATCH 1/2] refactor: make titleText required for object page sections BREAKING CHANGE: **ObjectPageSection**: the prop `titleText` is now required. BREAKING CHANGE: **ObjectPageSection**: the default value `true` for the prop `titleTextUppercase` has been removed. BREAKING CHANGE: **ObjectPageSubSection**: the prop `titleText` is now required. --- docs/MigrationGuide.mdx | 8 ++++++++ packages/main/src/components/ObjectPageSection/index.tsx | 8 +++----- .../main/src/components/ObjectPageSubSection/index.tsx | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/MigrationGuide.mdx b/docs/MigrationGuide.mdx index 6c2cb91d4d1..95aa5e391e5 100644 --- a/docs/MigrationGuide.mdx +++ b/docs/MigrationGuide.mdx @@ -457,6 +457,14 @@ The prop `portalContainer` has been removed as it is no longer needed due to the As the underlying `Text` component has been replaced with the UI5 Web Component, some inherited props `hyphenated` and `emptyIndicator` from the `Text` component have been removed. You can follow this [feature request](https://github.com/SAP/ui5-webcomponents/issues/9244) for updates. +### ObjectPageSection + +The prop `titleText` is now required and the default value `true` has been removed for the `titleTextUppercase` prop to comply with the updated Fiori design guidelines. + +### ObjectPageSubSection + +The prop `titleText` is now required. + ## Enum Changes For a better alignment with the UI5 Web Components, the following enums have been renamed: diff --git a/packages/main/src/components/ObjectPageSection/index.tsx b/packages/main/src/components/ObjectPageSection/index.tsx index 2783f6997a3..b86a1b35450 100644 --- a/packages/main/src/components/ObjectPageSection/index.tsx +++ b/packages/main/src/components/ObjectPageSection/index.tsx @@ -22,13 +22,11 @@ export interface ObjectPageSectionPropTypes extends CommonProps { /** * Defines the title of the `ObjectPageSection`. * - * @default '' */ - titleText?: string; + titleText: string; /** * Defines whether the title is always displayed in uppercase. * - * @default true */ titleTextUppercase?: boolean; /** @@ -61,10 +59,10 @@ export interface ObjectPageSectionPropTypes extends CommonProps { */ const ObjectPageSection = forwardRef((props, ref) => { const { - titleText = '', + titleText, id, children, - titleTextUppercase = true, + titleTextUppercase, className, style, hideTitleText, diff --git a/packages/main/src/components/ObjectPageSubSection/index.tsx b/packages/main/src/components/ObjectPageSubSection/index.tsx index e5b5395324e..023198d99c9 100644 --- a/packages/main/src/components/ObjectPageSubSection/index.tsx +++ b/packages/main/src/components/ObjectPageSubSection/index.tsx @@ -22,7 +22,7 @@ export interface ObjectPageSubSectionPropTypes extends CommonProps { /** * Defines the title of the `ObjectPageSubSection`. */ - titleText?: string; + titleText: string; /** * Actions available for this subsection. * From 99af4677561ad3b14e4c2712b532dce32ab3a8d8 Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Wed, 3 Jul 2024 13:56:54 +0200 Subject: [PATCH 2/2] fix test --- packages/main/src/components/ObjectPage/ObjectPage.cy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/components/ObjectPage/ObjectPage.cy.tsx b/packages/main/src/components/ObjectPage/ObjectPage.cy.tsx index 959c17b1b80..08b94b49a10 100644 --- a/packages/main/src/components/ObjectPage/ObjectPage.cy.tsx +++ b/packages/main/src/components/ObjectPage/ObjectPage.cy.tsx @@ -729,7 +729,7 @@ describe('ObjectPage', () => { }; cy.mount(); - cy.findByText('Lorem ipsum dolor sit amet').should('have.css', 'text-transform', 'uppercase'); + cy.findByText('Lorem ipsum dolor sit amet').should('have.css', 'text-transform', 'none'); cy.findByText('Etiam pellentesque').should('have.css', 'text-transform', 'none'); cy.findByText('toggle uppercase').click();