-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic ui-template #1475
Dynamic ui-template #1475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have been working through some examples and have been able to make it break by passing in the original template
contents. It needs to come in via a core Template node to maintain line spacing/breaks, etc. but it is failing to parse the contents, I'm an hour in, and struggling to understand why
Aaah that is a pity 🫤 |
|
I traced through the html/dom parser output and it's always identical in both the initial load, and after injecting the default content too (you will need to inject the |
@joepavitt,
Demo: This in info about my system:
And my local "template-dynamic" git branch is up to date with the remote repo on Github. Damn didn't wanted to waste your time... |
So weird. So for Vue both template strings are identical, because it doesn't rerender at all unless you pas a Hello World string in between. But for the DOMparser it fails. Can you do perhaps enable the browser debugger option "break on (un)caught exception"? |
BTW I see in the template editor that one of the closing tags has a red color: Could it perhaps be that the I found somebody that solved a similar issue like this:
You could try it, but I have no idea whether it will do the job... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1517 has been opened to catch a potential edge case, and needs investigating, but this PR already adds in more functionality than we have now, so I think it should be moved forward
Description
This PR allows the template to be dynamically injected via
msg.ui_update.format
.Example flow:
Some background information about the code changes:
setup()
to 2 methods: parseCustomTemplate and createVNode.render
hook, which is automatically called by Vue when something changes.render
hook.TODO:
Related Issue(s)
Closes #1433
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label