From c3b7f47569089723b7e6de938c2dde8dd81183ca Mon Sep 17 00:00:00 2001 From: Yannick Schaus Date: Thu, 19 Nov 2020 21:02:06 +0100 Subject: [PATCH] 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 --- .../assets/definitions/metadata/namespaces.js | 1 + .../item/metadata/item-metadata-expire.vue | 166 ++++++++++++++++++ .../item/metadata/item-metadata-menu.vue | 51 +++++- .../item/metadata/item-metadata-widget.vue | 101 +++++++---- .../web/src/components/model/details-pane.vue | 4 + .../web/src/components/model/item-details.vue | 7 - .../standard/cell/default-cell-item.js | 14 +- .../widgets/standard/cell/oh-label-cell.vue | 2 +- .../standard/default-standalone-item.js | 14 +- .../standard/list/default-list-item.js | 14 +- .../src/pages/settings/items/item-details.vue | 28 +-- .../items/metadata/item-metadata-edit.vue | 3 + .../web/src/pages/settings/model/model.vue | 6 +- 13 files changed, 333 insertions(+), 78 deletions(-) create mode 100644 bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-expire.vue diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/metadata/namespaces.js b/bundles/org.openhab.ui/web/src/assets/definitions/metadata/namespaces.js index 61582e309..c04200855 100644 --- a/bundles/org.openhab.ui/web/src/assets/definitions/metadata/namespaces.js +++ b/bundles/org.openhab.ui/web/src/assets/definitions/metadata/namespaces.js @@ -6,6 +6,7 @@ export default [ { name: 'listWidget', label: 'Default List Item Widget' }, { name: 'cellWidget', label: 'Default Cell Widget' }, { name: 'autoupdate', label: 'Auto-update' }, + { name: 'expire', label: 'Expiration timer' }, { name: 'alexa', label: 'Amazon Alexa' }, { name: 'homekit', label: 'Apple HomeKit' }, { name: 'ga', label: 'Google Assistant' } diff --git a/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-expire.vue b/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-expire.vue new file mode 100644 index 000000000..91f24009a --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-expire.vue @@ -0,0 +1,166 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-menu.vue b/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-menu.vue index a2e6fe17e..d68137271 100644 --- a/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-menu.vue +++ b/bundles/org.openhab.ui/web/src/components/item/metadata/item-metadata-menu.vue @@ -1,13 +1,21 @@