alerta / alerta-webui

Alerta Web UI 7.0
https://try.alerta.io
Apache License 2.0
109 stars 55 forks source link

Permissions are not showing on the page #576

Open vtaits opened 5 months ago

vtaits commented 5 months ago

Issue Summary

Permissions are not showing on the page due to a javascript error

Environment

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Permissions page'
  2. Create a permission
  3. Refresh the page
  4. See "Sorry, nothing to display here :("
vue.runtime.esm.js:3049 TypeError: items.filter is not a function
    at VueComponent.customFilter (PermList.vue:317:1)
    at Array.filter (<anonymous>)
    at VueComponent.perms (PermList.vue:264:1)
    at Watcher.get (vue.runtime.esm.js:3446:1)
    at Watcher.evaluate (vue.runtime.esm.js:3547:1)
    at VueComponent.computedGetter [as perms] (vue.runtime.esm.js:5537:1)
    at Object.get (vue.runtime.esm.js:5329:1)
    at Proxy.render (PermList.vue:297:1)
    at Vue._render (vue.runtime.esm.js:2684:1)
    at VueComponent.updateComponent (vue.runtime.esm.js:3875:1)

Expected behavior Created permission is displayed

Screenshots photo_2024-02-13_12-31-19 photo_2024-02-13_12-31-46

Additional context

Trying to call an array method on a non-array

https://github.com/alerta/alerta-webui/blob/d9b1155484f776e51aa431dd600ca48bf0e07c3b/src/components/PermList.vue#L265

https://github.com/alerta/alerta-webui/blob/d9b1155484f776e51aa431dd600ca48bf0e07c3b/src/components/PermList.vue#L317