From 6d12fe94fe2756b8966a908ace38d69b5dd85347 Mon Sep 17 00:00:00 2001 From: Yannick Schaus Date: Mon, 27 Apr 2020 09:16:55 +0200 Subject: [PATCH] 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 --- .../web/src/assets/i18n/en/empty-states.json | 3 + .../org.openhab.ui/web/src/components/app.vue | 25 ++- .../onboarding/onboarding-cards.vue | 64 ++++++ .../widgets/layout/oh-placeholder-widget.vue | 1 + bundles/org.openhab.ui/web/src/pages/home.vue | 204 +++++++++--------- .../web/src/pages/home/overview-tab.vue | 152 ++++++------- .../web/src/pages/page/page-view.vue | 7 +- .../settings/pages/layout/layout-edit.vue | 17 +- 8 files changed, 263 insertions(+), 210 deletions(-) create mode 100644 bundles/org.openhab.ui/web/src/components/onboarding/onboarding-cards.vue diff --git a/bundles/org.openhab.ui/web/src/assets/i18n/en/empty-states.json b/bundles/org.openhab.ui/web/src/assets/i18n/en/empty-states.json index a833d0bce..66f7b43c6 100644 --- a/bundles/org.openhab.ui/web/src/assets/i18n/en/empty-states.json +++ b/bundles/org.openhab.ui/web/src/assets/i18n/en/empty-states.json @@ -1,4 +1,7 @@ { + "overview.title": "Welcome to openHAB!", + "overview.text": "Once your system is configured, create a layout page with the ID \"overview\" to display it here.", + "inbox.title": "The Inbox is empty", "inbox.text": "Discovery results from your bindings that can be added as things will appear here.

You can also start a scan for a certain binding or add things manually with the button below.", diff --git a/bundles/org.openhab.ui/web/src/components/app.vue b/bundles/org.openhab.ui/web/src/components/app.vue index d82aed64f..975ff26de 100644 --- a/bundles/org.openhab.ui/web/src/components/app.vue +++ b/bundles/org.openhab.ui/web/src/components/app.vue @@ -10,7 +10,6 @@ - - + @@ -108,7 +101,7 @@ - + @@ -155,13 +148,12 @@ height 0 .panel-left - overflow-y scroll scrollbar-width none /* Firefox */ -ms-overflow-style none /* IE 10+ */ .page background #f5f5f5 !important - padding-bottom 4rem + padding-bottom calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom)) .logo margin-top var(--f7-safe-area-top) list-style none @@ -178,11 +170,18 @@ color var(--f7-color-white) !important .account z-index 300 - height 4rem + height calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom)) background #f5f5f5 !important position fixed bottom calc(var(--f7-safe-area-bottom)) width 100% + .list + position absolute + bottom 0 + left 0 + width 100% + margin-bottom 0 + height calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom)) .theme-dark .panel-left diff --git a/bundles/org.openhab.ui/web/src/components/onboarding/onboarding-cards.vue b/bundles/org.openhab.ui/web/src/components/onboarding/onboarding-cards.vue new file mode 100644 index 000000000..9bcbc9ac8 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/onboarding/onboarding-cards.vue @@ -0,0 +1,64 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-placeholder-widget.vue b/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-placeholder-widget.vue index f394409b9..6cba96653 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-placeholder-widget.vue +++ b/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-placeholder-widget.vue @@ -12,6 +12,7 @@ display inline-block opacity 0.5 height calc(2*3rem + 50px) + z-index 100 .button width calc(100% - var(--f7-typography-margin)) padding 3rem 0 diff --git a/bundles/org.openhab.ui/web/src/pages/home.vue b/bundles/org.openhab.ui/web/src/pages/home.vue index 50b7135d7..1280b4ee3 100644 --- a/bundles/org.openhab.ui/web/src/pages/home.vue +++ b/bundles/org.openhab.ui/web/src/pages/home.vue @@ -1,6 +1,6 @@