Commit Graph

318 Commits (1392a986589af3d7cd3d49340c58b906a2765d53)

Author SHA1 Message Date
Yannick Schaus 9f7c5cb663
Fix off-by-one in inbox event topic detection (#305)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-12 08:13:49 +02:00
Wouter Born 60e6c78b5a
Use "openhab" event topic prefix (#304)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 21:16:56 +02:00
Yannick Schaus 7ca5d1fcc0
Display config parameters defaults & status info (#302)
Pre-fill config parameters controls with the default
value if provided in the config description.

Display thing configuration parameter status info.

Fixes #285.
Fixes #293.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-11 20:57:19 +02:00
Yannick Schaus b2b965e982
Add version & system info to about page. (#303)
* Add version & system info to about page.
Uses info from https://github.com/openhab/openhab-core/pull/1570 if available.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-11 20:56:15 +02:00
Wouter Born 3ca51b0e35
Migrate to JUnit 5 (#300)
* Migrates all tests to the JUnit 5 Jupiter API
* Updates bnd to 5.1.2
* Updates maven-surefire-plugin to 3.0.0-M5
* Removes org.openhab.core.boot POM dependencies

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-09 16:44:02 +02:00
Yannick Schaus a32668a652
Fix HABPanel REST resource not registered (#289)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-09 14:34:22 +02:00
Yannick Schaus 70b3b9f750
[Main UI] Include bridgeID in thingUID on manual creation (#298)
This will include the ID of the bridge in the ThingUID if it is specified during the
manual creation of the thing.

The thingUID format will therefore be
`binding:thingType:bridgeID:thingID` if a
bridge is specified during the creation,
otherwise it will be `binding:thingType:thingID`.
This is consistent with the naming convention
adopted when creating things by other means
(files, inbox).

Note that the thingUID is immutable once the thing has been created, so the
bridge ID part will be false or missing when
the bridge is altered or assigned after the
creation.
Relying on the thingUID to determine the bridge
should be discouraged.
See https://github.com/openhab/openhab-addons/pull/7496#discussion_r426005622

Fixes #290.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-08 19:44:21 +02:00
Wouter Born 7453955770
Migrate to OpenAPI 3 annotations (#299)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-02 16:14:55 +02:00
Yannick Schaus 3c597f5ed7
Embed Swagger UI as a developer tool in the main UI (#297)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-24 22:40:47 +02:00
Kai Kreuzer 25f7d6c47c
adapted wording from extension to add-on (#295)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-23 17:17:11 +02:00
Yannick Schaus 04505bb876
[restdocs] Upgrade Swagger UI to 3.30.0 (#296)
This release introduces syntax highlighting of the
JSON examples and payloads.

Enable option to sort operations and tags alphabetically.

Enable option to display a filter box.

Fix OAuth2 redirect URL.

Replace o2c.html contents with current version from upstream.

Remove swagger-ui.js (not required if using swagger-ui-bundle.js).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-22 17:57:18 +02:00
Kai Kreuzer 961bd65f68
Updates Swagger UI to version 3.28.0 (#294)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-21 20:32:55 +02:00
Yannick Schaus 899a8fdcf9
Fix item type not trimmed in lexer (#282)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-01 19:52:33 +02:00
Yannick Schaus 2d8dda50c9
Add oh-knob widget to system library (#288)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-01 19:50:57 +02:00
Yannick Schaus 8b4169eff7
Use distinct endpoint to save thing configuration (#287)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-22 20:35:08 +01:00
Chris Jackson 0732bb8f9d
Remove tag incorrectly added in previous PR (#284)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-22 12:55:29 +02:00
Chris Jackson 74be454d15
Fix conditional display of sections on settings page (#280)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-20 23:06:41 +02:00
Chris Jackson 58def6bc5d
Don't allow adding new bindings if not supported by server (#281)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-20 14:02:57 +02:00
Chris Jackson 82b36714e3
Fix duplicate thing state being printed (#279)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-18 10:30:14 +02:00
Yannick Schaus 57ac4ab0dd
Fix points names in Add Points to Model scenario (#278)
Fix a bug introduced with #275 when points being added to the model without an
equipment would not have their default name properly computed.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 20:12:37 +02:00
Yannick Schaus a41d91f926
Fix desktop HABot interim results regression (#277)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:50 +02:00
Yannick Schaus 23ba7caaf1
Config parameter options shown inline if 5 or less (#276)
Fix parameter not saved when unset & absent from payload on save.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:30 +02:00
Yannick Schaus 238a0aecee
Add Items from Thing: use model picker for parent group (#275)
Use a treeview-based semantic picker to select a parent
location or equipment group item when using the
Add Equipment to Model or Add Points to Model functions
in a Thing's Channels tab.
Replaces the current flat list of group items.

Add functionality to the model picker popup to support this
use case and adjust some texts and controls on the page.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:07 +02:00
Dan Cunningham 98ab3be96b
Main UI Fix for selecting multiple items in the inbox (#273)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-06-16 18:13:14 +02:00
Yannick Schaus 2cf8d8cedf
Main UI HABot client on home page (#271)
This implementation transforms certain cards issued
by HABot for its own GUI to compatible equivalents.
It will not try to transform cards saved on HABot's
"card deck"/CardRegistry because they may have been
modified and compatiblity cannot be guaranteed.

The main UI's client calls /rest/habot/chat with a
`?useCardRegistry=false` option which has to be added
to the API to prevent saved cards from being reused.
This will be done in a separate PR.

The chat input box appears on the home page only if
the "habot" endpoint is present, by calling the root
/rest early to determine the version of the API and
its links (it's stored in the Vuex store for the
remainder of the session for easy access). It's also
possible to disable the feature on a per-device basis
with an option on the about page.

The 5 most recent unique queries will be retained for
quick recalling (also per-device, stored in the local
storage).

For charts, it simply opens the Analyzer window since
since image-related support in widgets is not yet done.
(altered the analyzer to be able to open it with a
predefined initial period).

The "create rule" skill featured in the HABot app with
its dedicated card is not supported.

Refactor OH access layer, add speech interface
Only a browser-based implementation
of speech recognition with
window.webkitSpeechRecognition is
implemented for now, the API is subject
to change.

Dynamic settings menu & sidebar depending on the available endpoints

Reload endpoints after an addon install/uninstall to refresh the UI
(this will allow e.g. service configuration menus and the HABot input box to
appear or disappear without reloading the page)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-15 22:18:42 +02:00
Yannick Schaus 19178a1386
Standard list item widgets; default widget logic for list display (#270)
Add list items widgets:

- oh-label-item
- oh-toggle-item
- oh-slider-item
- oh-rollershutter-item
- oh-player-item
- oh-stepper-item
- oh-colorpicker-item

Most config options are forwarded to the system
widget displayed on the "after" slot, which may also be
defined in the widgets' definitions.

Move default standalone widget logic to dedicated JS file.

Default list widget logic.

Change the label of the standard library's card widgets.

Add standard list widgets to listWidget metadata editor
picker; add preview sheet.

Misc fixes in global app styles, analyzer.

Let the user choose the list item widget to add in an oh-list.

"Add from Model..." option in new widget action sheets.
Add a model treeview popup to add default widgets (standalone or list)
easily to a layout (block column or masonry) or a list, simply by
browsing the semantic model and picking items.

Other renames and file structure reorganizations.

Add a new action to show group members in a popup, using their
default list representation. Make it the default action for Group items,
for both standalone and list widgets.

Make semantic cards on the home page functional:
Use the default list widgets to render items in the card.
(order not considered for now, but visible and visibleTo
configured in the listWidget metadata might work to filter
out items based on an expression/the current user's roles?)
Remove warning messages.
Make cards (and headers) a little bit thinner.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-10 22:56:31 +02:00
Yannick Schaus b0bdefe5b5
Misc style fixes (#265)
Better filled bars defaults

Add per-device option to set the home page background
to the standard color (i.e. gray in light mode, no effect
in dark mode)

Consider safe area (fullscreen iOS) for map, plans, charts

Convert CSS remains to stylus, cleanups, fixes

Add page transition effect option for navigation
widget actions
(https://framework7.io/docs/view.html#custom-page-transitions)

Restyle theme/dark mode pickers

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-27 11:54:59 +02:00
Dan Cunningham e2da5cc16e
Auto selects the color default color scheme based on the system preference (#263)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-05-25 22:15:54 +02:00
Yannick Schaus 344fd6cd03
Conditional visibility fixes for widgets (#256)
- Move visible computed property to widget-mixin
- Fix bug when visible is undefined but visibleTo is not
- Add conditional visibility evaluation for layout widgets (block, row, col)
- Move sidebar account controls to fixed slot (Hopefully prevents some glitches in iOS Safari.)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:59:21 +02:00
Yannick Schaus f50d480560
Add HomeKit metadata editor (#261)
Link to relevant docs on the supported third-party integrations using metadata

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:58:41 +02:00
Yannick Schaus 90ff071a72
REST docs: use the redirect URI as client ID (#257)
Depends on https://github.com/openhab/openhab-core/pull/1496

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:58:09 +02:00
Wouter Born 3513dadeb1
Fix ConfigurableService deprecations (#262)
Related to: openhab/openhab-core#1491

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-24 00:55:38 +02:00
Wouter Born 4d6a11ffcb
Add more null annotatons (#260)
Adds null annotations to:

* Default UI
* Basic UI
* HomeBuilder
* REST Docs
* Tiles

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-23 11:20:02 +02:00
Wouter Born 764925b0d3
Use constructor injection and update null annotations (#258)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-22 08:30:16 +02:00
Yannick Schaus 551fd92f46
Move the login hint in the sidebar (#255)
* Move the login hint in the sidebar

Displayed only when there are no pages - if there are, it means the admin
user already found the button.
Closes #254.

Change some label texts & empty overview icon.

Make the whole logo area clickable.

Display an indicator when there are no pages to display on the sidebar.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-18 16:42:35 +02:00
lolodomo 32ca168e7f [basicui] Fix for selection widget when no mapping (#253)
Relative to #247

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-05-17 21:52:43 +02:00
Yannick Schaus cae84cf2c1
Refactor page editors, conditional visibility (#248)
Move duplicated code in page editors and modals
to mixins.

Move the general page settings form to a common
component.

This also introduces two new common config parameters:

- `visibleTo` allows to restrict the visibility of
  pages or widgets to certain users or roles. It
  accepts an array with strings like:
  `["user:user1", "role:administrator"]`
  Multiple entries are "OR"ed - the component will be
  displayed if any matches.
  If the parameter is not present, the component
  is visible by default (even to unauthenticated users).
  This parameter is available to widgets which accept
  expressions in their configuration (typically in
  layout pages).

- `visible` allows to restrict the visibility of
  a widget based on the result of the evaluation of an
  expression. For example:
  `visible: "=items.Item1.state == 'ON'"`
  This allows to build dynamic pages e.g. by setting
  this property on blocks, grid rows or columns, or
  individual widgets which will appear or disappear
  typically based on the state of an item.
  This property is not evaluated for top-level pages or
  widgets that don't support expressions (charts etc.).

Note that these only restrict the visibility and are not
to be considered as security measures.

Allow to specify `visibleTo` as a general page setting.

Contact-style pages list, allow to group by type

Add visibleTo indication and sidebar order badges

Add pages counter to settings menu

Remove highlight on segmented button controls
(rollershutter, player controls)

Minor lists layout fixes

Move widget config & code editors to components

Restore config sheets on plan & chart page editors

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:51:30 +02:00
Yannick Schaus 66d73e32c4
Better support for non-editable rules (#243)
Depends on https://github.com/openhab/openhab-core/pull/1451.

Change the rules list to a "contacts" list with initials in
headers and a list index.
Add a lock icon to denote rules which cannot be edited with the
rule editor.

Strip all editing features in the rule editor when the rule is
not editable.

Move the module title/description suggestions to a mixin and add
the new group member triggers.

Fix bug, look & feel in tag editor.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:50:12 +02:00
Yannick Schaus 3527aaba86
Fix router issues when page animations are disabled (#252)
- Fix router issues when page animations are disabled
- Change some texts and fix some issues on the about page.
- Remove debug leftover

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:49:07 +02:00
Wouter Born 46962a874a
Add null annotations to REST resources (#249)
- Remove unused language headers from HABotResource
- Remove redundant this references in HABotResource

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-17 17:47:48 +02:00
Wouter Born aa05fab9d2
Migrate to JAX-RS Whiteboard (#242)
* Update REST Docs feature dependency
* Annotate habot for whiteboard
* Fix default UI classpath, fix null context ID warning
* Annotate cometvisu for whiteboard

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-15 14:03:44 +02:00
Yannick Schaus e624727564
Rewrite the Analyzer tool using oh-chart-page (#234)
Leverage the chart component used in pages to
provide an interactive persistence analysis
for arbitrary items, including Numbers, Switches,
Contacts and others (and eventually save the
resulting chart as a page).

WIP: better tooltips (to complete in subsequent PRs
for other types of series).

Add trend lines to default quantifiable numbers cards.

Fix state trackers not properly closed:
The number of state tracker connections would increase when returning to
the thing details page from a link details page.
Also make sure there's only 1 state tracker SSE connection at a given
time - close them before opening a new one.
Decrease the level of most log messages to debug.

Add no-gap to oh-grid-row

Upgrade Framework7 to 5.7.2.

Remove old analyzer components

Add analyze to widget actions

Fix item parameter in multiple mode

No state preview for items being created in model

Better mobile flow when creating new items in tree view pages

Add analyze button for Dimmers

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-12 19:51:36 +02:00
Wouter Born 937cf2456c
Infra improvements (#240)
* Update to SAT 0.10.0
* Add sortpom-maven-plugin configuration
* Sort POMs
* Add spotless-maven-plugin configuration
* Apply Spotless changes

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-08 21:33:24 +02:00
Tobias Bräutigam 5f72e38409
[cometvisu] adding rest api for cometvisu manager (#231)
Signed-off-by: Tobias Bräutigam <tbraeutigam@gmail.com>
2020-05-08 20:39:16 +02:00
Yannick Schaus 6d12fe94fe
Display layout page as overview (#235)
Move the UI tiles back to the right panel, and display
a placeholder in the home page's overview tab until a
layout page with an ID of "overview" has been created.
This is (normally?) temporary until a specially-designed
overview page has been implemented - discussion on
https://github.com/openhab/openhab-webui/issues/155).

Various styling fixes & clean up.

Move the onboarding cards to separate component
(not used for now).

Don't display the Back button in a page view if it's shown
on the sidebar.

Layout pages: switch the "add widget" action sheet from
grid to simple list with groups, headers and cancel button.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-27 09:16:55 +02:00
Yannick Schaus 8a41670ca4
nearley items parser: avoid recognizing item types in names (#237)
Fixes #233.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-27 09:08:09 +02:00
Yannick Schaus 82f2934f4d
Some improvements to rule editing, misc fixes (#232)
Remove the ability to close script editors with the ESC key

Save the code being edited when saving the rule (for instance
with Ctrl-S/Cmd-S)

Add Ctrl-R/Cmd-R keyboard shortcut to run the rule

Fix player controls & add oh-player-card as default for Player items
Don't display the title/track part of the player card until items
are set; otherwise only display the playback controls

Add the ability (unstable/not documented for now) to use standard
widgets in modals

Fix modal config not being considered in popover

Fix default slider control min/max bounds using stateDescription

auth: check the token validity when the app becomes visible again
and renew it if necessary

Remove test card widget

Fix rule module reordering

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-19 23:12:53 +02:00
Dan Cunningham aefda74919
avoid rendering markers on every view change (#228)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-04-19 20:56:13 +02:00
Yannick Schaus d5ad2bd5c1
Color picker control (#229)
Make toggle controls compatible with Color items/HSB values

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-19 00:47:06 +02:00
Yannick Schaus 6e003b410c
Items: metadata & group management, improve default rendering (#226)
Add the ability to edit metadata from the items details page
and the semantic model page:

- Provide interactive forms for the alexa, ga, synonyms, widget,
  listwidget, stateDescription, commandDescription namespaces
- Fallback to YAML view for other namespaces (or in a tab for
  supported namespaces as an alternative).

Add "options" widget action to open an action sheet with a list
of command options.

Add default representation for items: look in the widget for
a preconfigured widget (custom or from the standard library),
or try to build a default live representation of the item's state
(WIP), considering its type, state/command descriptions and
other properties.

Change the "current state" part of the items details & link edit
pages with the default representation.

Add a convenient way to add or remove members to/from a group item.

Real-time state display to model and thing details pages

Add rollershutter system control and card to standard library

Add default state representation and metadata editing to
the items details pane in the model page

Misc fixes, improve mobile-friendliness of model page

Harmonize actions below cards, fix homepage hamburger menu

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-18 19:18:02 +02:00