Skip to content

Commit 10e50a2

Browse files
refactor: make titleText required for object page sections (#6014)
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.
1 parent f1386f8 commit 10e50a2

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

docs/MigrationGuide.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,14 @@ The prop `portalContainer` has been removed as it is no longer needed due to the
457457
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.
458458
You can follow this [feature request](https://github.com/SAP/ui5-webcomponents/issues/9244) for updates.
459459

460+
### ObjectPageSection
461+
462+
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.
463+
464+
### ObjectPageSubSection
465+
466+
The prop `titleText` is now required.
467+
460468
## Enum Changes
461469

462470
For a better alignment with the UI5 Web Components, the following enums have been renamed:

packages/main/src/components/ObjectPage/ObjectPage.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ describe('ObjectPage', () => {
729729
};
730730
cy.mount(<TestComp />);
731731

732-
cy.findByText('Lorem ipsum dolor sit amet').should('have.css', 'text-transform', 'uppercase');
732+
cy.findByText('Lorem ipsum dolor sit amet').should('have.css', 'text-transform', 'none');
733733
cy.findByText('Etiam pellentesque').should('have.css', 'text-transform', 'none');
734734

735735
cy.findByText('toggle uppercase').click();

packages/main/src/components/ObjectPageSection/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ export interface ObjectPageSectionPropTypes extends CommonProps {
2222
/**
2323
* Defines the title of the `ObjectPageSection`.
2424
*
25-
* @default ''
2625
*/
27-
titleText?: string;
26+
titleText: string;
2827
/**
2928
* Defines whether the title is always displayed in uppercase.
3029
*
31-
* @default true
3230
*/
3331
titleTextUppercase?: boolean;
3432
/**
@@ -61,10 +59,10 @@ export interface ObjectPageSectionPropTypes extends CommonProps {
6159
*/
6260
const ObjectPageSection = forwardRef<HTMLElement, ObjectPageSectionPropTypes>((props, ref) => {
6361
const {
64-
titleText = '',
62+
titleText,
6563
id,
6664
children,
67-
titleTextUppercase = true,
65+
titleTextUppercase,
6866
className,
6967
style,
7068
hideTitleText,

packages/main/src/components/ObjectPageSubSection/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ObjectPageSubSectionPropTypes extends CommonProps {
2222
/**
2323
* Defines the title of the `ObjectPageSubSection`.
2424
*/
25-
titleText?: string;
25+
titleText: string;
2626
/**
2727
* Actions available for this subsection.
2828
*

0 commit comments

Comments
 (0)