Skip to content
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

UI Control: Open external site not working as per example. #1158

Closed
SynoUser-NL opened this issue Aug 5, 2024 · 4 comments
Closed

UI Control: Open external site not working as per example. #1158

SynoUser-NL opened this issue Aug 5, 2024 · 4 comments
Labels
bug Something isn't working size:S - 2 Sizing estimation point

Comments

@SynoUser-NL
Copy link

Current Behavior

Nothing happens..

Expected Behavior

A site (url sent by button) opens in a new (or the same) browser window.

Steps To Reproduce

[
{
"id": "4882290db8563350",
"type": "debug",
"z": "529f871459430a97",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 790,
"y": 560,
"wires": []
},
{
"id": "1d2494af36e71c20",
"type": "ui-button",
"z": "529f871459430a97",
"group": "5c3fa2715edc9ba5",
"name": "",
"label": "button",
"order": 1,
"width": 0,
"height": 0,
"emulateClick": false,
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"iconPosition": "left",
"payload": "https://www.google.com",
"payloadType": "str",
"topic": "url",
"topicType": "str",
"buttonColor": "",
"textColor": "",
"iconColor": "",
"x": 290,
"y": 520,
"wires": [
[
"dbcc95f97f5bf51c"
]
]
},
{
"id": "dbcc95f97f5bf51c",
"type": "change",
"z": "529f871459430a97",
"name": "",
"rules": [
{
"t": "set",
"p": "link",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 520,
"wires": [
[
"b0975b666ac696aa"
]
]
},
{
"id": "6d4bf619be7e1a26",
"type": "ui-control",
"z": "529f871459430a97",
"name": "",
"ui": "e9690ed2a2e30bab",
"events": "all",
"x": 800,
"y": 520,
"wires": [
[]
]
},
{
"id": "b0975b666ac696aa",
"type": "template",
"z": "529f871459430a97",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n {{topic}}: '{{{link}}}'\n}\n",
"output": "str",
"x": 620,
"y": 520,
"wires": [
[
"6d4bf619be7e1a26",
"4882290db8563350"
]
]
},
{
"id": "5c3fa2715edc9ba5",
"type": "ui-group",
"name": "Information & Links",
"page": "1c561fd9d2311d74",
"width": "4",
"height": "1",
"order": 2,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "e9690ed2a2e30bab",
"type": "ui-base",
"name": "Dashboard DSRI",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control",
"ui-text-input",
"ui-button",
"ui-button-group",
"ui-dropdown",
"ui-radio-group",
"ui-switch",
"ui-text",
"ui-slider",
"ui-table",
"ui-chart",
"ui-gauge",
"ui-markdown",
"ui-template"
],
"showPathInSidebar": false,
"showPageTitle": false,
"navigationStyle": "fixed",
"titleBarStyle": "default"
},
{
"id": "1c561fd9d2311d74",
"type": "ui-page",
"name": "Help",
"ui": "e9690ed2a2e30bab",
"path": "/help",
"icon": "help-box-multiple-outline",
"layout": "grid",
"theme": "e9a406b6866a2897",
"order": 2,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "e9a406b6866a2897",
"type": "ui-theme",
"name": "UM Theme",
"colors": {
"surface": "#001c3d",
"primary": "#039fdb",
"bgPage": "#ffffff",
"groupBg": "#ffffff",
"groupOutline": "#039fdb"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
}
]

Which on button click sends a payload of
image

Which is (if I'm not mistaken) idential (exept for URL) to the UI Control example in the Help and on Docs:
image

However, external site does not open when clicking the button. UI Control generates error:
image

Unless I am doing something wrong.. ?

Also, documentation does not mention if the external site opens in a new browser window.
It would be very nice to be able to have control over that.

Environment

  • Dashboard version: 1.14.0
  • Node-RED version: 4.0.2
  • Node.js version: 20.15.0
  • Browser: vivaldi, firefox

Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

@SynoUser-NL SynoUser-NL added bug Something isn't working needs-triage Needs looking at to decide what to do labels Aug 5, 2024
@joepavitt joepavitt added the size:S - 2 Sizing estimation point label Aug 5, 2024
@joepavitt joepavitt moved this from Backlog to Up Next in Dashboard Backlog Aug 5, 2024
@joepavitt joepavitt removed the needs-triage Needs looking at to decide what to do label Aug 5, 2024
@joepavitt
Copy link
Collaborator

Screenshot 2024-08-06 at 09 53 22

Note the type of the payload you're sending here... it's a String, not a JSON object.

@SynoUser-NL
Copy link
Author

When you think you've checked everything.. 🫨
Thanks Joe!

Is there a way to open the link in a new browser window\tab at this time?

@joepavitt
Copy link
Collaborator

Is there a way to open the link in a new browser window\tab at this time?

Not yet, but please do open a Feature Request

@github-project-automation github-project-automation bot moved this from Up Next to Done in Dashboard Backlog Aug 6, 2024
@SynoUser-NL
Copy link
Author

#1163

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:S - 2 Sizing estimation point
Projects
Status: Done
Development

No branches or pull requests

2 participants