-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes #36106: PF5 Refactor - EditorNavbar, EditorOptions #10728
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
base: develop
Are you sure you want to change the base?
Conversation
3e7a6c1 to
880cb47
Compare
f7cbd8f to
86ff36b
Compare
webpack/assets/javascripts/react_app/common/IntegrationTestHelper.js
Outdated
Show resolved
Hide resolved
...ets/javascripts/react_app/components/Editor/__tests__/__snapshots__/integration.test.js.snap
Outdated
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js
Outdated
Show resolved
Hide resolved
...pts/react_app/components/Editor/components/__tests__/__snapshots__/EditorNavbar.test.js.snap
Outdated
Show resolved
Hide resolved
kfamilonidis
left a comment
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.
Still needs progress to remove the snaps from the test that are testing components properties, but have noticed that some snaps are different from others; some are keeping store props, and some keeping components props. I would like to ask for some opinion on should we remove both snap types, or should we keep the store props - as the later might be serve as fixtures in the future (maybe transition to other store).
4474901 to
2fefd25
Compare
The |
a7def11 to
ebd3141
Compare
webpack/assets/javascripts/react_app/common/IntegrationTestHelper.js
Outdated
Show resolved
Hide resolved
ebd3141 to
76115b3
Compare
kfamilonidis
left a comment
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 removed the snaps related to integration.test.js and redux-store.
| ); | ||
| }; | ||
| }); | ||
|
|
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.
this is needed as react-ace is 3rd party library and we don't need/test to call the original.
webpack/assets/javascripts/react_app/common/IntegrationTestHelper.js
Outdated
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/common/IntegrationTestHelper.js
Outdated
Show resolved
Hide resolved
76115b3 to
00a55c5
Compare
b8f326a to
2fc22d0
Compare
2fc22d0 to
a254055
Compare
5c79f7a to
d8950b3
Compare
MariaAga
left a comment
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.
Tested it on a dev env and it works as it should, left some comments and I still need to go over the new tests and test with packit
| variant="warning" | ||
| title={ | ||
| <> | ||
| {__('Outdated Preview')} |
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.
Why the word changes?
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.
no reason actually, I think I was testing the length of the message but, is handled perfectly fine with the previous copy. Reverted it.
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.
With these changes the safemode text is not aligned with the checkbox, could you fix it here or open a follow up task for it? maybe converting it to PF from html will help
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 tested it with PF5 Label and the result is a bit strange, pls see:

When opening the select host select menu, renders like here
. This menu is updated here or with autocomplete here
I could center the element with the custom css that is already there here leaving the upgrade to happen with set host menu or pls advice.

| ))} | ||
| </FormSelect> | ||
| </FormGroup> | ||
| <FormGroup |
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.
The check boxkes here are also not aligned (like safemode), I checked and its because we have a global rule to set label bottom-margin to 5px. I think we should have a global rule to set bottom-margin to 0 for pf forms/checkboxes.
context: The rule comes from pf3
| @@ -1,3 +1,7 @@ | |||
| .nav-tabs-pf > li:first-child > a { | |||
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.
Should be more specific as other components use nav-tabs-pf
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.
this rule is overriding a previous global issue with a css rule that caused the padding of the first element to be 0.
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.
Pull request overview
This PR successfully migrates the Editor components (EditorNavbar, EditorOptions, EditorSettings, EditorRadioButton) from PatternFly 4 to PatternFly 5, and replaces all Enzyme tests with React Testing Library (RTL) tests.
Key changes:
- Upgraded PF components to PF5 variants (Button, Nav, Alert, Spinner, FormSelect, Checkbox)
- Replaced Enzyme snapshot tests with RTL assertion-based tests
- Updated CSS class names from
nav-tabs-pf-secondarytonav-tabs-pf5-secondary
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| editor.scss | Updated CSS classes for PF5 compatibility and removed unused popover styles |
| EditorSettings.js | Migrated from PF3 Dropdown to PF5 FormSelect and Checkbox components |
| EditorRadioButton.js | Updated to use PF5 NavItem with isActive prop |
| EditorOptions.js | Migrated Button components to use PF5 variant and isDisabled props |
| EditorNavbar.js | Updated Nav, Alert, and Spinner components to PF5 variants |
| EditorSettings.test.js | Replaced Enzyme snapshots with RTL tests validating form interactions |
| EditorRadioButton.test.js | Replaced Enzyme with RTL, testing component rendering |
| EditorOptions.test.js | Migrated from Enzyme mount/simulate to RTL render/fireEvent |
| EditorNavbar.test.js | Updated to use RTL with proper role-based queries |
| EditorModal.test.js | Converted to RTL with document query selectors |
| EditorHostSelect.test.js | Migrated to RTL with comprehensive DOM assertions |
| EditorView.test.js | Replaced Enzyme snapshots with RTL tests and mocked react-ace |
| Editor.test.js | Full RTL migration with proper role queries and assertions |
| integration.test.js | Updated to use RTL helpers and removed snapshot-based testing |
| DiffView.test.js | Migrated from snapshot tests to RTL with table role assertions |
| Diff.fixtures.js | Updated fixture keys to simple names instead of descriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <NavItem | ||
| role="presentation" | ||
| ouiaId={`${btnView}-navitem`} | ||
| disabled={disabled} |
Copilot
AI
Nov 28, 2025
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.
The disabled prop should be updated to isDisabled to match PatternFly 5 API for the NavItem component.
| disabled={disabled} | |
| isDisabled={disabled} |
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.
this is breaking the app in tests.
| <Tooltip content={__('Import File')} position={TooltipPosition.top}> | ||
| <Button | ||
| ouiaId="import-file-button" | ||
| disabled={selectedView !== 'input'} |
Copilot
AI
Nov 28, 2025
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.
The disabled prop should be updated to isDisabled to match PatternFly 5 API. Line 124 still uses the old disabled prop instead of isDisabled.
| disabled={selectedView !== 'input'} | |
| isDisabled={selectedView !== 'input'} |
webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js
Outdated
Show resolved
Hide resolved
...ack/assets/javascripts/react_app/components/Editor/components/__tests__/EditorNavbar.test.js
Outdated
Show resolved
Hide resolved
|
Also seeing how much css overrides we do to make the Nav component behave like Tab component, and with the new pf5 css I noticed also the active tab title are too bright so they will also need an override for the colour, why not just use the tab component? |
d8950b3 to
63c2862
Compare
63c2862 to
cefce8c
Compare
cefce8c to
0143c1f
Compare
Upgrade NavBar (Alert, Button), Options (RadioButton, View), Settings. Remove enzyme in tests including DiffView, HostSelect. Keep the store actions, selectors tests.
0143c1f to
6989067
Compare
Background
Editor and
<EditorNavBar />upgrade to next version of react requires substitution of Enzyme tests with RTL (React Testing Library) framework.Acceptance Criteria
Tests
followed by: #10777