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 a new header line for image, chart and video elements. #2010

Merged
merged 2 commits into from
Sep 9, 2023

Conversation

lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Aug 8, 2023

Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to switch between no upscale and upscale of the image. Header line for chart element contains icon, label and 4 buttons:

  • one button to show or hide the legend
  • one button to change the time range
  • one button to switch between no upscale and upscale of the chart
  • one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and webview elements.

For image and chart elements, the header line is always present so that user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the header line is hidden.

For chart and image elements, there is now no upscale applied by default (tablet/phone devices) but a button allows upscaling.

Closes #1939
Fixes #1367
Also related to #1930

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

@lolodomo lolodomo added enhancement New feature or request basic ui Basic UI labels Aug 8, 2023
@lolodomo lolodomo requested a review from a team as a code owner August 8, 2023 21:57
@lolodomo
Copy link
Contributor Author

lolodomo commented Aug 8, 2023

Considering the following sitemap:

sitemap test8 label="Tests"
{
	Frame {
		Switch item=TestCommand label="Color icon []" icon="colorpicker" mappings=[10="red", 11="green", 12="Other"]
		Switch item=TestCommand2 label="Color label []" icon="colorpicker" mappings=[10="blue", 11="orange", 12="Other"]
		Switch item=TestSwitch label="Show widgets []" mappings=[OFF="Without label", ON="With label"]
		Input item=TestLocation inputHint="text" icon="none"
	}
	Frame {
		Chart item=TestNumber period=W legend=true refresh=60000 label="Chart example with a very long label" labelcolor=[TestCommand2==11="orange",TestCommand2==10="blue"] icon="material:show_chart" iconcolor=[TestCommand==11="green",TestCommand==10="red"] visibility=[TestSwitch==ON]
		Chart item=TestNumber period=W legend=true refresh=60000 label="" visibility=[TestSwitch==OFF]
	}
	Frame {
		Image url="https://www.openhab.org/openhab-logo-square.png" label="Image example with a very long label for the header" labelcolor=[TestCommand2==11="orange",TestCommand2==10="blue"] icon="material:favorite" iconcolor=[TestCommand==11="green",TestCommand==10="red"] visibility=[TestSwitch==ON]
		Image url="https://www.openhab.org/openhab-logo-square.png" visibility=[TestSwitch==OFF]
	}
	Frame {
		Mapview item=TestLocation label="Map view example with a very long label for the header" labelcolor=[TestCommand2==11="orange",TestCommand2==10="blue"] icon="material:home" iconcolor=[TestCommand==11="green",TestCommand==10="red"] visibility=[TestSwitch==ON]
		Mapview item=TestLocation label="" visibility=[TestSwitch==OFF]
	}
	Frame {
		Webview url="https://www.openhab.org/" height=10 label="WEB view example with a very long label for the header" labelcolor=[TestCommand2==11="orange",TestCommand2==10="blue"] icon="material:home" iconcolor=[TestCommand==11="green",TestCommand==10="red"] visibility=[TestSwitch==ON]
		Webview url="https://www.openhab.org/" height=10 visibility=[TestSwitch==OFF]
	}
	Frame {
		Video url="http://techslides.com/demos/sample-videos/small.mp4" label="Video example with a very long label for the header" labelcolor=[TestCommand2==11="orange",TestCommand2==10="blue"] icon="material:home" iconcolor=[TestCommand==11="green",TestCommand==10="red"] visibility=[TestSwitch==ON]
		Video url="http://techslides.com/demos/sample-videos/small.mp4" visibility=[TestSwitch==OFF]
	}
}

First the result when there is no label or an empty label for a widget:
image
image
image

And now with a label defined:
image
image
image
image

After removing the legend, changing time range to 1 day and upscaling the chart::
image

After upscaling the image:
image

@lolodomo
Copy link
Contributor Author

lolodomo commented Aug 8, 2023

Another example to show when the elements are in the same frame:

sitemap test7 label="Tests header line"
{
	Frame {
		Input item=TestLocation inputHint="text" icon="material:home"
		Chart item=TestNumber period=4h refresh=60000 icon="chart"
		Mapview item=TestLocation icon="material:home"
	}
}

On phone/tablet (1 column):
image

On desktop (2 columns):
image

@lolodomo
Copy link
Contributor Author

lolodomo commented Aug 9, 2023

My intention was to use icon in all buttons but some material icons I would like to use are missing. I will update a second step when all material icons are accessible.

@lolodomo
Copy link
Contributor Author

My intention was to use icon in all buttons but some material icons I would like to use are missing. I will update a second step when all material icons are accessible.

Let's wait for the merge of #2016 so that I can include the icons I would like for the chart header line.

@lolodomo lolodomo added the awaiting other PR Depends on another PR label Aug 11, 2023
@mueller-ma
Copy link
Member

It feels a bit strange to me that one has to add a label to a chart to get the new buttons. Maybe show the header for charts always?

@lolodomo
Copy link
Contributor Author

It feels a bit strange to me that one has to add a label to a chart to get the new buttons. Maybe show the header for charts always?

Yes, you're right. Same for image. I will change that.

@lolodomo
Copy link
Contributor Author

I have updated all the screenshots.
The PR is now ready for a review & merge.

@lolodomo
Copy link
Contributor Author

I discovered that the update of label/icon color is broken for the colorpicker with this PR. Put again this PR in WIP.

@lolodomo lolodomo marked this pull request as draft August 16, 2023 11:40
Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to switch between no upscale and upscale of the image. Header line for chart element contains icon, label and 4 buttons:
 - one button to show or hide the legend
 - one button to change the time range
 - one button to switch between no upscale and upscale of the chart
 - one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and webview elements.

For image and chart elements, the header line is always present so that user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the header line is hidden.

For chart and image elements, there is now no upscale applied by default (tablet/phone devices) but a button allows upscaling.

Closes openhab#1939
Fixes openhab#1367
Also related to openhab#1930

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo lolodomo marked this pull request as ready for review August 16, 2023 12:19
@lolodomo
Copy link
Contributor Author

I discovered that the update of label/icon color is broken for the colorpicker with this PR. Put again this PR in WIP.

It was just a mismatch between undefined and null in JavaScript.
The PR is ready again.

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.

That's a great enhancement, thank you!

@kaikreuzer kaikreuzer merged commit 08a2d80 into openhab:main Sep 9, 2023
@kaikreuzer kaikreuzer added this to the 4.1 milestone Sep 9, 2023
@lolodomo lolodomo deleted the basicui_chart branch September 9, 2023 10:46
@lolodomo
Copy link
Contributor Author

lolodomo commented Sep 9, 2023

Thank you for the review Kai.

stefan-hoehn pushed a commit to stefan-hoehn/openhab-webui that referenced this pull request Sep 23, 2023
…penhab#2010)

Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to
switch between no upscale and upscale of the image. Header line for
chart element contains icon, label and 4 buttons:
 - one button to show or hide the legend
 - one button to change the time range
 - one button to switch between no upscale and upscale of the chart
 - one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and
webview elements.

For image and chart elements, the header line is always present so that
user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the
header line is hidden.

For chart and image elements, there is now no upscale applied by default
(tablet/phone devices) but a button allows upscaling.

Closes openhab#1939
Fixes openhab#1367
Also related to openhab#1930

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
JustinGeorgi pushed a commit to JustinGeorgi/openhab-webui that referenced this pull request Sep 24, 2023
…penhab#2010)

Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to
switch between no upscale and upscale of the image. Header line for
chart element contains icon, label and 4 buttons:
 - one button to show or hide the legend
 - one button to change the time range
 - one button to switch between no upscale and upscale of the chart
 - one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and
webview elements.

For image and chart elements, the header line is always present so that
user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the
header line is hidden.

For chart and image elements, there is now no upscale applied by default
(tablet/phone devices) but a button allows upscaling.

Closes openhab#1939
Fixes openhab#1367
Also related to openhab#1930

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: jgeorgi <justin.georgi@gmail.com>
JustinGeorgi pushed a commit to JustinGeorgi/openhab-webui that referenced this pull request Sep 24, 2023
…penhab#2010)

Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to
switch between no upscale and upscale of the image. Header line for
chart element contains icon, label and 4 buttons:
 - one button to show or hide the legend
 - one button to change the time range
 - one button to switch between no upscale and upscale of the chart
 - one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and
webview elements.

For image and chart elements, the header line is always present so that
user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the
header line is hidden.

For chart and image elements, there is now no upscale applied by default
(tablet/phone devices) but a button allows upscaling.

Closes openhab#1939
Fixes openhab#1367
Also related to openhab#1930

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: jgeorgi <justin.georgi@gmail.com>
digitaldan pushed a commit to digitaldan/openhab-webui that referenced this pull request Sep 24, 2023
…penhab#2010)

Header line for video element contains icon and label.

Header line for image element contains icon, label and a button to
switch between no upscale and upscale of the image. Header line for
chart element contains icon, label and 4 buttons:
 - one button to show or hide the legend
 - one button to change the time range
 - one button to switch between no upscale and upscale of the chart
 - one button to refresh the chart

Fix handling of iconcolor and labelcolor parameters for mapview and
webview elements.

For image and chart elements, the header line is always present so that
user has an access to its buttons.
For video, mapview and webview elements, if the label is empty, the
header line is hidden.

For chart and image elements, there is now no upscale applied by default
(tablet/phone devices) but a button allows upscaling.

Closes openhab#1939
Fixes openhab#1367
Also related to openhab#1930

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
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.

[Basic UI] Change settings for loaded Charts [Sitemap] Missing chart labels
3 participants