-
Notifications
You must be signed in to change notification settings - Fork 279
fix(POPUP): merge tile defaults when passing newly created tile object #555
Conversation
We've overlooked the fact that user can pass a newly created tile object to $scope.showPopup() in which case the tile defaults were not merged. Explicitly merge defaults from the showPopup() call but avoid doing it multiple times for tiles that have already had defaults merged by checking a special cache key. Fixes #553
It looks like |
When calling it programmatically, you mean? This test tile appears to work for me: {
position: [0, 8],
width: 2, height: 2,
type: TYPES.DOOR_ENTRY,
id: {},
icon: 'mdi-phone',
title: 'DOOR_ENTRY',
state: false,
layout: {
camera: {
type: TYPES.CAMERA,
objFit: 'contain', // https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
id: 'camera.weather',
refresh: 5000,
bgSize: 'contain',
fullscreen: {
type: TYPES.CAMERA,
refresh: 15000, // can be number in milliseconds
bgSize: 'contain',
},
},
page: {},
tiles: [
{
position: [0, 0],
theme: ITEM_TRANSPARENT,
title: 'SCRIPT',
id: 'script.test_script',
type: TYPES.SCRIPT,
state: false,
variables: {
value: 'value from script',
},
},
],
},
}, And if I add:
then that also opens the popup on long-click. |
I am calling it is a similar way, popup opens up but none of the tiles inside are clickable. |
I could probably envision some problems if the tiles are generated dynamically but otherwise not sure what might be the issue. I guess we can investigate when you have access to your code. |
Ok, what I have is a
For some reason it does look like defaults are not being merged as even |
I guess that's because Will have to think how to fix that. |
For some reason this also does not work:
So I'm not too sure about |
Fixing in #664 |
We've overlooked the fact that user can pass a newly created tile object
to $scope.showPopup() in which case the tile defaults were not merged.
Explicitly merge defaults from the showPopup() call but avoid doing it
multiple times for tiles that have already had defaults merged by
checking a special cache key.
Fixes #553