Skip to content

[Feature Branch] React Functional Conversions #539

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

Merged
merged 93 commits into from
Apr 24, 2025
Merged

Conversation

mshriver
Copy link
Contributor

@mshriver mshriver commented Jan 10, 2025

Opening a PR to observe the delta between the react migration branch and main.

https://issues.redhat.com/browse/IQE-3308

  1. Convert dashboard to functional #534
  2. Convert IbutsuHeader to functional component #535
  3. FileUpload React functional conversion #540
  4. Sidebar useEffect conversion #541
  5. Convert ReportBuilder to functional #542
  6. Convert UserDropdown to Functional #543
  7. Convert FilterTable and MetaTable #544
  8. Convert AddTokenModal and DeleteModal to functional #545
  9. Convert ClassifyFailureTable to functional #546
  10. DRAFT convert classification dropdown #547
  11. Convert UserDropdown to Functional - Followup #548
  12. Fix bug, useState instead of useContext #549
  13. Convert ResultView #550
  14. Convert EditWidgetModal #551
  15. Convert NewDashboardModal #552
  16. Convert TabTitle #553
  17. Convert custom view component #554
  18. Refactor ParamDropdown and WidgetHeader #555
  19. Convert NewWidgetWizard #556
  20. Convert MultiValueInput #557
  21. Convert RunSummary #558
  22. Convert TableStates #559
  23. Convert Importance by Component Widget #560
  24. Convert TestHistoryTable #562
  25. Convert ProjectEdit #563
  26. Add more eslint rules #564
  27. Add more eslint rules #566
  28. Convert projectlist #568
  29. Update timerange test history #569
  30. Convert Admin Page #570
  31. Convert UserEdit to functional #571
  32. Convert ResultAggregator widget #572
  33. Convert UserTokens #573
  34. Convert UserProfile #574
  35. Convert UserList #575
  36. Convert EmptyObject #576
  37. Convert resultSummary Widget #578
  38. Added logic for different keycloak auth paths (#567) #581 (cherry picking Added logic for different keycloak auth paths #567)
  39. Convert AccessibilityAnalysisView #582
  40. Convert Accessibility dashboard #585
  41. Convert CompareRunsView #586
  42. Convert JenkinsJob View #588
  43. Convert Jenkins Job Analysis view #589
  44. Convert GenericArea Widget #591
  45. Convert filterheatmap #592
  46. Convert GenericBar Widget #593
  47. Convert Ibutsu Page #594
  48. React pattern updates #598
  49. Add sourcery config #599
  50. React pattern updates, 2 #600
  51. Convert Login #601
  52. Convert RunList to functional #602
  53. Convert run to functional #603
  54. Fix checking for required parameters in Create Widget Wizard for autofilling #604
  55. Convert ResultList to functional #605
  56. Replace react-json with patternfly codeeditor #606
  57. fix(IQE-3444): Error fetching when loading user profile page #607
  58. fix(IQE-3441): Fix adding values to the MultiValueInput #608
  59. Convert Result to functional #609
  60. React convert ResetPassword and ForgotPassowrd #610
  61. Remove ElementWrapper #611
  62. fix(IQE-3443): Apply current selection to the Dashboard selector #612
  63. fix(IQE-3448): Show loading state when accessing the Run's details page #613
  64. fix(IQE-3467): Remove infinite cycle of fetching test results #614
  65. Fix results table visual bugs #617
  66. fix(IQE-3462): Add skeleton loading to the edit widget modal #618
  67. fix(IQE-3454): Enable scrolling of dropdowns on Edit Project page #620
  68. Custom useTabHook for Tab Navigation #621
  69. fix(IQE-3502): Be able to trim slashes from both begging and end in URL building #622
  70. Create useUserFilter, Update Table Patterns on Admin UserList #623
  71. Dashboard selection bugs #624
  72. Update ESLint config, Apply Prettier #626
  73. Tab Hashing on TestHistoryTable #627
  74. Fix Owner filtering on ProjectEdit #628
  75. feat(IQE-3524): Remove option for selecting project owner in Add Project form #629

@mshriver mshriver changed the title Convert dashboard to functional (#534) [Feature Branch] React Functional Conversions Jan 12, 2025
@mshriver mshriver added enhancement New feature or request frontend labels Jan 22, 2025
@mshriver mshriver marked this pull request as ready for review March 7, 2025 15:02
Copy link
Contributor Author

@mshriver mshriver left a comment

Choose a reason for hiding this comment

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

It's time!

All commits were reviewed going into the branch, this PR is not directly reviewed.

It has been soaking in stage for a while and is looking solid for a 2.6.0 release on main.

mshriver and others added 25 commits April 24, 2025 09:26
* Convert Dashboard to functional component

it would be shorter to list what didn't change.

Everything changes?

useEffect replacing compnentDidMount
No more weird handling of filter values, let API filtering do it's job
Cleaned up small behaviors around button enabling

State use makes way more sense now

dashboard_id is sanely synced when direct navigation via URL

don't wait for promise repsonse to set modal open state
Buggy, really needs to be on top of the dashboard conversion and not
straight against main.

the rendering/useEffect is not right, select flickers open

Migrate to react-toastify

Remove eventEmitter for notifications, use react-toastify

Styling isn't amazing but it should follow dark/light theme and uses the
PF alert component.

Removed before/after upload hooks as they're unnecessary for our scope
and implementation, they were only used for notifications and with
react-toastify container I just moved that functionality into the file
upload component itself.

Move theme to context, update masthead

Correctly reads browser preference or local storage to set theme on
login, and track theme selection in IbutsuContext

masthead can't be themed correctly in PF5, update on migration to PF6.

Apply some styling to the toolbar buttons in the masthead
Change theme select to ToggleGroup, following PF design guidelines

JSDOM mock for window.matchMedia
Context wasn't being used correctly in sidebar
Move behavior to useEffect to fetch views on project selection
Pretty straightforward migration, dropped one unused state item for
total pages.

Had to use callback functions for the useEffect hookst
* Convert user-dropdown to functional

* address linting issues
* removed pf5 class from dropdown items

* rely only on setState methods to update dropdown state

* remove eventEmitter from IbutsuHeader
Please enter the commit message for your changes. Lines starting
Resolved comments from review
Split ArtifactTab component resolve the blob and it's type and render
the tab, separate from ResultView
* Convert importance component widget

* removed unused return statement
* Add more eslint rules

* Fix rest lint issues after rebase
* Convert TestHistoryTable

Split LastPassed into new component

* updated vars to const from review
mshriver and others added 27 commits April 24, 2025 09:27
Remove eventEmitter and ElementWrapper
No longer necessary as all components have been converted to functional
in order to consume hooks directly.
useEffect wrappers for document.title changes to set consistently after
render.

change hoisted function definitions to block scoped variables
* Updates for tab history handling

Using WCA@IBM!

Add default tab hashes to result paths

trying to update the hash after navigation via effect within ResultView
ends up making the history ugly regardless of use of navigation hooks on
tab selection.

Just set the hash on the initial target for summary

Create custom useTabHook

Move buildTree
Convert Run to useTabHook

Use #summary hash for run hrefs

* useTabHook, restore state and add skipHash

When nested, the activeTab should not sync with the location hash.

add useTabHook to jenkinsjob analysis

Update link composition in filterheatmap

provide hash for tabbed views
use `${}` syntax

Update useTabHook navigation with location

include search and path as-is, search is used in a few spots

* Catch error on project request from header

* useTabHook in jenkinsjobanalysis view
* useUserFilter custom hook

Can be further abstracted to cover the MetaFilter implementation, and
provide consistent filter application and clearing across the app.

Uses more recent patternfly components and react pattern suggestions

Provides activeFilters state
Provides memo for the filter select and text elements for field,
operation, and text filters
Provides memo for the actively applied filter elements
Provides callbacks for filter related functions

Apply useUserFilter on the UserList

Directly use Table instead of FilterTable
Apply PF5 react patterns for header and body props
Use dataLabels and action columns screen reader props

Icon and variant customization for the status labels
Move administrator label from name column to status column

Filtering provided by the useUserFilter hook

Move UserFilter component for simplification

* Create UserRow component

Pull the Tr into its own component
Pull eslint / react-hooks updates for config
default dashboard is applied after dashboards are loaded and effects
have been simplified/flattened.

Clear dashboard on the default is clearing but SOMETHING is re-applying
it.
remove deprecated rules
Working config, failing lint with everything due to prettier and fixable
by prettier.
Move test history tab into memo

Destructure props on all components for consistency
* Use an object for UserFilter options

Provide a display name for the filter options instead of the api
parameter key

* Update ProjectEdit, useUserFilter hook

Change how owner selection works in the form.

Use the UserFilter hook to provide name and email filtering
specifically, instead of only name filtering via typeahead.

Having typeahead is nice, but assumes all users have SSO names set
properly, which they may not.

I think this layout works alright, and the default API params should
populate the list with the first 25 users with no filters applied

* variable rename
@mshriver mshriver force-pushed the feature-react-functional branch from c2fe801 to 7e7d0a5 Compare April 24, 2025 13:27
@mshriver
Copy link
Contributor Author

Manual rebase was required to resolve a few conflicts, so a force push updating the history with co-author commits was done.

@mshriver mshriver merged commit 3b6c256 into main Apr 24, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants