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

Update Main UI expressions docs #2111

Merged
merged 2 commits into from
Aug 7, 2023
Merged

Conversation

florian-h05
Copy link
Contributor

The docs mention chart pages as an exception where expressions aren't supported, but openhab/openhab-webui#1649 introduced support. This updates the docs.

The docs mention chart pages as an exception where expressions aren't supported, but openhab/openhab-webui#1649 introduced support. This updates the docs.

Signed-off-by: Florian Hotze <[email protected]>
@netlify
Copy link

netlify bot commented Aug 1, 2023

Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).

Name Link
🔨 Latest commit 2b333d4
🔍 Latest deploy log https://app.netlify.com/sites/openhab-docs-preview/deploys/64cfb1cb0726750008acfba6
😎 Deploy Preview https://deploy-preview-2111--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@stefan-hoehn stefan-hoehn left a comment

Choose a reason for hiding this comment

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

Thanks @florian-h05

@stefan-hoehn stefan-hoehn added this to the 4.1 milestone Aug 4, 2023
@stefan-hoehn
Copy link
Contributor

@florian-h05 still in draft?

@florian-h05
Copy link
Contributor Author

Yes.

@ghys Can you please have a look at this minor doc change and approve if it's correct?

@@ -144,7 +144,7 @@ See the [Component Reference](./components/) for details about the different lib

## Dynamically Configuring Components with Expressions

Virtually everywhere - with the notable exception of chart pages - every time you need a config prop to be dynamically updated, you can use an expression to configure it.
Virtually everywhere - with the notable exception of config properties of user-created widgets - every time you need a config prop to be dynamically updated, you can use an expression to configure it.
Copy link
Member

Choose a reason for hiding this comment

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

As I understand it now, this isn't true:

You can insert user-created widgets from another parent component and have their properties configured with expressions:

# Personal widget
uid: widget_4064e9fb1e
tags: []
props:
  parameters:
    - description: A text prop
      label: Prop 1
      name: prop1
      required: false
      type: TEXT
  parameterGroups: []
component: f7-card
config:
  style:
    display: flex
    justify-content: center
slots:
  default:
    - component: oh-link
      config:
        text: =props.prop1
        class:
          - margin
# Inserting the personal widget and configuring prop1 with an expression
component: widget:widget_4064e9fb1e
config:
  prop1: =2+3

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.

Thanks for the hint!
In the widget editor, properties are not evaluated, openhab/openhab-webui#2007 adds a note about that.

Signed-off-by: Florian Hotze <[email protected]>
@florian-h05 florian-h05 marked this pull request as ready for review August 6, 2023 14:44
@florian-h05
Copy link
Contributor Author

@stefan-hoehn This is ready to be merged now.

Copy link
Contributor

@stefan-hoehn stefan-hoehn left a comment

Choose a reason for hiding this comment

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

LGTM, Florian, thx.

@stefan-hoehn stefan-hoehn merged commit 1e578a9 into openhab:main Aug 7, 2023
@florian-h05 florian-h05 deleted the patch-1 branch August 7, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants