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

update React/Redux usage #726

Closed
10 tasks done
huss opened this issue Mar 2, 2022 · 3 comments
Closed
10 tasks done

update React/Redux usage #726

huss opened this issue Mar 2, 2022 · 3 comments
Labels
p-medium-priority t-enhancement This issues tracks a potential improvement to the software
Milestone

Comments

@huss
Copy link
Member

huss commented Mar 2, 2022

Is your feature request related to a problem? Please describe.

OED has been transitioning to use React hooks. The following pages already use them:

  • Unit pages: src/client/app/components/units/ on several pages
  • Conversion pages: src/client/app/components/conversions/ on several pages
  • Meter pages: src/client/app/components/meters/ on several pages
  • Group pages: src/client/app/components/groups/ on several pages
  • User pages: src/client/app/components/admin/users/* but they do not deal with state
  • Rate menu: src/client/app/components/GraphicRateMenuComponent.tsx
  • Export page: src/client/app/components/ExportComponent.tsx
  • Menus for graphic data choices: src/client/app/components/ChartDataSelectComponent.tsx
  • Map menu (seems done): src/client/app/components/MapChartSelectComponent.tsx

There are other pages that are already being done or planned as part of other work:

  • Page choices: src/client/app/components/HeaderButtonsComponent.tsx
  • Options on left side of page: src/client/app/components/MultiSelectComponent.tsx, src/client/app/components/groups/DatasourceBoxComponent & Container, src/client/app/components/ChartLinkComponent.tsx & Container, src/client/app/components/LanguageSelectorComponent.tsx & Container, src/client/app/components/UIOptionsComponent.tsx & Container

The items remaining are:

There should be linked items for each of the needed items but this issue tracks the overall situation and each item should be checked off as the needed code is merged into OED.

Describe the solution you'd like

Brief introduction to what needs to be done

When code is transitioned to React hooks, the following can occur:

  • The component/container pair has the container eliminated. The component is converted to a function if it was a class.
  • The state accessed from the container and passed as props to the component is now accessed via selectState and useState.
  • State updates are done via the set function returned by useState.
  • useEffect is used, as needed, to cause updates to state/variables needed for rendering.

There are a number of web sources of information on doing this conversion which may be helpful.

Describe alternatives you've considered

The conversion has already begun so it should just continue. No real alternatives.

@huss huss moved this to Todo in General Project Board Mar 2, 2022
@huss huss added p-medium-priority t-enhancement This issues tracks a potential improvement to the software labels Mar 2, 2022
@huss huss moved this from Todo to In Progress in General Project Board Apr 25, 2022
@jina2k jina2k mentioned this issue May 27, 2022
5 tasks
@huss
Copy link
Member Author

huss commented Sep 12, 2022

As of PR #788, the following have been updated to use React hooks:

  • dropdown menus for graphing
  • meter admin page
  • unit admin page
  • conversion admin page

@huss
Copy link
Member Author

huss commented Jun 25, 2023

See .eslintrc.json where there are a couple of TODO items that would be addressed once all the containers are removed.

@huss
Copy link
Member Author

huss commented Apr 4, 2024

All these items are either done or migrated to new issues. Thus, this issue is being closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-medium-priority t-enhancement This issues tracks a potential improvement to the software
Projects
No open projects
Status: In Progress
Development

No branches or pull requests

2 participants