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

Thing picker: Fix failure caused by missing label & Show UID #1837

Merged

Conversation

stefan-hoehn
Copy link
Contributor

@stefan-hoehn stefan-hoehn commented Apr 11, 2023

The Thing picker did not work when a Thing has no label (which is possible, the label is optional). This change makes the sorting fallback to the UID if no label is set.

While working on this I also added the UID of the thing to the thing picker similarly like it is in the item-picker.
Fixes #1485

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
@stefan-hoehn stefan-hoehn requested a review from a team as a code owner April 11, 2023 09:18
@relativeci
Copy link

relativeci bot commented Apr 11, 2023

Job #912: Bundle Size — 15.71MiB (~-0.01%).

b88645d(current) vs 3401527 main#911(baseline)

⚠️ Bundle contains 16 duplicate packages

Metrics (no changes)
                 Current
Job #912
     Baseline
Job #911
Initial JS 1.73MiB 1.73MiB
Initial CSS 608.8KiB 608.8KiB
Cache Invalidation 93.93% 93.93%
Chunks 219 219
Assets 689 689
Modules 1710 1710
Duplicate Modules 82 82
Duplicate Code 1.72% 1.72%
Packages 137 137
Duplicate Packages 15 15
Total size by type (2 changes)
                 Current
Job #912
     Baseline
Job #911
CSS 858.34KiB 858.34KiB
Fonts 526.1KiB 526.1KiB
HTML 1.23KiB 1.23KiB
IMG 140.74KiB 140.74KiB
JS 9.22MiB (~-0.01%) 9.22MiB
Media 295.6KiB 295.6KiB
Other 4.72MiB (~-0.01%) 4.72MiB

View job #912 reportView main branch activity

@florian-h05 florian-h05 changed the title fix thing picker when label is empty Fix thing picker fails when label is empty Apr 11, 2023
@florian-h05 florian-h05 changed the title Fix thing picker fails when label is empty Fix thing picker fails when Thing label is not set Apr 11, 2023
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.
The added UID in the Thing picker makes the entries sometimes really long, but it is very helpful to have the UIDs and it is now similar to the Item picker, so I’m fine with it.

@florian-h05 florian-h05 changed the title Fix thing picker fails when Thing label is not set Thing picker: Fix failure caused by missing label & Show UID Apr 14, 2023
@florian-h05 florian-h05 added bug Something isn't working main ui Main UI labels Apr 14, 2023
@florian-h05 florian-h05 added this to the 4.0 milestone Apr 14, 2023
@florian-h05 florian-h05 merged commit af1b0a3 into openhab:main Apr 14, 2023
@florian-h05 florian-h05 deleted the fix_emptythinglabel_thingpicker branch April 14, 2023 16:07
florian-h05 pushed a commit that referenced this pull request Apr 30, 2023
Thing picker sort uses wrong UID attribute as fallback during sort of
thing list.

Follow-up for #1837.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show thing type or id when linking to channel
2 participants