-
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
ui-notification does not hide when sent {ui_update: {show: false}} #1437
Comments
Originally reported in https://discourse.nodered.org/t/dashboard2-close-notification/92873 |
Can confirm this. @joepavitt What is the intended functionality here? (assuming to maintain standardization across widgets it's onMsgInput (msg) {
// other code
// show/hide notification
if (msg.show === true || typeof msg.payload !== 'undefined') {
// If msg.show is true or msg.payload contains a notification title, the notification popup need to be showed (if currently hidden)
if (!this.show) {
this.show = true
// If a display time has been specified, close the notification automatically after that time
if (this.displayTime > 0) {
this.startCountdown(this.displayTime * 1000)
}
}
} else if (msg.show === false) {
// If msg.show is false, the notification popup need to be hidden (if currently showed)
if (this.show) {
this.close('input_msg')
}
}
}, The following modified flow demonstrates a working example with Expand Flow[
{
"id": "285d16e35a26ee0f",
"type": "ui-notification",
"z": "be27d720a00411c0",
"ui": "dashboard-ui-base",
"position": "center center",
"colorDefault": true,
"color": "#000000",
"displayTime": "",
"showCountdown": false,
"outputs": 1,
"allowDismiss": true,
"dismissText": "Ok",
"allowConfirm": false,
"confirmText": "Confirm",
"raw": false,
"className": "",
"name": "",
"x": 570,
"y": 260,
"wires": [
[]
]
},
{
"id": "f63a82911caf30c1",
"type": "inject",
"z": "be27d720a00411c0",
"name": "Show",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 260,
"wires": [
[
"2bd5f132ebc3ee3e"
]
]
},
{
"id": "2bd5f132ebc3ee3e",
"type": "function",
"z": "be27d720a00411c0",
"name": "hello",
"func": "msg = {\n payload:\"hello\"\n\n};\nreturn msg;\n\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 260,
"wires": [
[
"71ddc274ab3e03cf"
]
]
},
{
"id": "2934f84536f6fad7",
"type": "inject",
"z": "be27d720a00411c0",
"name": "hide",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 160,
"y": 320,
"wires": [
[
"949ed3144a258476"
]
]
},
{
"id": "a09cb12b7b1087c6",
"type": "debug",
"z": "be27d720a00411c0",
"name": "debug 87",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 340,
"wires": []
},
{
"id": "949ed3144a258476",
"type": "change",
"z": "be27d720a00411c0",
"name": "",
"rules": [
{
"t": "set",
"p": "show",
"pt": "msg",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 340,
"y": 320,
"wires": [
[
"71ddc274ab3e03cf"
]
]
},
{
"id": "71ddc274ab3e03cf",
"type": "junction",
"z": "be27d720a00411c0",
"x": 450,
"y": 260,
"wires": [
[
"285d16e35a26ee0f",
"a09cb12b7b1087c6"
]
]
},
{
"id": "dashboard-ui-base",
"type": "ui-base",
"name": "Dashboard",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false,
"showPageTitle": true,
"titleBarStyle": "default"
}
] |
Lack of documentation here, whereby the |
Current Behavior
If a Notification node is send a message containing
{ui_update: {show: false}}
it is not hiddenExpected Behavior
It should be hidden
Steps To Reproduce
Import this flow, click the Show inject to popup the notification, then the Hide inject, which should hide it.
Environment
Have you provided an initial effort estimate for this issue?
The text was updated successfully, but these errors were encountered: