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

Fixes #37746 - Update to pf5 #10272

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

MariaAga
Copy link
Member

@MariaAga MariaAga commented Aug 13, 2024

Needs theforeman/foreman-js#481 & to remove pf5 from package.json
Will need plugin updates as well.
For testing with the foreman-js PR, you will need to add

    "@patternfly/patternfly": "^5.2.0",
    "@patternfly/react-charts": "^5.2.0",
    "@patternfly/react-core": "^5.2.0",
    "@patternfly/react-icons": "^5.2.0",
    "@patternfly/react-styles": "^5.2.0",
    "@patternfly/react-table": "^5.2.0",
    "@patternfly/react-tokens": "^5.2.0",

to foreman/package.json

foreman and foreman-js need to be in the pf5 branch
in the foreman dir bundle exec rake assets:clobber rm -rf public/webpack node_modules package-lock.json npm i --legacy-peer-deps
in the foreman-js npm run clean npm i --legacy-peer-deps NODE_OPTIONS=--openssl-legacy-provider npm run build npm run link
and then in the foreman dir bundle exec foreman start (or start webpack )

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@kmalyjur kmalyjur left a comment

Choose a reason for hiding this comment

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

Except for a few small things I commented on (and some not successful checks), everything looks fine, thank you! 🥳

app/assets/stylesheets/base-pf4.scss Outdated Show resolved Hide resolved
app/assets/stylesheets/patternfly_colors_overrides.scss Outdated Show resolved Hide resolved
Comment on lines +90 to +104
return [
isDeleteable && {
title: __('Delete'),
onClick: () => onDeleteClick({ id, name }),
isDisabled: !canDelete,
isAriaDisabled: !canDelete,
},
...((getActions &&
getActions({ id, name, canDelete, canEdit, ...item })) ??
[]),
...extendActions.map(action => ({
...action,
isAriaDisabled: action.isDisabled,
})),
].filter(Boolean);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The functionality is fine, however, when opening the table kebab, the "Edit" button looks like it's selected and the mouse on the "Change content..." looks like it's clickable:
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed both, thanks

@MariaAga
Copy link
Member Author

Thanks @kmalyjur for the review, all should be fixed now. I'll open a seperate PR for host page

The pencil icon is not clickable when the table is too small, but that issue was already there before, so it's not in the scope of this PR

Copy link
Contributor

@kmalyjur kmalyjur left a comment

Choose a reason for hiding this comment

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

Thank you! I'm just not sure about some of the not-passing checks, but I'm certain you'll figure it out :)

@@ -281,6 +281,7 @@ const HostsIndex = () => {
window.location.href = foremanUrl(`/hosts/${id}/clone`);
},
isDisabled: !canEdit,
autoFocus: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to remove

@MariaAga
Copy link
Member Author

The checks are mostly failing due to this PR not having the correct foreman-js version, which will only be available once the foreman-js PR is merged. and also will need to do a packaging PR

@MariaAga MariaAga force-pushed the pf5-update branch 2 times, most recently from 23a04ac to 4339a09 Compare January 7, 2025 11:04
@github-actions github-actions bot added the Legacy JS PRs making changes in the legacy Javascript stack label Jan 7, 2025
@sjha4
Copy link
Contributor

sjha4 commented Jan 7, 2025

Functionally this has been working well on foreman and katello pages..Ack on this outside of dependency related CI issues..

Copy link
Contributor

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

The pages are loading correctly and all the pages look good from everything I tested..Changes make sense for the upgrade..Ack.. 👍🏼

@MariaAga
Copy link
Member Author

Updated PR to include new components that were added in the last 5 months

Comment on lines -60 to +67
"tabbable": "~5.2.0",
"tabbable": "^6.2.0",
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: this doesn't need packaging.

Comment on lines +24 to +30
"@patternfly/patternfly": "^5.1.0",
"@patternfly/react-charts": "^7.3.0",
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-icons": "^5.1.1",
"@patternfly/react-styles": "^5.1.1",
"@patternfly/react-table": "^5.1.1",
"@patternfly/react-tokens": "^5.1.1",
Copy link
Member

Choose a reason for hiding this comment

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

@MariaAga do you need help packaging those?

Copy link
Member

Choose a reason for hiding this comment

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

or will it be vendored inside foreman-js and we won't need packaging these separately?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be inside foreman-js

Copy link
Member

Choose a reason for hiding this comment

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

okay, so the change here is just temporarily until there is a foreman-js release out with those changes? and we don't package tabbable, so you technically don't need any packaging ACK ;-)
(GH will still want it, so, once there is a foreman-js release out, and the version requirement was bumped here, you get it)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thanks

@ogajduse
Copy link
Contributor

@theforeman/packaging

@ekohl
Copy link
Member

ekohl commented Jan 15, 2025

Do I get it right that this adds patternfly 5, but doesn't remove any older version? So now we have yet another front end framework in place?

@MariaAga
Copy link
Member Author

@ekohl

Do I get it right that this adds patternfly 5, but doesn't remove any older version? So now we have yet another front end framework in place?

Nope, it removes it in foreman-js "Needs theforeman/foreman-js#481 & to remove pf5 from package.json"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Legacy JS PRs making changes in the legacy Javascript stack UI Waiting on contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants