-
Notifications
You must be signed in to change notification settings - Fork 13
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
Install PF5 libraries #213
Conversation
0b6eb4a
to
9ddf79e
Compare
The first step to migrate the project to PF5 is install the libraries used to its latest version. - "@patternfly/patternfly": "^5.1.0" - "@patternfly/react-core": "^5.1.2" - "@patternfly/react-table": "^5.1.2" Signed-off-by: Carla Martinez <carlmart@redhat.com>
b3326a5
to
66a107e
Compare
It seems that the integration tests are not passing. Moving this into WIP to investigate what is happening |
The Cypress tests have been adapted to the new version as well. Removing the 'WIP' tag and the code is ready to review. |
The pf-codemods[1] is an eslint wrapper to update @patternfly/react-core@4.x.x code to 5.x.x via autofixers. [1]- https://github.com/patternfly/pf-codemods/ Signed-off-by: Carla Martinez <carlmart@redhat.com>
After applying the changes, some class names will need to be updated via the `class-name-updater` codemod[1]. This utility automatically identifies Patternfly class names that need to be updated after the introduction of versioned class names in Patternfly v5. [1]- https://github.com/patternfly/pf-codemods/tree/main/packages/class-name-updater Signed-off-by: Carla Martinez <carlmart@redhat.com>
As some parameters are now different for some PatternFly components, those needs to be fixed and adapted to the new version. Signed-off-by: Carla Martinez <carlmart@redhat.com>
As stated in the official docs[1], some components have been updated in the major release. To prevent these components to be outdated any time soon, those need to be adapted to the newer version. [1]- https://www.patternfly.org/get-started/upgrade/#upgrade-deprecated-components Signed-off-by: Carla Martinez <carlmart@redhat.com>
With the addition of new PF5 classes, some Cypress tests need to be adapted to work with the new `v5` classes. Signed-off-by: Carla Martinez <carlmart@redhat.com>
59ced17
to
d966a94
Compare
@pvoborni - Code updated and fixed. |
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 speed read through the changes. I didn't see anything concerning. But that doesn't mean that everything is correct :).
Was also testing a bit manually seems to behave the same as before but I didn't test certificate workflows on user page.
I noticed the following weird behavior, but it might be present even in current code:
- In IpaCalendar component, first setting of time tends to reset date.
- In user add dialog, I cannot unset GID when I selected some, also the GID field should allow to enter arbitrary integer.
Overall, I'd be OK with merging this. Maybe even before merging all the "actions" PRs so that the actions PRs can be also modified to PF5 if needed (seems easier than modifying this after they are merged).
There will probably be some regressions but it might be easier to fix them in smaller separate PRs when they are found.
Will wait for yours and @mreynolds389 thoughts before adding the approval.
setOptionsToSelect(optionsTemp || []); | ||
optionsTemp.unshift(NO_SELECTION_OPTION); |
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.
Not sure, but shouldn't these two lines be swapped? It's a bit weird to modify something which was set a line before. It probably works because the reference to the object is the same, but still...
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.
You are right - Actually, line 97 can be removed as the addition of the empty element is being managed directly from the other useEffect
(lines 85-90). I will create a new PR to amend that.
<Icon status="warning" size="xl" className="pf-u-mt-4xl"> | ||
<ExclamationTriangleIcon size="lg" /> | ||
<Icon status="warning" size="xl" className="pf-v5-u-mt-4xl"> | ||
<ExclamationTriangleIcon sizes="lg" /> |
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.
@carma12 are you sure this is "sizes" and not "size", I can not not find "sizes" anywhere in the PF5 icon code
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.
@ mreynolds389 - I think the IDE suggested the sizes
property, but I can't find this in the PF documentation either. It seems that the icons are based on the createIcon
component (available under node_modules/@patternfly/react-icons/src/createIcon.tsx
).
In any case, I will check this with the PF team via slack to gather further information.
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.
Update: I got a response from the PF team and it seems that the sizes
prop is not necessary. The size of any icon should be set from the Icon
wrapper component. E.g.:
const MyIconComponent = () => {
return (
<Icon status="warning" size="xl" className="pf-v5-u-mt-4xl">
<ExclamationTriangleIcon />
</Icon>
);
}
I have created a new issue to track and remove the sizes
bit: #238
Overall this looks fine to me (besides the current comments). If something else is missing/wrong I'm sure we will spot it soon enough. So I think this is good to go, as current and future PRs will need this merged. |
@pvoborni and @mreynolds389 - Thanks for reviewing the code :) Some clarifications:
I checked this and this behavior only happens when the first value set is the time (when the date and time values are set the first time and those are empty). This behavior is expected and was present in the code (not affected by the PF5 migration).
This is the behavior that can be found in the current WebUI as well (not directly related to the PF5 migration). The numbers correspond with the GID identification numbers that are assigned when those are selected. I agree with you with the fact that it would be nice to have the |
The project has been migrated to use the PatternFly 5 library. The code has been adapted by following the suggested steps mentioned in the guidelines.
Steps followed
Affected libraries and its current version (as per the promoted package versions):
npm run start
.How do I apply these changes?
To adapt these changes to your local project you just need to install and build the project via NodeJS.