Skip to content

chore: fix types for pagination navigation #10263

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 1 commit into from
Apr 19, 2024

Conversation

jonkoops
Copy link
Contributor

@jonkoops jonkoops commented Apr 9, 2024

Refactors the types of the pagination navigation so that they will compile when upgrading to TypeScript 5. This is needed to land #10156.

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 9, 2024

@jonkoops jonkoops force-pushed the fix-types-pagination-navigation branch from 1a15d04 to 4d23aa0 Compare April 9, 2024 23:01
@@ -148,7 +148,7 @@ export interface PaginationProps extends React.HTMLProps<HTMLDivElement>, OUIAPr
/** Function called when user clicks on navigate to next page. */
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
/** Function called when user inputs page number. */
onPageInput?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
onPageInput?: (event: React.KeyboardEvent<HTMLInputElement>, page: number) => void;
Copy link
Contributor Author

@jonkoops jonkoops Apr 9, 2024

Choose a reason for hiding this comment

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

This is a breaking change to the type of a public API, but the type that was here before was incorrect.

Copy link
Contributor

@mfrances17 mfrances17 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Would want someone from patternfly-react team to make the call on whether this needs to go into PF6 due to breaking change, although if it was wrong that might qualify it to get into PF5 anyway.

@mfrances17 mfrances17 requested a review from tlabaj April 15, 2024 20:10
@jonkoops
Copy link
Contributor Author

Would want someone from patternfly-react team to make the call on whether this needs to go into PF6 due to breaking change, although if it was wrong that might qualify it to get into PF5 anyway.

Discussed this with @tlabaj and we can land this under v5 since it's only a type-correctness fix.

@@ -29,7 +29,7 @@ export interface NavigationProps extends React.HTMLProps<HTMLElement> {
/** Label for the English word "of". */
ofWord?: string;
/** The number of the current page. */
page: string | number;
page: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

lgtm overall but cc @tlabaj to double check that this prop change isn't also a breaking change (while onPageInput was a type fix).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This interface is never exported as a public API, so this will not be a breaking change.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@kmcfaul kmcfaul merged commit 69ddbea into patternfly:main Apr 19, 2024
@jonkoops jonkoops deleted the fix-types-pagination-navigation branch April 20, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants