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

Autocomplete for YAML editors #364

Merged
merged 9 commits into from
Oct 3, 2020
Merged

Autocomplete for YAML editors #364

merged 9 commits into from
Oct 3, 2020

Conversation

ghys
Copy link
Member

@ghys ghys commented Sep 30, 2020

Add some autocomplete ("hint" in CodeMirror jargon) logic to YAML
editors for UI components and rules. Might be expanded to other entities
in the future.

Signed-off-by: Yannick Schaus [email protected]

@ghys ghys requested a review from a team as a code owner September 30, 2020 19:48
@ghys ghys marked this pull request as draft September 30, 2020 19:49
ghys added 4 commits October 1, 2020 17:22
This introduces a way to set page-local or widget-local
variables to allow more complex scenarios in pages & custom
widget development.

Variables can be used using several methods:

- the "variable" config parameter of oh-gauge (read-only),
  oh-input (new), oh-knob, oh-slider, oh-stepper, oh-toggle
  will accept a variable name and control it instead of
  sending commands to items if set. The "item" parameter can
  still be set to set the widget to the item's state, when
  the variable has no value.
- the "vars" object available in expressions (for example
  `=vars.var1` will evaluate to the value of the variable `var1`.
- the "variable" action allows to set an fixed or computed
  (using an expression) value to a variable.

Variables set directly by widgets on a page will propagate
to all components to the page, including personal widgets.
However, variables set within a personal widget will be scoped
to that personal widget only - except when there's already an
inherited variable with the same name.

oh-button & oh-link have a special parameter "clearVariable"
which allows to unset a version when clicked, after performing
the action. This is useful when "validating" a variable e.g.
set a command to an item with the variable value then reset it.

Allow oh-image to perform an action when clicked directly.

Signed-off-by: Yannick Schaus <[email protected]>
Add some autocomplete ("hint" in CodeMirror jargon) logic to YAML
editors for UI components and rules. Might be expanded to other entities
in the future.

Signed-off-by: Yannick Schaus <[email protected]>
Allow switching to run mode from Code tab in editors.

More "aggressive" autocompletion (continue
autocompleting after picking an entry, autocomplete
after typing certain characters).

Styling fixes in widget editor.

Signed-off-by: Yannick Schaus <[email protected]>
ghys added 4 commits October 1, 2020 20:44
Ensures the back button/gesture doesn't mess up navigation.

Signed-off-by: Yannick Schaus <[email protected]>
Perform completions on chart, map, plan widgets
Update media types according to AC discussions.

Signed-off-by: Yannick Schaus <[email protected]>
@ghys ghys changed the title [WIP] Autocomplete for YAML editors Autocomplete for YAML editors Oct 3, 2020
@ghys ghys marked this pull request as ready for review October 3, 2020 22:40
@ghys ghys merged commit 52db413 into openhab:master Oct 3, 2020
@kaikreuzer kaikreuzer added this to the 3.0.0.M1 milestone Oct 11, 2020
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.

2 participants