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

Redesign settings page & Add doc links #1997

Merged
merged 16 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions bundles/org.openhab.ui/web/src/assets/addon-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,6 @@ export const Formats = {
'karaf': 'Karaf'
}

export const AddonStoreTabShortcuts = [
{
id: 'bindings',
label: 'Bindings',
icon: 'circle_grid_hex',
subtitle: 'Connect and control hardware and online services'
},
{
id: 'automation',
label: 'Automation',
icon: 'sparkles',
subtitle: 'Scripting languages, templates and module types'
},
{
id: 'ui',
label: 'User Interfaces',
icon: 'play_rectangle',
subtitle: 'Community widgets & alternative frontends'
},
{
id: 'other',
label: 'Other Add-ons',
icon: 'ellipsis',
subtitle: 'System integrations, persistence, voice & more'
}
]

export function compareAddons (a1, a2) {
if (a1.installed && !a2.installed) return -1
if (a2.installed && !a1.installed) return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"sidebar.noPages": "No pages",
"sidebar.administration": "Administration",
"sidebar.settings": "Settings",
"sidebar.addOnStore": "Add-on Store",
"sidebar.developerTools": "Developer Tools",
"sidebar.helpAbout": "Help & About",
"sidebar.unlockAdmin": "Unlock Administration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"things.nobindings.title": "No bindings",
"things.nobindings.text": "To add things to your system, you first need to install binding add-ons.",

"transformations.title": "No transformations yet",
"transformations.text": "Transformations are used to translate data from a cluttered or technical raw value to a processed human-readable representation.",

"model.title": "Start modelling your home",
"model.text": "Build a model from your items to organize them and relate them to each other semantically.<br><br>Begin with a hierarchy of locations: buildings, outside areas, floors and rooms, as needed. Then, insert equipment and points from your things (or manually).",

Expand Down
9 changes: 7 additions & 2 deletions bundles/org.openhab.ui/web/src/components/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<f7-block-title v-if="$store.getters.isAdmin" v-t="'sidebar.administration'" />
<f7-list class="admin-links" v-if="$store.getters.isAdmin">
<f7-list-item link="/settings/" :title="$t('sidebar.settings')" view=".view-main" panel-close :animate="false"
:class="{ currentsection: currentUrl === '/settings/' || currentUrl.indexOf('/settings/addons/') >= 0 || currentUrl.indexOf('/settings/services/') >= 0 }">
:class="{ currentsection: currentUrl === '/settings/' || currentUrl.indexOf('/settings/services/') >= 0 }">
<f7-icon slot="media" ios="f7:gear_alt_fill" aurora="f7:gear_alt_fill" md="material:settings" color="gray" />
</f7-list-item>
<li v-if="showSettingsSubmenu">
Expand Down Expand Up @@ -73,6 +73,11 @@
</ul>
</li>

<f7-list-item link="/settings/addons/" :title="$t('sidebar.addOnStore')" panel-close :animate="false"
:class="{ currentsection: currentUrl.indexOf('/settings/addons/') >= 0 }">
<f7-icon slot="media" ios="f7:bag" aurora="f7:bag" md="material:shopping_bag" color="gray" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor detail I just noticed too late (it wouldn't have been blocking): in that left side menu the top-level entries' icons (Settings, Developer Tools, About) are "filled" and the sub-levels are "hollow", so in this case the icon should have been e.g. f7:bag_fill instead of f7:bag; again just a minor design quirk but it contributes to the consistency 😎

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that it should be changed for visual consistency, so here it is: #2053.

</f7-list-item>

<f7-list-item link="/developer/" :title="$t('sidebar.developerTools')" panel-close :animate="false"
:class="{ currentsection: currentUrl.indexOf('/developer/') >= 0 && currentUrl.indexOf('/developer/widgets') < 0 &&
currentUrl.indexOf('/developer/blocks') < 0 && currentUrl.indexOf('/developer/api-explorer') < 0 }">
Expand Down Expand Up @@ -749,7 +754,7 @@ export default {

this.$f7.on('pageBeforeIn', (page) => {
if (page.route && page.route.url) {
this.showSettingsSubmenu = page.route.url.indexOf('/settings/') === 0
this.showSettingsSubmenu = page.route.url.indexOf('/settings/') === 0 && page.route.url.indexOf('addons') === -1
this.showDeveloperSubmenu = page.route.url.indexOf('/developer/') === 0
this.currentUrl = page.route.url
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/web/src/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import AnalyzerPopup from '../pages/analyzer/analyzer-popup.vue'
const AboutPage = () => import(/* webpackChunkName: "about-page" */ '../pages/about.vue')
const UserProfilePage = () => import(/* webpackChunkName: "profile-page" */ '../pages/profile.vue')

const SettingsMenuPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/settings-menu.vue')
const SettingsMenuPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/menu/settings-menu.vue')
const ServiceSettingsPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/services/service-settings.vue')
const AddonsListPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/addons/addons-list.vue')
const AddonsAddPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/addons/addons-add.vue')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
<f7-list class="searchbar-not-found">
<f7-list-item title="Nothing found" />
</f7-list>
<!-- skeleton for not ready -->

<f7-block class="block-narrow">
<!-- skeleton for not ready -->
<f7-col v-show="!ready">
<f7-block-title>&nbsp;Loading...</f7-block-title>
<f7-list media-list class="col wide">
Expand All @@ -50,9 +51,11 @@
</f7-list-group>
</f7-list>
</f7-col>
<f7-col v-show="ready">

<f7-col v-show="ready && items.length > 0">
<f7-block-title class="searchbar-hide-on-search">
{{ items.length }} Items
{{ items.length }} Items -
<f7-link external :href="documentationLink" target="_blank" text="Open documentation" color="blue" />
</f7-block-title>
<f7-list
v-show="items.length > 0"
Expand Down Expand Up @@ -88,9 +91,14 @@
</f7-list>
</f7-col>
</f7-block>

<f7-block v-if="ready && !items.length" class="service-config block-narrow">
<empty-state-placeholder icon="square_on_circle" title="items.title" text="items.text" />
<f7-row class="display-flex justify-content-center">
<f7-button large fill color="blue" external :href="documentationLink" target="_blank" v-t="'home.overview.button.documentation'" />
</f7-row>
</f7-block>

<f7-fab v-show="!showCheckboxes" position="center-bottom" text="Refresh" slot="fixed" color="blue" @click="load()">
<f7-icon ios="f7:arrow_clockwise" md="material:refresh" aurora="f7:arrow_clockwise" />
</f7-fab>
Expand Down Expand Up @@ -281,6 +289,9 @@ export default {
}
},
computed: {
documentationLink () {
return `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org/link/items`
},
searchPlaceholder () {
return window.innerWidth >= 1280 ? 'Search (for advanced search, use the developer sidebar (Shift+Alt+D))' : 'Search'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div>
<f7-block-title>
Add-on Settings
</f7-block-title>
<f7-list class="search-list">
<f7-list-item
v-for="a in addonsSettings"
:key="a.uid"
:link="'addons/' + a.uid + '/config'"
:title="a.label" />
<f7-list-button v-if="!expanded && addonsInstalled.length > addonsSettings.length" color="blue" @click="expanded = true">
Show All
</f7-list-button>
</f7-list>
</div>
</template>

<script>
export default {
props: ['addonsInstalled', 'addonsServices'],
data () {
return {
ready: false,
expanded: false
}
},
computed: {
addonsSettings () {
if (this.expanded) return this.addonsInstalled
return this.addonsInstalled.filter((a) =>
a.type === 'persistence' ||
this.addonsServices.findIndex((as) => as.configDescriptionURI.split(':')[1] === a.id) > -1
)
}
}
}
</script>
Loading