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

Units Page, Select Component Dropdowns, New Graphic Rate Dropdowns #787

Conversation

Deelane
Copy link
Contributor

@Deelane Deelane commented Jul 24, 2022

Description

Units Page

Overhauled the units page as introduced in PR 766, including additional functionality, bugfixes, and updates. The page is now complete and is being used as the template for the creation of similar pages like the Meters and Conversions pages.

Notable changes are as follows:

  • Components converted to hooks and now uses hooks to access and alter Redux store and local state.
  • Container files removed.
  • Actions optimized, unnecessary actions removed.
  • State/Reducers optimized, unnecessary state removed.
  • Fixed bugs with reducers not properly updating store state.
  • Updated UI visuals.

Meters Page (TODO)

Updated to match units page functionality and interface using units page as template. This is partly done at this time in code included in this PR.

Select Component Dropdowns

Added functionality and fixed bugs associated with selecting groups, meters, and units from the dropdowns in the ChartDataSelectComponent. The component should now work as intended.

Notable changes are as follows:

  • Added functions for determining compatibility for groups and meters with other selected items.
  • Fixed bugs where store state was not properly updated.
  • Fixed bugs associated with unselecting a unit.
  • Select items are now properly disabled if they are incompatible with other items.
  • Added functionality allowing for switching between units without clearing the unit.
  • Clearing the selected unit now clears all meters and groups, resetting the graph.

New Graphic Rate Menu

Added a new rate menu allowing for changing of the time unit for line graphs.

Issues Addressed

Partly Addresses #726
TODO Fixes #644

Developer test data

Code was added to create units, meters and groups for testing the updated system. I directly adds via code rather than using CSV files (previous CSV used for this are now removed). The script testData now uses this code.

TODO Need some more added to deal with rate changes because kWh and kW are treated specially.

Type of change

  • Note merging this changes the node modules
  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request

Limitations

The TODOs must still be addressed.

Andrew and others added 30 commits February 23, 2022 06:03
edited units details component, container, etc
added header and footer to UnitDetailsComponent
Added the button to identifier. Need to fix the logic
Revert "Added the button to identifier. Need to fix the logic"
wootent and others added 14 commits July 21, 2022 15:23
…disabled if incompatible, non-admin selects now properly hidden, groups/meters without default graphic unit now disabled when no unit is selected, fixed bug where selecting unit first did not allow graphing, added buttons to clear selects
- Allow meters & groups to control displayable value.
- Allow meters to not have a unit (-99).
- Added some meters/groups for new options/testing.
…fferent time rates for line graphs of specific unit types
- Put back special label for kWh/hour by fixing check.
- Remove TODO on raw/flow since flow correctly handled above.
- Fix hover label so matches new rate value plotted.
- Add translations for hour, minute, second in French/Spanish.
We don't include these types of files to the repo.
- Update how label kWh & kW and don't allow rate change on these.
- Fix so hoverText on line graphic shows scaling value.
- Added lots of missing translations outside English and removed a few
that no longer used.
- Put in unit create/edit tooltip help & links
- Remove test script and CSV files for unit tests as now included
in TesData
- Remove debug check that only one meter/group when selectedUnit is -99
- Some small changes to comment wording.
- Lots of small formatting changes.
@huss
Copy link
Member

huss commented Jul 26, 2022

I just pushed changes to the PR. See commit message/code changes for details.

I also note that the check is failing. All GitHub Action checks started failing recently so this is not an issue with this PR. I did run them locally and they all passed so I think the PR is okay.

My review should be posted soon.

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

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

Overall this works as expected. I did not look at the meter code yet since it was not done. I have left some comments to address. Thanks for the good work.

src/client/app/components/ChartDataSelectComponent.tsx Outdated Show resolved Hide resolved
src/client/app/components/RouteComponent.tsx Outdated Show resolved Hide resolved
src/client/app/components/unit/EditUnitModalComponent.tsx Outdated Show resolved Hide resolved
src/client/app/types/redux/actions.ts Show resolved Hide resolved
src/client/app/types/redux/actions.ts Show resolved Hide resolved
src/client/app/utils/api/unitsApi.ts Outdated Show resolved Hide resolved
src/server/routes/units.js Outdated Show resolved Hide resolved
src/server/routes/units.js Outdated Show resolved Hide resolved
@huss
Copy link
Member

huss commented Jul 27, 2022

@wootent There are two comments on this PR that seem to involve code you added. They ask whether actions are needed since they don't seem to be used at this time. They are: EDIT_METER_DETAILS and DELETE_EDITED_METER. However, they might be used in upcoming work or I missed something. Could you let us know? Thanks.

@huss
Copy link
Member

huss commented Jul 27, 2022

The update by @Deelane covers everything involving them. The PR seems fine for units and the dropdown menus. It is on hold since it also has partly completed meter page work.

@huss huss changed the title Units Page, (TODO Meters Page, Conversions Page), Select Component Dropdowns, (TODO New Graphic Rate Menu) Units Page, (TODO Meters Page), Select Component Dropdowns, New Graphic Rate Dropdowns Jul 27, 2022
- Add Water quantity and flow units/conversions/meters to allow testing
of rate menu
- Allow rate for units for test data
- Always try to insert standard units in case missing for test data
- Fix up Postgres commands to remove all test data
- Add TODO about unused action
@huss
Copy link
Member

huss commented Jul 28, 2022

I just pushed changes for test data for rate meters and a comment on the extra action.

@huss huss changed the title Units Page, (TODO Meters Page), Select Component Dropdowns, New Graphic Rate Dropdowns Units Page, Select Component Dropdowns, New Graphic Rate Dropdowns Jul 31, 2022
@huss
Copy link
Member

huss commented Jul 31, 2022

The meter work is in PR #786 so merging this so others can easily incorporate.

@huss huss merged commit 5378708 into OpenEnergyDashboard:resourceGeneralization Jul 31, 2022
@huss huss mentioned this pull request Oct 2, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.