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

changing what a unit represents can cause issue #906

Closed
huss opened this issue May 20, 2023 · 8 comments · Fixed by #1013
Closed

changing what a unit represents can cause issue #906

huss opened this issue May 20, 2023 · 8 comments · Fixed by #1013
Assignees
Labels
assigned the issue is currently being worked on by a developer

Comments

@huss
Copy link
Member

huss commented May 20, 2023

Describe the bug

If you change what a unit represents then bad things can happen. A conversion might now exist between different types of units. During creation this is not allowed. This is esp. dangerous if this is the meter graphing unit.

Expected behavior

OED should stop a user from making this type of edit and be told to fix up the dependencies. Similar types of checks happen in group edits.

Additional context

None

@salhernandez
Copy link

@huss my team would like to work on it for CodeDay. Can I get it assigned please.

@huss huss added the assigned the issue is currently being worked on by a developer label Aug 15, 2023
@1jc
Copy link

1jc commented Aug 26, 2023

@1jc started research on this issue

@1jc
Copy link

1jc commented Sep 6, 2023

pull request #1004

@huss please review

@1jc
Copy link

1jc commented Sep 7, 2023

reference to issue #906

How to modify?

If this is a non-admin then the page has a table with:
| Identifier | Unit | Default Graphic Unit | Enabled |
followed by one row for each meter with this information sorted by Identifier.
Unit and Default Graphic Unit will give the identifier of the unit associated with this id.

If this is an admin user then the page initially has a table with:
| Identifier | Unit | Default Graphic Unit | Displayable | Enabled | Edit/More Info |
followed by one row for each meter with this information sorted by Identifier.
Unit and Default Graphic Unit will give the identifier of the unit associated with this id.

The Edit/More info column has one button per row that is labeled Edit/More Info. If it is clicked then that meter row is expanded to show all 25 items
associated with a meter along with ability to edit each one. If possible, it would be nice to show the expanded list in its same place in the table. If not,
it could be done at the bottom of the page. The single row for the meter would become 5 rows (or 10 if the value is below) as follows:
| Identifier | Unit | Default Graphic Unit | Meter Type | GPS | Area |
| Displayable | Enabled | Meter Address | Timezone | note |
| Cumulative | Cumulative Reset | Reset Start | Reset End |
| Time Sort | End Only | Reading Gap | Reading Variation | Reading Duplication |
| Reading | Start Date/Time | End Date/Time | ID | Name | Save Button | Close/Cancel Button |
where the value for this meter would be with or right below the item. The Save Button would become clickable if any meter value was edited.
The other button would start as Close but switch to Cancel if an edit it done. It would be good to have a confirmation for Cancel so as not to accidentally lose edits.

Each item can be edited as follows:

  • Identifier is text that can be anything as long as it has at least one character. The database enforces that it is unique.
  • Unit is a drop down menu with a listing of all units as their identifier that are of type meter where the current unit is selected.
  • Meter Type is a drop down menu with the types in the enumerated type Meter.type are listed and the current one selected.
  • Default Graphic Unit is the identifier of every unit that is compatible with the meter's unit. This will be done as part of resource generalization but the basic drop down with all meter units can be listed for now.
  • GPS is text with checks on values as it currently is done.
  • Area is a floating point that is either empty or greater than zero.
  • Displayable is a boolean value where it has a toggle button as it currently has.
  • Enabled is a boolean value where it has a toggle button as it currently has.
  • Meter Address is text as it currently has.
  • Timezone is a drop down menu as it currently is with the current value selected.
  • note is text that can be edited in any way.
  • Cumulative is a boolean that toggles like other boolean values.
  • Cumulative Reset is a boolean that toggles like other boolean values.
  • Reset Start is a time value probably entered as text. It must be between 00:00:00 and 23:59:59.999999 with the format HH:MM:SS where the decimal on seconds is optional.
  • Reset End is a time value probably entered as text. It must be between 00:00:00 and 23:59:59.999999 with the format HH:MM:SS where the decimal on seconds is optional.
  • Time Sort is a boolean that toggles like other boolean values. The two possible values are in the enumerated type TimeSortTypes but meter/default is not an option.
  • End Only is a boolean that toggles like other boolean values but note it is handled similarly to Time Sort on the CSV page.
  • Reading Gap is a floating point value that must be greater than 0.
  • Reading Variation is a floating point value that must be greater than 0.
  • Reading Duplication is an integer value that is between 1 and 9. It might be best to use a drop down menu where the current value is selected.
  • Reading is a floating point value.
  • Start Date/Time is a date/time value in the format YYYY-MM-DD HH:MM:SS. It might be entered as text.
  • End Date/Time is a date/time value in the format YYYY-MM-DD HH:MM:SS. It might be entered as text.
  • ID is an integer that cannot be edited.
  • Name is text that cannot be edited.
  • The CSV upload pages show many of these and the admin help pages have information on those pages.

Development Workflow

OED uses feature branches and enforced CI. To make a change:

  1. Clone the repository
  2. Make a new branch for your changes
  3. Make and commit changes
  4. Run npm run check and npm run test to ensure your changes will pass CI
  5. Push and open a pull request ( instructions - https://openenergydashboard.github.io/developer/pr.html )
  6. Instructions to test data ( https://openenergydashboard.github.io/developer/testData.html )

@1jc 1jc mentioned this issue Sep 7, 2023
2 tasks
@1jc
Copy link

1jc commented Sep 9, 2023

1jc see comments by "@huss" on PR #1005 huss accepted new documentation to resolve issue #906

@huss
Copy link
Member Author

huss commented Sep 9, 2023

Thanks to @1jc. Just to clarify, the proposed documentation is useful for the help pages but this issue remains open as OED wants the software modified to stop this type of change,

@qnhn22
Copy link
Contributor

qnhn22 commented Sep 12, 2023

I would like to work on this issue.

@1jc
Copy link

1jc commented Sep 16, 2023

@1jc see Pull Request #1005 closed due to documentation included see comment by huss This text was included as appropriate in the planned update to the meter creation page in this commit. Given this, this PR can now be closed. Again, thanks to @1jc for submitting this to OED.

Thanks to huss @1jc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned the issue is currently being worked on by a developer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants