daredoes / linked-lovelace-ui

Create cards that can be re-used, updated, and handle templated data.
MIT License
29 stars 3 forks source link

Load in pop-ups? #13

Closed The-Croz closed 1 year ago

The-Croz commented 1 year ago

Checklist:

Release with the issue: Latest Last working release (if known):

Browser and Operating System: Mac OS Chrome

Description of problem: Is it possible to get the linked lovelace card working in pop-ups? I am trying to load a card in a browser mod pop-up but it just shows up with the refresh all card and won't load in.

Javascript errors shown in the web inspector (if applicable):

Additional information:

daredoes commented 1 year ago

Could I get some screenshots? @The-Croz

The-Croz commented 1 year ago

Untitled Here you go @daredoes this GIF should show you what's happening. The same card alongside the popup loads in fine, just not the card in the popup. Thanks for taking a look.

daredoes commented 1 year ago

Oh interesting. This is because I don't check that field for cards to render from templates. Should be pretty easy to add. Could you send me the YAML for that browser pop-up card? @The-Croz

The-Croz commented 1 year ago

@daredoes sure thing. Here is the yaml:

show_name: true
show_icon: true
type: button
entity: input_button.dummy
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      title: ' '
      content:
        type: custom:linked-lovelace-template
        template: living-room
        template_data: {}

Thanks!

daredoes commented 1 year ago

This is slightly more complicated than I expected. I'll try to have a fix out by Monday 😄

The-Croz commented 1 year ago

No worries! Thanks for working on this.

daredoes commented 1 year ago

@The-Croz this clicked. I have a test that confirms your exact scenario as working. Fix will be pushed soon. You can use the redownload feature in HACS to force it to look for the newest version which will be 1.3.3

The-Croz commented 1 year ago

@daredoes you're a wizard. Thanks for this!

daredoes commented 1 year ago

Should be pushed if you want to give it a redownload @The-Croz