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

State Description Pattern from Item's Edit Page not Saving #2468

Closed
rkoshak opened this issue Mar 12, 2024 · 2 comments · Fixed by #2474
Closed

State Description Pattern from Item's Edit Page not Saving #2468

rkoshak opened this issue Mar 12, 2024 · 2 comments · Fixed by #2474
Labels
bug Something isn't working main ui Main UI

Comments

@rkoshak
Copy link

rkoshak commented Mar 12, 2024

The problem

When clicking on an Item's page there is an option to set the State Description Pattern.

I find it shows %.0f %unit% even when the Item already has a State Description through the metadata menu.

For example:

I have a temperature Item withe a State Description Pattern: %.1f °F

I can see it’s applied.

image

But the “State description pattern” on the Item’s edit page still reads %.0f %unit%.

image

When I try to change it, it does not appear to save the change (in this case to %.3f %unit%).

If I go to an Item that does not have a State Description Pattern, when I go to the Item’s edit page and I change the State Description Pattern, upon hitting save it reverts back to %.0f %unit% and no State Description Metadata is created.

There are no errors in openhab.log.

There might be two issues involved here. The value entered into the state description field reverts when clicking on any other field, not just when clicking save. I'm going to open a separate issue for this behavior because it's also occurring elsewhere so it is likely a wider issue.

To make things even weirder, if I do click on another field before saving the Item it works as expected. The existing state description pattern is updated.

Hopefully this is enough info to reproduce it.

Expected behavior

Editing and saving the state description pattern from the Item's edit page:

  • creates state description metadata if it doesn't already exist upon save
  • updates state description metadata if it does already exist upon save
  • shows the current state description metadata if it already exists

Steps to reproduce

  1. Navigate to the Item's settings page for an Item with a state description

  2. Notice the state description pattern shows %.0f %unit%

  3. Modify the pattern and click save. Notice the modifications revert to %.0f %unit% and that State Description metadata was not modified

  4. Navigate to the Item's settings page for an Item without a state description

  5. Modify the pattern and click save. Notice the modifications revert and no State Description metadata was created.

Your environment

runtimeInfo:
  version: 4.2.0.M1
  buildString: Milestone Build
locale: en-US
systemInfo:
  configFolder: /openhab/conf
  userdataFolder: /openhab/userdata
  logFolder: /openhab/userdata/logs
  javaVersion: 17.0.10
  javaVendor: Debian
  osName: Linux
  osVersion: 5.15.0-97-generic
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 347490960
  totalMemory: 1205862400
  uptime: 3078
  startLevel: 100
addons:
  - automation-jsscripting
  - automation-jsscriptingnashorn
  - binding-amazonechocontrol
  - binding-astro
  - binding-chromecast
  - binding-http
  - binding-ipcamera
  - binding-mail
  - binding-mqtt
  - binding-network
  - binding-networkupstools
  - binding-openweathermap
  - binding-shelly
  - binding-vesync
  - binding-zigbee
  - binding-zwave
  - misc-openhabcloud
  - persistence-mapdb
  - persistence-rrd4j
  - transformation-jinja
  - transformation-jsonpath
  - transformation-map
  - transformation-regex
  - ui-basic
  - ui-habot
  - voice-googletts
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: true
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: macos
    pixelRatio: 2
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 1
    hardwareConcurrency: 2
    language: en-US
    languages:
      - en-US
    onLine: true
    platform: MacIntel
  screen:
    width: 1439
    height: 1044
    colorDepth: 30
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: light
    homeNavbar: simple
    homeBackground: standard
    expandableCardAnimation: default
    blocklyRenderer: zelos
  userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
    (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
timestamp: 2024-03-12T15:38:18.469Z

Browser console

I'm not sure if these are relevant. The Brave Browser console doesn't make it easy to copy the logs.

Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://home.myopenhab.org/settings/items/BasementAirthingsWavePlus_Temperature/') with script ('https://home.myopenhab.org/settings/items/BasementAirthingsWavePlus_Temperature/service-worker.js'): The script has an unsupported MIME type ('text/html').

And

Incorrect use of autocomplete attribute
A form field's autocomplete attribute is empty. This might prevent the browser from correctly autofilling the form.
To fix this issue, provide a valid autocomplete value.

Browser network traffic

image

None of the calls appear to have failed.

Additional information

@rkoshak rkoshak added bug Something isn't working main ui Main UI labels Mar 12, 2024
@florian-h05
Copy link
Contributor

Seems like it was forgotten to adjust the item-mixin accordingly to the state description field being visible when editing an existing Item ... I will fix that.

florian-h05 added a commit to florian-h05/openhab-webui that referenced this issue Mar 13, 2024
Fixes openhab#2468.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit to florian-h05/openhab-webui that referenced this issue Mar 13, 2024
Fixes openhab#2468.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit that referenced this issue Mar 13, 2024
Fixes #2468.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@mherwege
Copy link
Contributor

Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants