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

Link add/edit: Fix profile selection #2941

Merged
merged 4 commits into from
Dec 24, 2024

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Dec 22, 2024

Regression from #2690.

Reported here:
https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987

When creating a Thing channel link to an item, the profile selection are disabled. This presents two problems:

  • It made linking a trigger channel to an item not possible, because a profile must be selected, but they're disabled.
  • Linking a non-trigger channel to a new item is possible, but selecting a profile is not possible at link creation. The user has to create the link without a profile first, then go back to edit the link in order to assign a profile.

When editing a channel link, profile selection was possible for unsupported profiles, e.g. when editing a link between a Switch Item and a Number channel, one could edit the link to use the default or follow profiles.

This PR fixes these problems.

Note this needs to be backported to 4.3.x

@florian-h05
Copy link
Contributor Author

Supersedes #2936.

Copy link

relativeci bot commented Dec 22, 2024

#2592 Bundle Size — 10.9MiB (~+0.01%).

bb2c72b(current) vs 3861fa8 main#2591(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
#2592
     Baseline
#2591
No change  Initial JS 1.9MiB 1.9MiB
No change  Initial CSS 577.39KiB 577.39KiB
No change  Cache Invalidation 18.15% 18.15%
No change  Chunks 226 226
No change  Assets 249 249
Change  Modules 2947(+0.03%) 2946
No change  Duplicate Modules 154 154
No change  Duplicate Code 1.8% 1.8%
No change  Packages 96 96
No change  Duplicate Packages 2 2
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#2592
     Baseline
#2591
Regression  JS 9.11MiB (~+0.01%) 9.11MiB
No change  CSS 866.47KiB 866.47KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.38KiB 1.38KiB
No change  Other 871B 871B

Bundle analysis reportBranch florian-h05:link-profilesProject dashboard


Generated by RelativeCIDocumentationReport issue

@florian-h05
Copy link
Contributor Author

Wrt to #2936 (comment):

I have tested this and it still works 👍

@florian-h05
Copy link
Contributor Author

@jimtng Can you please test this PR?

@florian-h05 florian-h05 added bug Something isn't working main ui Main UI labels Dec 22, 2024
Copy link
Contributor

@jimtng jimtng left a comment

Choose a reason for hiding this comment

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

Thanks for the refactoring! Just one stylistic request below.

@jimtng
Copy link
Contributor

jimtng commented Dec 23, 2024

@jimtng Can you please test this PR?

It seems to work fine, but I'm not the one who's affected by this, so I can't say with 100% certainty. Could you build a jar and ask the people here to test: https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987

Signed-off-by: Florian Hotze <[email protected]>
@florian-h05 florian-h05 marked this pull request as ready for review December 24, 2024 08:45
@florian-h05 florian-h05 requested a review from ghys as a code owner December 24, 2024 08:45
@florian-h05 florian-h05 merged commit bd9c6f0 into openhab:main Dec 24, 2024
6 checks passed
@florian-h05 florian-h05 deleted the link-profiles branch December 24, 2024 08:46
@florian-h05 florian-h05 added this to the 5.0 milestone Dec 24, 2024
florian-h05 added a commit that referenced this pull request Dec 24, 2024
Regression from #2690.

Reported here:

https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987

When creating a Thing channel link to an item, the profile selection are
disabled. This presents two problems:

- It made linking a trigger channel to an item not possible, because a
profile must be selected, but they're disabled.
- Linking a non-trigger channel to a new item is possible, but selecting
a profile is not possible at link creation. The user has to create the
link without a profile first, then go back to edit the link in order to
assign a profile.

When editing a channel link, profile selection was possible for
unsupported profiles, e.g. when editing a link between a Switch Item and
a Number channel, one could edit the link to use the default or follow
profiles.

---------

Signed-off-by: Florian Hotze <[email protected]>
(cherry picked from commit bd9c6f0)
@florian-h05 florian-h05 added the patch A PR that has been cherry-picked to a patch release branch label Dec 24, 2024
@florian-h05
Copy link
Contributor Author

Merged as it has been confirmed in the linked community thread that the fix works.

@lsiepel
Copy link

lsiepel commented Dec 24, 2024

I would classify this as critical as this makes the profile selections not useable at all.

(together with #2690 )

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 patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants