iantrich / restriction-card

🔒 Apply restrictions to Lovelace cards
MIT License
270 stars 23 forks source link

The updated version does not work #92

Closed ildar170975 closed 1 year ago

ildar170975 commented 1 year ago

Installed the latest 1.2.8 (although Code inspector says 1.2.6)

image

No "lock" button is displayed.

ildar170975 commented 1 year ago

Seems to be working for rows only: image

criticallimit commented 1 year ago

Same here. After update restrictiuons are no longer working. The Lock is shown, but restrictions are ignored.

type: entities
entities:
  - entity: switch.ladestation_switch
    name: Ladestation
    icon: mdi:usb
  - entity: switch.fernseher
    icon: hass:television
  - card:
      entity: switch.3d_drucker_switch
      name: 3D-Drucker
      icon: mdi:printer-3d-nozzle
      duration: 10
      state_color: true
    restrictions:
      confirm:
        text: ' Sicher?'
    type: custom:restriction-card
    row: true
    duration: 10
state_color: true
show_header_toggle: false
title: Wohnen
ildar170975 commented 1 year ago

@criticallimit Do not confirm. The bug seems to be related only to row: false case.

a0

criticallimit commented 1 year ago

@ildar:

sorry, but here it is no longer working after the update. Even after removing and installing it´s not working. And so I posted it here under the topic-title "The updated version does not work"

Going back to 1.2.7 it´s working fine

ildar170975 commented 1 year ago

@criticallimit Strange... Well, I will also downgrade to 1.2.7. May be someone will make a fix.

bcutter commented 1 year ago

I can also confirm there's absolutely no restriction effect performed anymore after updating to https://github.com/iantrich/restriction-card/releases/tag/1.2.8.

HA 2022.12.9 so frontend might be a bit old. How can the minimal change in 1.2.8 have such a breaking change effect?

Downgrade, downgrade, downgrade.

henkall commented 1 year ago

The thing that I have seen is that z-index in the code was removed and just by setting that again to 1 fixes the problem for me.

criticallimit commented 1 year ago

@henkall

Where did you changed the z-index? In the "restriction-card.js"? I tried to add it, change it to 1 or 50. No changes. Even when I install 1.2.7 and remove z-index in restriction-card.js, the restrictions are working.

ildar170975 commented 1 year ago

After any change of js-file you need to be sure that THIS code is used in a browser. Clear cache, delete gz. Since version is stuck in 1.2.6 (and nobody cares about changing it in js-file), no way to check if the changed plugin is loaded.

criticallimit commented 1 year ago

Yes, I know. Done all this without success

henkall commented 1 year ago

@henkall

Where did you changed the z-index? In the "restriction-card.js"? I tried to add it, change it to 1 or 50. No changes. Even when I install 1.2.7 and remove z-index in restriction-card.js, the restrictions are working.

I tested it just in the developer tool build in to chrome. (F12) There you can add it and remove z-index to #Overlay And that was how I found out that the z-index should be set to 1 for my setup to work. It also works fine with 50 but then it seems to overlap with other windows.

geferon commented 1 year ago

@criticallimit you need to modify the gz file which is the one that gets served to browsers, if you only modify the js file no changes get sent to the client, aka Modify JS file, delete GZ and recreate GZ from the JS file

bcutter commented 1 year ago

I vote for fixing this in the source and providing a new version instead of fiddling around on an individual basis.

A (for me the only) workaround is to downgrade, sit and wait.

iantrich commented 1 year ago

If someone can submit a PR, I'll get it merged in, but I don't have the capacity to work on this myself at the moment.

kimbo1st commented 1 year ago

Same here.. it ignores the lock.. have a simple button card