-
Notifications
You must be signed in to change notification settings - Fork 350
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
Remove some unused variables && properties #4843
Remove some unused variables && properties #4843
Conversation
31ffd17
to
51d5f5b
Compare
PF4 preview: https://patternfly-react-pr-4843.surge.sh |
51d5f5b
to
f4c5c3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KKoukiou! Could you please link the corresponding issue in the description of this PR?
There is not corresponding issue - I just found some problems while checking the codebase and fixed them. |
@@ -12,8 +12,6 @@ export interface DropdownMenuProps { | |||
className?: string; | |||
/** Flag to indicate if menu is opened */ | |||
isOpen?: boolean; | |||
/** Flag to indicate if menu should be opened on enter */ | |||
openedOnEnter?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked patternfly-analytics and none of our known consumers are using this prop.
However, since we export this component in Dropdown/index.ts
it's better to just mark it as deprecated and destructure it so that it's not passed to the DOM. If we remove it entirely we might break some Typescript consumer who is using it, or some Javascript consumer might be confused why their MenuComponent has openedOnEnter
passed to it which propagates down to an HTMLElement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. It's sad that we have to keep a property which literally does nothing but you are completely right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redallen btw this component is not exposed at all in the documentation website. https://www.patternfly.org/v4/documentation/react/components/dropdown
I would say then that since it's not there, it's properties change should not worry us.
f4c5c3f
to
0e7482c
Compare
0e7482c
to
2ed8008
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the repo from 2018 and 2019 to see if we ever used that component in an example and it looks like it's always been internal, despite us exposing it.
Because of that, I'm good with removing the prop. Marking it as deprecated is good as well.
@@ -95,10 +95,9 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro | |||
<DropdownMenu | |||
setMenuComponentRef={this.setMenuComponentRef} | |||
component={component} | |||
isOpen={isOpen} | |||
isOpen={isOpen || openedOnEnter} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to just leave it off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please link the associated issue.
|
…ever used Mark it as deprecated and don't pass it when using this component because it's ignored anyway.
* componentContent variables in InternalDropdownItem component was reset after last use * unused 'styles' import in NotificationDrawerList component * ununsed 'ev' parameter in event handler of Page component
…le in jest test Fixes Warning: React does not recognize the `isFocused` prop on a DOM element.
2ed8008
to
06fc473
Compare
@tlabaj in patternfly do you really create an issue for each PR? Especially for this case right here creating an issue does not really make sense IMO, because it's multiple unrelated between then fixes. It's mostly a repository maintenance PR and not targeting specific issue. Opening an issue for such PRs will just create unnecessary noise. Or am I missing something? |
@KKoukiou Yes, this is the outlined here in our contribution guidelines. |
…le in jest test Fixes Warning: React does not recognize the `isHovered` prop on a DOM element. Closes patternfly#4874
06fc473
to
8a93ce9
Compare
Thanks for the answer :) I created an issue added the fixes line and reposted. |
No description provided.