Skip to content
Open
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Deprecations

- Added useDeprecatedPropWarning for panelled prop ([#843](https://github.com/opensearch-project/oui/pull/1142))
Copy link
Member

Choose a reason for hiding this comment

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

nit - use imperative for changelog entries, and link to the PR, not the issue

Suggested change
- Added useDeprecatedPropWarning for panelled prop ([#843](https://github.com/opensearch-project/oui/pull/1142))
- Add deprecation warning for `panelled` prop of `OuiPageBody` ([#1142](https://github.com/opensearch-project/oui/pull/1142))


### 🛡 Security

### 📈 Features/Enhancements
Expand Down
3 changes: 3 additions & 0 deletions src/components/page/page_body/page_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
setPropsForRestrictedPageWidth,
} from '../_restrict_width';
import { OuiPanel, OuiPanelProps } from '../../panel';
import { useDeprecatedPropWarning } from '../../../utils/deprecated';

const paddingSizeToClassNameMap = {
none: null,
Expand All @@ -61,6 +62,7 @@ export type OuiPageBodyProps<T extends ComponentTypes = 'main'> = CommonProps &
panelled?: boolean;
/**
* Extends any extra OuiPanel props if `panelled=true`
* **panelled prop is deprecated in version 2.0.0
Copy link
Member

@joshuarrrr joshuarrrr Nov 14, 2023

Choose a reason for hiding this comment

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

This is comment is on the wrong line - comments precede the props, so the comments for the panelled prop are L59-61.

*/
panelProps?: Omit<OuiPanelProps, 'paddingSize'>;
/**
Expand All @@ -86,6 +88,7 @@ export const OuiPageBody = <T extends ComponentTypes>({
style
);

useDeprecatedPropWarning({ props: { panelled }, version: '2.0.0' });
Copy link
Member

Choose a reason for hiding this comment

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

I think we should also include panelProps as a deprecated prop, because it's dependent on panelled being true.

const nonBreakingDefaultPadding = panelled ? 'l' : 'none';
paddingSize = paddingSize || nonBreakingDefaultPadding;

Expand Down