Commit Graph

734 Commits (e77e3f48d50ed79fa30df167b361e09da8ae7855)

Author SHA1 Message Date
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
Yannick Schaus 9130557a24
Set the dev server API proxy target with an env variable (#222)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-18 19:10:32 +02:00
Christoph Weitkamp a06c7666f4
[ui] Adapted list of dimensions (#223)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-18 19:10:06 +02:00
Yannick Schaus 909226e272
Fix various chart range boundaries problems (#221)
- Don't include the start time of the next period
- Don't include the first day of the next month in calendars
- Fix weekly aggregate series
- Fix rounding bug when abs(point) >= 1000 

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-15 19:07:15 +02:00
Christoph Weitkamp cb3a07b159
Use command options for rendering Switch and Selection elements (#217) (#220)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-14 22:40:06 +02:00
Yannick Schaus ca080036f3
Chart pages (#206)
Also-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-13 00:25:24 +02:00
Wouter Born 54d7297039
Add null annotations to SubscriptionProvider (#214)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-12 16:51:18 +02:00
Yannick Schaus 73f743ae12
Fix rule creation bug (#213)
Introduced by #207 (wrong path param name).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-07 08:47:28 +02:00
Dan Cunningham 99a29633ad
Allows markers to be visible at both min and max zoom levels. (#209)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-04-06 22:53:08 +02:00
Yannick Schaus b4df833899
Do not display empty channel group headers (#210)
Following discussion on https://github.com/openhab/openhab-core/issues/1402

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-04 21:38:22 +02:00
Dan Cunningham 723e55c162
Add zoom visibility property for floor plan markers (#208)
Additional zoom visibility property to markers to show/hide based on current zoom level.

Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-31 02:26:19 +02:00
Dan Cunningham e88b4ea95c
Adds ability to disable moving or zooming a floor plan. (#204)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-27 02:39:19 +01:00
Yannick Schaus 921ca198eb
Optimize webpack bundling (#207)
Split heavy dependencies away from the entrypoint
by using dynamic imports at critical places along with
some cleanup.

Also replace crypto-based `uuidv4()` by `f7.utils.id()`.

This reduces the main app.js by more than 25%
(from >2 MB to around 1.4 MB).

Add npm script to launch the Webpack bundle
analyzer (`npm run webpack-analyzer`) after a
production build.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-27 02:37:18 +01:00
Dan Cunningham 03d08e1df6
Add static path to proxy list to allow images and other assets through (#203)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-26 17:21:07 +01:00
Yannick Schaus f6a2feee49
OAuth2, hide administration pages until authorized (#200)
* Unlock administration pages after authorization
* Support PKCE (RFC 7636)

Depends on https://github.com/openhab/openhab-core/pull/1389.

Implements an OAuth2 authorization flow and token storage.
Hides the admin pages & links until the user is signed in
with an administrator role.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-25 16:41:35 +01:00
Yannick Schaus 6804a55780
Use latest node & npm versions (#202)
* Use latest node & npm versions
* Fix the Basic UI build
* Upgrade frontend-maven-plugin, node-sass (HomeBuilder)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-25 08:11:57 +01:00
Yannick Schaus 9ae7cdf3ef
Add floorplan pages (#199)
Fix location parameter map pickup
Fix attribution links on maps
Fix popover modals on map icons
Fix about page refresh/purge cache feature
Fix designers context menus cut off at bottom of page

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-06 22:40:09 +01:00
Yannick Schaus b9f2f3ddd3
New page types: tabs, maps; misc. fixes (#198)
Upgrade to Framework7 5.4.5
Add leaflet/vue2-leaflet dependencies

Widgets & pages:
- Add OhTabsPage, OhMapPage, OhTab,
  OhMapMarker, OhMapCircleMarker
- Add support for tabbed pages in modals
- Add theme, themeOptions, device, JSON
  to expression evaluation context

Page designers:
- Add rudimentary designers for tabs, map pages
  (to refactor)
- Import designer components dynamically
  (split into individual webpack chunks)
- Fix masonry menus z-index issues in editor (hopefully)

Config parameters:
- Add map picker for location contexts

Code editor:
- Add indent guides

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-05 18:59:42 +01:00
Yannick Schaus bcd161e774
Add some colors, improve navigation (#197)
- Add colored indicator for current section in sidebar
- Filled (colored) navbars by default in Aurora theme
- Fix filled navbar on iOS
- Prevent f7 swipe back on iOS since Safari does it natively
- Improve routes to avoid switching sections, fix navigation
- Close on escape key hit for most popups
- Back link when navigating to a page from another page
- Edit link in page view (ultimately only when authorized...)
- Button to purge cache/service workers in about page
- Deindent block of code with shift-tab in CodeMirror
- Tweak colors in settings menu
- Hide the non-functional sitemaps from the sidebar (for now)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-03 13:12:10 +01:00
Yannick Schaus 726fc91b34
Masonry CSS fix (#196)
For some reason this doesn't translate correctly in production mode

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-02 12:04:41 +01:00
Yannick Schaus fa6c724974
Improvements in layout pages & other areas (#195)
Widget infrastructure:
- Add Vuex & move state tracking to store
- Add actions mixin: navigate, open page/widget in modal,
  send command, toggle item, open URL...
- Add support for including custom widgets in components
  (pages and other widgets)

Config sheet & parameters:
- Add support for page/widget selection
- Add support for props configuration

Developer tools:
- Add menu
- Add widget editor

Code editor:
- Change CodeMirror theme in dark mode

Layout pages:
- Move context menus callbacks from events to context object
- Add Ctrl-R shortcut in design to toggle "run mode" (preview)
- Add ability to add custom widgets to layouts

Widgets:
- System library: add OhButton, OhLink, OhList, OhListItem,
  OhPlayerControls, OhStepper, OhSwiper, OhSwiperSlide
- Standard library: improve OhLabelCard, add OhListCard,
  OhPlayerCard, OhSliderCard, OhStepperCard, OhToggleCard

Misc:
- Allow Ctrl-S to save in rule editor, pages editors (sitemap,
  layout), widget editor in create mode
- Add labels for keyboard shortcuts (in desktop mode only)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-02 01:44:49 +01:00
Yannick Schaus 67122c5a1c
Infrastructure for widgets, layout pages (#194)
Mixins for widget components (expression parsing...)
& pages (state tracking with /rest/events/states)

Layout page designer with grid view & masonry + YAML
code editor.

Add layout pages to sidebar

A few basic widgets (to expand)

Widget sandbox in developer tools w/ YAML code view

Add YAML code view to rule editor

Don't save names and descriptions of rule module
if they match the suggestions

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-02-27 00:03:54 +01:00
Yannick Schaus d7ae6036af
New Pages section & sitemap editor (#192)
This adds a new Pages section as discussed in
https://github.com/openhab/openhab-webui/issues/155#issuecomment-586711180
with an editor for "managed" sitemaps stored
as UI components in the system:sitemap namespace.

A code view supporting the current sitemap DSL
is provided.

Sitemaps made with the UI don't support visibility
or color rules yet.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-02-23 21:28:18 +01:00
dependabot[bot] c332164944 Bump eslint in /bundles/org.openhab.ui.habpanel/web (#158)
Bumps [eslint](https://github.com/eslint/eslint) from 3.19.0 to 4.18.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v3.19.0...v4.18.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-09 15:16:06 +01:00
dependabot[bot] 15cf13e5bb
Bump axios from 0.17.1 to 0.18.1 in /bundles/org.openhab.ui.habot/web (#159)
Bumps [axios](https://github.com/axios/axios) from 0.17.1 to 0.18.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.18.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.17.1...v0.18.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-09 15:13:57 +01:00
Yannick Schaus 5223812bc1
Merge Inbox into the Things section (#190)
Move the Inbox concept, which is closely related to Things,
from the top-level to a level of indirection below the Things list.
Red badges and buttons are displayed to clearly highlight and
navigate to the Inbox when there is something in it.

Additionally, the number of inbox entries (auto-discovered things)
for a given binding is displayed in the "choose binding" page when
adding a thing.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-02-05 08:38:00 +01:00
Yannick Schaus ba7bc37051
Empty state placeholders (#188)
Add information on how to start when there's nothing
to display on a page - a common UX pattern which helps
users figure out what they need to do.
https://uxdesign.cc/writing-empty-states-3e0279f39066
https://material.io/design/communication/empty-states.html

Fix search in rules screens.
Adjust positions of lists across screens.
Detect when the rules engine is not installed and display
a message accordingly.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-31 12:42:11 +01:00
Yannick Schaus 2e2356922a Fix add-on sheet step toggle links
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-30 10:49:55 +01:00
Yannick Schaus 2207b95217 Fix add-ons searchbar
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-30 10:49:55 +01:00
Yannick Schaus 7e165560b2 Add-on sheet details improvements
Clean up old add-on popup leftover.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-30 10:49:55 +01:00
Yannick Schaus 49c55b68ca Add binding configuration page & link
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-30 10:49:55 +01:00
Yannick Schaus 0ab0a0b691 Improve thing addition and add-ons management
Shortcut to install new bindings when adding a thing
Inbox listens to SSE and refreshes automatically
Refresh constantly the discovery results when scanning
Fix search in manual thing type selection
Improve look & feel of add-on screens and sheet

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-30 10:49:55 +01:00
Yannick Schaus 2a03c40f9e
Try to fix routing bug after thing creation (#186)
After adding things after a series of pages, f7's router will sometimes
act up and display a backdrop on the main view and then freeze the UI,
only a page refresh would get it working back again.

These changes seem to help at least in these cases.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-29 10:57:48 +01:00
Yannick Schaus aa75037d9a Improve channel list logic (#185)
Fix a flaw in the channel list rendering
where a dynamically provided channel was
not appearing unless its type was extensible.
It was previously assumed that all
non-extensible channel types would appear
in the thing type's "channelGroups" or
"channels" property.

Some bindings have ChannelTypeProviders
which will define thing-specific channels
along with channel types which don't
appear on the thing type object. Example:
the "input" channel of the yamahareceiver
binding's zone thing.

The channel-list component now has a
mandatory "channelTypes" prop which must
be provided by the parent component. This
prop should contain an array of channel types
that can appear for the thing. It should be
retrieved using the /rest/channel-types API
call, eventually using the "prefixes" filter;
providing channel types prefixed by "system"
or the binding id should be enough.

This PR thus depends on:
https://github.com/openhab/openhab-core/pull/1340).
More filters were also added to relevant places.

In the "add equipment/points from thing"
screens, the prefix of the name suggestions
for the Point items will now be the name of the
parent Equipment if available (instead of the
normalized thing's label).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-27 18:21:36 +01:00
Yannick Schaus 257c1a0c39 Minor cosmetic changes to the model builder (#183)
Actions are displayed as list buttons instead of FAB on large screens
Clear the selection in the tree by clicking in the blank area
Other minor fixes

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-25 20:54:46 +01:00