Commit Graph

1414 Commits (14adafb810c41a3c10d9847952ec9724e399355d)

Author SHA1 Message Date
Yannick Schaus f06ddeda63
Model cards: consider the more specialized equipment class (#578)
Fix #567.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-30 12:23:10 +01:00
Yannick Schaus ab3ba9e715
Fix #576 - apply default tags from channel or channel type (#577)
Still apply "Point" if none of the default tags is a Point.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-30 12:22:55 +01:00
Wouter Born 43b7f52798
Update LastNPE EEAs to 2.2.1 (#517)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-30 12:21:30 +01:00
Yannick Schaus 6a61115429
Fix multiple issues (#566)
Fix #563 - wrong expression completion objects + improve item name completion
Fix #559 - bug with model display when items don't have any metadata (non-semantic)
Fix #553 - delete parameters when unset in config sheet unless in special circumstances
Fix #549 - detect identical channel/channel type labels and adjust item name suggestions accordingly
Fix #543 - proritize channel description to channel type description in channel list
Fix #524 - add Call item type
Fix #490 - Add anyFormat=true to fetch icons - should fix #490
Fix #438 - Rename remaining instances of "equipments" in code
Fix problem with cell "on" parameter - reported in: https://community.openhab.org/t/wiki-building-pages-in-the-oh3-ui-documentation-draft-2-3/104392/92

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-28 22:19:27 +01:00
Kai Kreuzer d5e3b38a53
Remove Travis as a build system (#552)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-28 22:10:35 +01:00
Yannick Schaus 36924525ad
Introduce Mobile App interface (#565)
This introduces a few functions allowing apps embedding the web UI
in a WebView to interact with them and adjust part of its rendering.

More precisely, the UI will look for an `OHApp` object
(defined in `window`, for instance with `addJavascriptInterface`
for Android apps):
https://developer.android.com/guide/webapps/webview#BindingJavaScript

The `OHApp` object can define the following functions:

- `string preferTheme()`: if present, will be called during the
  initialization of the app, will force the theme - unless the user
  has made a choice on the About page. These values are allowed:
  `auto`, `ios`, `md` (Material Design/Android), `aurora` (desktop);
- `string preferDarkMode()`: if present, will be called during the
  initialization of the app, will force the color scheme - unless the
  user has made a choice on the About page. These values are
  allowed: `auto`, `light`, `dark`;
- `void pinToHome()`: if present, this will show an icon on the home
  page which will call this function when tapped;
- `void exitToApp()`: if present, this will show an icon on the home
  page which will call this function when tapped. It **replaces** the
  "Other Apps" icon showing the right-side panel.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-28 22:07:09 +01:00
Yannick Schaus a8fd16f8c9
Home page model cards rewrite (#562)
Refactored the experimental-grade code with some mixins,
better separated code.

Implements #555:
Allow the home page cards to be customized - reordered, grouped,
and edited, with config & slots and a dedicated editor.

Implements #556:
Add glance badges to the location cards (other types tbd.)
See #556 for the specifications on how to organize your model
to get the badges.

Styling fixes and cleanups.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-28 19:44:09 +01:00
lolodomo 69eede2135
[MainUI] Ontology update (#537)
Must follow the merge of openhab/openhab-core#1814

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-11-26 16:58:08 +01:00
Kai Kreuzer 0ebb8a4586
Removed HomeBuilder from the repo (#507)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-23 20:33:41 +01:00
lolodomo e26cbf4334
[basicui] Fix handling of options without label (#550)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-11-23 19:30:54 +01:00
Yannick Schaus e7a763b700
Add widgetOrder metadata, fixes (#544)
Add a new widgetOrder metadata namespace editor to configure a
*default* index-based widget order. (The cards on the home page
will also feature another, more visual way to influence the order
when they'll be rewritten.)

Expose visible/visibleTo on default widget metadata configuration
pages.
Known bug: counters on home page cards are not accurate when some
items are hidden with visible/visibleTo.

Add a mixin to sort items; use it on cards, model treeview, group
popup, add from model in layout pages.

Close #489.

Fix #533 - wrong call to render properties in location cards.

Fix #498 - make cards routable (has glitches).
(but will be superseded with the cards rewrite).

Fix #542 - allow to unset the options set by the default widget
routines. Fix action name ("analyze" -> "analyzer").

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-20 23:36:39 +01:00
Yannick Schaus c3b7f47569
Item metadata: add expire editor, change default widget logic (#540)
Disallow standalone widgets to be selected for list items (close #536).

Allow slight alterations to the default widgets suggested by the system
without reconfiguring it completely: if the metadata value is blank,
assume the default system-suggested widget is to be used and merge the
config found in the metadata.
Closes #534 (since now only the iconUseState option has to be set to
enable dynamic icons for Number items and similar).

Change the metadata namespace selection menu to only display the metadata
which is set in the metadata menu, and use an action sheet to add more.
This also paves the way for user-defined namespaces.

Move the metadata order out of the item edition card in the Model page,
into its own section.

Add metadata editor for the expire namespace
(https://github.com/openhab/openhab-core/issues/1620).

Reorder the sections of the item details page in a more logical manner
(semantic classification below the tags that define it).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-19 21:02:06 +01:00
Yannick Schaus cd66d064a7
[skip ci] More orga spelling fixes & adjustments (#531)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-18 01:33:49 +01:00
Yannick Schaus dae0086a0b
[skip ci] [orga] Further improvements to the issue templates & README (#530)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 22:59:35 +01:00
Yannick Schaus 668bb82734
[skip ci] [orga] Fix spelling errors in issue menu
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 17:29:59 +01:00
Yannick Schaus 338e819196
[skip ci] [orga] Adjustments in README & templates (#528)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 17:26:57 +01:00
Yannick Schaus ce79d887f5
[Orga] Add README, move directives & template issues (#527)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 17:17:13 +01:00
Yannick Schaus cb02d57473
Fix multiple text parameter dereferencing (#526)
Fix #525.

Also should fix https://community.openhab.org/t/chatid-field-is-not-visible-in-the-telegram-bot-thing/108207.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 15:19:30 +01:00
Yannick Schaus 65808f4a76
Improve bulk operations, consistent delete UX (#522)
- Add bulk operations to the things list, allowing to remove,
disable or enable things
- Add bulk operations to the rules/scripts lists, ability to disable
or enable rules & scripts
- Add ability to delete a rule, script or item from its details
page
- Add ability to start checking objects for a bulk operation
("select mode") with Ctrl+click on desktops. Ctrl+click exits the
select mode automatically when the last checked object is deselected.

Closes #512.
Closes #506.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 11:45:25 +01:00
Yannick Schaus e0b96630f2
Fix several issues (#521)
Fix #520 - don't evaluate null values, move labels to computed properties
Fix #515 - don't overwrite labels, icons in default representations if set in config
Fix #514 - don't inherit layout page no-gap to rows/cols
Fix #513 - fix icon properties in oh-link, oh-button
Close #508 - display error if incorrect format for rules/scripts UIDs (no hard check)
Fix #505 - incorrect bottom margin in layout editor on Firefox
Close #500 - display current value in oh-slider-item
Close #488 - default to analyze action for dimensionless Number items in some circumstances
Fix #487 - dynamic icons for default list items (only certain item types)
Allow oh-button & oh-link contents to be customized w/ default slot
Allow oh-icon to receive dynamic updates
Fix wrong API Explorer icon in sidebar

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-17 09:53:19 +01:00
Yannick Schaus d445d9b7d0
Developer Sidebar (#437)
Allow administrators to open a sidebar with productivity tools that doesn't
get away when navigating around.

The developer sidebar is available from the developer tools menu
or anywhere with the Shift+Alt+D keyboard shortcut, if these two
conditions are met:

1. the user has an administrator role;
2. the width of the screen is >= 1280px.

Fix list index not updating correctly in rules/scripts lists
Fix links sometimes not appearing in item details

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-13 10:45:42 +01:00
Wouter Born 3b31d23976
[infrastructure] add external null-annotations (#470)
Add EEAs and fix null analysis errors.

Related to:

* openhab/openhab-core#888
* openhab/openhab-core#1775
* openhab/openhab-addons#8848

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-04 15:23:34 +01:00
Yannick Schaus 5963900848
Allow viewing non-editable scripts (#494)
Fixes #486.

Blockly: add oh_log block, change oh_sendcommand
to oh_event and allow to post updates.

Read-only script editor with lock icon & tooltip
if the script not editable (text-provisioned or Blockly).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-02 12:29:34 +01:00
Yannick Schaus e2a4d2bb3a
Don't show Blockly FABs when creating script (#485)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-02 01:47:49 +01:00
Yannick Schaus deeb03020d
Make Blockly button more prominent (#484)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-02 01:43:32 +01:00
Yannick Schaus 81f858cb49
Blockly editor for scripts (experimental) (#482)
Allow to create new ECMAScript-based scripts with a
Blockly editor.
The undocumented "blockSource" configuration parameter
is added to the script action module and will trigger
the display of the Blockly editor instead of the code
editor if present.

3 openHAB-related blocks have been added to the standard
toolbox: get item state, send command, print. More will be
added later.

Allow to switch a application/javascript script to Blockly
if it is empty - or back to raw code editing if the
Javascript generated by Blockly is empty.

Switch between code preview (read-only) & Blockly
with a FAB button, or Ctrl-B on the keyboard.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 23:02:37 +01:00
Yannick Schaus f748a1f3bf
Location card: fix when there are properties but no equipment (#483)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 22:52:03 +01:00
Yannick Schaus 8bfb503f5b
Cosmetics (#481)
Change equipment icon (to be different than the one for things)
Change layouts of item stats in semantic cards
Fix Equipment tab view title
Change labels during script creation, generate UID

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 16:05:04 +01:00
Yannick Schaus d04620c407
Fix semantic home page cards with generic equipment (#479)
Fix bug with cards in the home page's Locations tab
not appearing when there were non-specialized
equipment.

Add a card for non-specialized equipment in the
Equipment tab.

Rename "Equipments" to Equipment, where shown to
the user (#438) - followup PR to do for the references
in the code.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 12:04:31 +01:00
Yannick Schaus d510c167d4
Allow variables in overview page (#478)
The variables map was not initialized in the overview
page's context, so attempting to set variables in it
resulted in an error.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 12:04:15 +01:00
Yannick Schaus d1019fb4a3
Don't focus searchbars if no filter when switching tabs (#477)
When switching tabs in channels, things, inbox, pages
list, the searchbar.clear() function refocuses the
searchbar which brings up a virtual keyboard on mobile
and/or a backdrop or iOS. Since there's apparently no
way to prevent this behavior, do it only when there's
a value for the searchbar's filter.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 12:03:59 +01:00
Yannick Schaus 39f83915c5
Fix rule code mode (#476)
Regression caused by #469.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-01 12:03:43 +01:00
Yannick Schaus 81791a14ee
Script-only rules, improve scripting UX (#469)
This adds "Scripts" as a top-level object. Scripts are regular
rules, tagged "Script", without triggers or conditions and
having only a single action module with the id "script".

The main settings menu has been modified to group "Rules",
"Scripts" and "Schedule" under a new "Automation" group.
"Configuration & Automation" has been renamed to "Configuration".

Scripts can be added and edited in a dedicated, full-screen
list and editor saving the hassle of having to configure
modules manually.

The new script editor is also used on the "shortcut" button of
regular rules' script actions & conditions. During script
editing, several keyboard shortcuts are available:

- Ctrl-D disables or enable the rule;
- Ctrl-R runs the rule - but saves it first;
- Ctrl-S saves the rule.

The script editor now has support for C-like languages (the
DSL language is automatically mapped to text/x-java) and
Groovy.

When editing ECMAScript, a special Tern plugin will offer
item names for completion when the cursor is in these
positions (repesented by `|`):

- `ir.getItem("|")`
- `itemRegistry.getItem("|")`
- `events.postUpdate("|")`
- `events.sendCommand("|")`

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-31 12:56:19 +01:00
Yannick Schaus dcf0a6301c
Various fixes (#473)
- fix #472 - icons in cells
- fix #471 - tabbed pages broken as a result of #452
- fix #468 - display multiple text parameters without options as textarea
- fix #464 - allow dashes in thing UIDs
- fix #463 - reapply filter when changing grouping mode in thing, inbox, pages lists
- fix #462 - wrong link when editing custom metadata from model page
- fix #459 - disable min/max checks for number parameter when there are options present
- fix #421 - remove diacritics instead of stripping accented characters in suggested new item names
- fix #413 - prevent linking to a non-editable item, unlinking from non-editable items
- fix #382 - (No profile) option not selected when editing link

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-31 12:48:27 +01:00
Yannick Schaus ffb283abb2
Thing list status (#466)
Only update thing statusInfo fields which change when
receiving a status update through SSE in the thing list.
Could help with #439.

Show tooltip with the status description when howering
over the status badge.
Closes #414.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-29 14:35:22 +01:00
Yannick Schaus a6a98c82c4
Don't validate option config parameters (#465)
Config parameters with options don't have to be validated;
they normally are always valid - no empty option is
presented when a value is required etc.

The introduction of validation in #431 broke the control
when options are presented "inline".
See https://github.com/openhab/openhab-core/issues/1763

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-29 01:23:35 +01:00
Wouter Born 8f7492a743
Add .gitattributes (#458)
Without this configuration there are Spotless issues with line endings on Windows.

See: openhab/openhab-addons#8712

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-27 07:57:38 +01:00
Yannick Schaus cfa2824690
Fixes for oh-stepper & oh-input (#457)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 19:50:51 +01:00
Yannick Schaus c561acc157
Close #398 - Add thing: don't scan automatically, abort scan (#456)
Mandating the user to start the scan manually and allowing
them to stop helps keeping the list static, so that the
"add manually" section can be used reliably.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 15:29:45 +01:00
Yannick Schaus f38ad90a59
Change password link & API token management on profile page (#455)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 15:29:32 +01:00
Yannick Schaus d223746d63
Fix #384 - allow deleting a thing w/HANDLER_MISSING status (#454)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 15:29:14 +01:00
Yannick Schaus 752de03d73
Add binding configuration link to "choose binding" page (#453)
This is the only page where all bindings are shown, including
those not sideloaded and not coming from features/the distro.

Closes #386.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 15:28:52 +01:00
Yannick Schaus 8c528910e9
Close #408 - Allow customizing styles of pages & popups (#452)
Expose the config of the root page component in page designer
code views.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 15:28:35 +01:00
Yannick Schaus d58606d623
Fix #431 - validate rule modules config parameters (#451)
Allow config parameter controls based on smart select pickers
to display a validation message.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:23:37 +01:00
Yannick Schaus 179b41af83
Fix #428 - re-apply searchbar query when switching link filters in channel list (#450)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:23:22 +01:00
Yannick Schaus 2b51a28fa2
Fix #402 - map initialization (#449)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:23:09 +01:00
Yannick Schaus f09a70cee7
Close #403 - label-card, list items: new parameter iconUseState for dynamic icons (#448)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:22:54 +01:00
Yannick Schaus 9218f0fa4c
Fix #410 - allow number with dimensions as group item type (#447)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:22:38 +01:00
Yannick Schaus 4dc6d5f6c5
Close #417 - dynamic images with url parameter (#446)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:22:22 +01:00
Yannick Schaus ef57953a37
Fix #423 - case insensitive add-on search in setup wizard (#445)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-26 11:22:10 +01:00