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

[BasicUI] Add special handling for "none" icon #2534

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Apr 14, 2024

Same behaviour as in the Android app is now implemented for the "none" icon. This icon means "no icon" and we don't want to request the icon servlet. When this icon is associated to a sitemap element, the icon servlet is no more requested. Instead, a simple empty SVG tag is considered and inserted in the HTML page. There is also no dynamic behaviour (with item state) applied for this icon.

Additionally, in case the loading of any OH icon fails, the IMG tag is replaced by an empty SVG tag in the HTML page instead of updating the IMG source with the none icon URL (triggering a potential new icon servlet request).

Fix openhab/openhab-core#3977

Signed-off-by: Laurent Garnier lg.hc@free.fr

Same behaviour as in the Android app is now implemented for the "none" icon.
This icon means "no icon" and we don't want to request the icon servlet.
When this icon is associated to a sitemap element, the icon servletis no more requested.
Instead, a simple empty SVG tag is considered and inserted in the HTML page.
There is also no dynamic behaviour (with item state) applied for this icon.

Additionally, in case the loading of any OH icon fails, the IMG tag is replaced by an empty SVG tag in the HTML page.

Fix openhab/openhab-core#3977

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo lolodomo added enhancement New feature or request basic ui Basic UI labels Apr 14, 2024
@lolodomo lolodomo requested a review from a team as a code owner April 14, 2024 17:23
mueller-ma added a commit to mueller-ma/openhab.android that referenced this pull request Apr 22, 2024
See openhab/openhab-webui#2534

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
mueller-ma added a commit to mueller-ma/openhab.android that referenced this pull request Apr 22, 2024
See openhab/openhab-webui#2534

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Thanks!

@kaikreuzer kaikreuzer merged commit b27d713 into openhab:main Apr 27, 2024
3 checks passed
@kaikreuzer kaikreuzer added this to the 4.2 milestone Apr 27, 2024
@lolodomo lolodomo deleted the basicui_none_icon branch April 27, 2024 09:01
mueller-ma added a commit to openhab/openhab-android that referenced this pull request Apr 29, 2024
See openhab/openhab-webui#2534

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@dilyanpalauzov
Copy link

Are now icon="" and icon="none" semantically identical?

@mueller-ma
Copy link
Member

At least for Android it's handled the same way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic ui Basic UI enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IconServlet: IllegalStateException for /icon/none
4 participants