Skip to content

refactor: make titleText required for object page sections #6014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/MigrationGuide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ describe('ObjectPage', () => {
};
cy.mount(<TestComp />);

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();
Expand Down
8 changes: 3 additions & 5 deletions packages/main/src/components/ObjectPageSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -61,10 +59,10 @@ export interface ObjectPageSectionPropTypes extends CommonProps {
*/
const ObjectPageSection = forwardRef<HTMLElement, ObjectPageSectionPropTypes>((props, ref) => {
const {
titleText = '',
titleText,
id,
children,
titleTextUppercase = true,
titleTextUppercase,
className,
style,
hideTitleText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ObjectPageSubSectionPropTypes extends CommonProps {
/**
* Defines the title of the `ObjectPageSubSection`.
*/
titleText?: string;
titleText: string;
/**
* Actions available for this subsection.
*
Expand Down
Loading