Skip to content
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

Merged
merged 4 commits into from
Sep 25, 2020

Conversation

KKoukiou
Copy link
Collaborator

No description provided.

@KKoukiou KKoukiou changed the title Remove some unused variablea && properties Remove some unused variables && properties Sep 18, 2020
@patternfly-build
Copy link
Contributor

patternfly-build commented Sep 18, 2020

@KKoukiou KKoukiou marked this pull request as ready for review September 18, 2020 12:14
Copy link
Contributor

@jenny-s51 jenny-s51 left a 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?

@KKoukiou
Copy link
Collaborator Author

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;
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@KKoukiou KKoukiou marked this pull request as draft September 18, 2020 16:38
@KKoukiou KKoukiou marked this pull request as ready for review September 18, 2020 17:13
redallen
redallen previously approved these changes Sep 18, 2020
Copy link
Contributor

@redallen redallen left a 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}
Copy link
Collaborator

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

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.

Can you please link the associated issue.

@KKoukiou
Copy link
Collaborator Author

Can you please link the associated issue.

#4843 (comment)

…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.
@KKoukiou
Copy link
Collaborator Author

Can you please link the associated issue.

@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?

redallen
redallen previously approved these changes Sep 22, 2020
jschuler
jschuler previously approved these changes Sep 22, 2020
@tlabaj
Copy link
Contributor

tlabaj commented Sep 23, 2020

@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
@KKoukiou KKoukiou dismissed stale reviews from jschuler and redallen via 8a93ce9 September 24, 2020 06:19
@KKoukiou
Copy link
Collaborator Author

@KKoukiou Yes, this is the outlined here in our contribution guidelines.

Thanks for the answer :) I created an issue added the fixes line and reposted.

@tlabaj tlabaj merged commit 3c18f44 into patternfly:master Sep 25, 2020
@KKoukiou KKoukiou deleted the autofix-some-eslint-warnings branch October 2, 2020 10:03
@KKoukiou KKoukiou restored the autofix-some-eslint-warnings branch October 2, 2020 10:03
@KKoukiou KKoukiou deleted the autofix-some-eslint-warnings branch October 2, 2020 10:03
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.

6 participants