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

Migrate deprecated Select component to PF5, remove unsupported/unused components #1435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sgratch
Copy link
Collaborator

@sgratch sgratch commented Jan 16, 2025

Reference: https://issues.redhat.com/browse/MTV-1051

  • Migrate the deprecated Select component to PF5 - see https://v5-archive.patternfly.org/components/menus/select/react-deprecated
  • Remove unused common component: AutocompleteFilter
  • Remove components that use the inline filter which is no longer supported by PF5: SearchableEnumFilter, SearchableGroupedEnumFilter
  • Fix bugs regarding the Select component, e.g. changing the Select menu to be scrollable when needed.

components

Reference: https://issues.redhat.com/browse/MTV-1051

- Migrate the deprecated Select component to PF5 - see https://v5-archive.patternfly.org/components/menus/select/react-deprecated
- Remove unused common component: AutocompleteFilter
- Remove components that use the inline filter which is no longer supported by PF5: SearchableEnumFilter, SearchableGroupedEnumFilter
- Fix bugs regarding the Select component, e.g. changing the Select menu to be scrollable when needed.

Signed-off-by: Sharon Gratch <[email protected]>
@sgratch sgratch added the enhancement Categorizes issue or PR as related to a new feature. label Jan 16, 2025
@sgratch sgratch added this to the 2.8.0 milestone Jan 16, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 1.85185% with 53 lines in your changes missing coverage. Please review.

Project coverage is 36.40%. Comparing base (13484d0) to head (7a7a98f).
Report is 184 commits behind head on main.

Files with missing lines Patch % Lines
...common/src/components/Filter/GroupedEnumFilter.tsx 0.00% 20 Missing ⚠️
...ckages/common/src/components/Filter/EnumFilter.tsx 5.26% 18 Missing ⚠️
...rc/components/FilterGroup/AttributeValueFilter.tsx 0.00% 15 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1435      +/-   ##
==========================================
- Coverage   36.81%   36.40%   -0.41%     
==========================================
  Files         158      156       -2     
  Lines        2548     2516      -32     
  Branches      599      593       -6     
==========================================
- Hits          938      916      -22     
+ Misses       1428     1418      -10     
  Partials      182      182              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -82,4 +82,8 @@

.forklift--create-plan--wizard-appearance-order {
z-index: 1;
}

.odf-backing-storage__selection--width{
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it used anywhere? tried to look in the PR but couldn't find, maybe I'm missing something

ref={toggleRef}
onClick={onToggleClick}
isExpanded={isOpen}
style={
Copy link
Collaborator

Choose a reason for hiding this comment

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

why inline styling?

};

const onToggle: (isExpanded: boolean, event: ToggleEventType) => void = (isExpanded) => {
setExpanded(isExpanded);
const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
Copy link
Collaborator

Choose a reason for hiding this comment

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

please try to import all the things from React as named imported and not React.

toggle={toggle}
shouldFocusToggleOnSelect
shouldFocusFirstItemOnOpen={false}
isScrollable={true}
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need for ={true}

_event: React.MouseEvent<Element, MouseEvent> | undefined,
value: string | number | undefined,
) => {
const label = typeof value === 'string' ? value : value?.toString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

u think this is neccessry? for example IIRC also string has toString() method so no need to check for === string - please check.

value: string | number | undefined,
) => {
const label = typeof value === 'string' ? value : value?.toString();
const id = label2enum[label] ? label2enum[label].id : label;
Copy link
Collaborator

Choose a reason for hiding this comment

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

const id = label2enum?.[label] ? label2enum[label]?.id : label;

const onToggle: (isExpanded: boolean, event: ToggleEventType) => void = (isExpanded) => {
setExpanded(isExpanded);
const onToggleClick = () => {
setIsOpen(!isOpen);
Copy link
Collaborator

Choose a reason for hiding this comment

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

setIsOpen(open => !open);

@metalice
Copy link
Collaborator

I didn't repeat comments please treat comments as it was for all the duplicated places in the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants