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

Item edit: Dynamically load UoM dimensions #2120

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Oct 8, 2023

Fixes #1926.
Awaiting openhab/openhab-core#3838.

Load the UoM dimensions for UoM Item types from the REST API instead of hard-coding them into the UI.

Fixes openhab#1926.

Load the UoM dimensions for UoM Item types from the REST API instead of hard-coding them into the UI.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from a team as a code owner October 8, 2023 22:33
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI awaiting other PR Depends on another PR labels Oct 8, 2023
@florian-h05 florian-h05 changed the title Item edit: Load UoM dimensions from REST instead Item edit: Dynamically load UoM dimensions from REST Oct 8, 2023
@florian-h05 florian-h05 changed the title Item edit: Dynamically load UoM dimensions from REST Item edit: Dynamically load UoM dimensions Oct 8, 2023
@relativeci
Copy link

relativeci bot commented Oct 8, 2023

Job #1187: Bundle Size — 15.79MiB (+0.2%).

a5b161d(current) vs b7270d2 main#1158(baseline)

Warning

Bundle contains 16 duplicate packages – View duplicate packages

Warning

Bundle introduced 13 new packages: @jsep-plugin/regex, @jsep-plugin/arrow, @jsep-plugin/object and 10 more – View changed packages

Bundle metrics  Change 10 changes Regression 5 regressions Improvement 1 improvement
                 Current
Job #1187
     Baseline
Job #1158
Regression  Initial JS 1.85MiB(+10.94%) 1.67MiB
Regression  Initial CSS 608.95KiB(+0.01%) 608.89KiB
Change  Cache Invalidation 93.81% 93.95%
Change  Chunks 217(-0.91%) 219
Change  Assets 683(-0.87%) 689
Change  Modules 2987(+75.71%) 1700
Regression  Duplicate Modules 173(+92.22%) 90
Improvement  Duplicate Code 1.61%(-17.44%) 1.95%
Regression  Packages 152(+10.14%) 138
Regression  Duplicate Packages 16(+6.67%) 15
Bundle size by type  Change 3 changes Regression 3 regressions
                 Current
Job #1187
     Baseline
Job #1158
Regression  JS 9.28MiB (+0.24%) 9.25MiB
Regression  Other 4.74MiB (+0.19%) 4.73MiB
Regression  CSS 860.19KiB (+0.08%) 859.49KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.23KiB 1.23KiB

View job #1187 reportView florian-h05:uom-dimensions-rest branch activity

<optgroup label="Numbers with Dimensions">
<option v-for="dimension in types.Dimensions" :key="dimension" :value="'Number:' + dimension" :selected="item.groupType === 'Number:' + dimension">
{{ 'Number:' + dimension }}
<optgroup label="Numbers with Dimensions (System Unit)">
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why we need this (I don't understand the addition and it would in some cases not fit, or barely):

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added (System Unit) to explain the unit which is displayed in the picker, but we can remove it.

Copy link
Member

Choose a reason for hiding this comment

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

I understand, we probably should have a system that better reflects how the underlying things work though - i.e. remove dimensions from the type picker altogether, and have another picker for the dimension appear when Number is picked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I have implemented and pushed this!

Copy link
Member

Choose a reason for hiding this comment

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

That was quick 😅

@florian-h05 florian-h05 removed the awaiting other PR Depends on another PR label Oct 9, 2023
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

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

I think this looks quite good!

@ghys ghys merged commit e987624 into openhab:main Oct 9, 2023
5 checks passed
@ghys ghys added this to the 4.1 milestone Oct 9, 2023
@florian-h05 florian-h05 deleted the uom-dimensions-rest branch October 9, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Number:ElectricConductivity missing in mainUI config dialog
2 participants