openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
214 stars 235 forks source link

[mainui] Non-existing url generated in browser address bar #2394

Open seime opened 4 months ago

seime commented 4 months ago

The problem

When navigating in MainUI, a non-existant URL is generated by the UI. When doing browser reload, the URL is not found and an error page is shown:

CleanShot 2024-02-23 at 08 07 24@2x

Expected behavior

The browser address field is populated only with URLs that exists.

Steps to reproduce

  1. Open Settings -> Thingsand choose any Thing with at least one channel that is linked to an existing Item

  2. Click on Channels tab, choose any channel and click on the linked item: CleanShot 2024-02-23 at 08 10 39@2x You are taken to a page like

    CleanShot 2024-02-23 at 08 12 58@2x
  3. In the browser, reload the page -> Page not found

Your environment

runtimeInfo:
  version: 4.1.1
  buildString: Release Build
locale: en-NO
  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-02-23T07:15:46.836Z

Browser console

No messages

florian-h05 commented 3 months ago

This is because the route to the link info page is not part of routes.js, so it works when navigating around, but when reloading the page, the router doesn’t find this page.

Fixing this would require a new route to be added to the router, however it the problem that the https://github.com/openhab/openhab-webui/blob/9f006fdff308610379d2982d5a7584c60eb51230/bundles/org.openhab.ui/web/src/pages/settings/things/link/link-edit.vue link-edit page would need to load the data it normally gets passed from https://github.com/openhab/openhab-webui/blob/9f006fdff308610379d2982d5a7584c60eb51230/bundles/org.openhab.ui/web/src/components/thing/channel-link.vue.