Merge pull request #3567 from Steve-Mcl/notification-buttons

Add "search for" buttons to notifications
This commit is contained in:
Nick O'Leary
2022-05-03 09:23:21 +01:00
committed by GitHub
9 changed files with 85 additions and 16 deletions

View File

@@ -358,6 +358,14 @@ var RED = (function() {
} else {
options.buttons = [
{
text: RED._("notification.label.unknownNodesButton"),
class: "pull-left",
click: function() {
RED.actions.invoke("core:search", "type:unknown ");
}
},
{
class: "primary",
text: RED._("common.label.close"),
click: function() {
persistentNotifications[notificationId].hideNotification();

View File

@@ -383,6 +383,14 @@ RED.deploy = (function() {
"</p>";
notificationButtons = [
{
text: RED._("deploy.unknownNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","type:unknown ");
}
},
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
@@ -402,6 +410,14 @@ RED.deploy = (function() {
RED._('deploy.confirm.confirm') +
"</p>";
notificationButtons = [
{
text: RED._("deploy.invalidNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","is:invalid ");
}
},
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
@@ -462,9 +478,33 @@ RED.deploy = (function() {
RED.nodes.version(data.rev);
RED.nodes.originalFlow(nns);
if (hasUnusedConfig) {
RED.notify(
let notification;
const opts = {
type: "success",
fixed: false,
timeout: 6000,
buttons: [
{
text: RED._("deploy.unusedConfigNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","is:config is:unused ");
}
},
{
text: RED._("common.label.close"),
class: "primary",
click: function () {
save(true);
notification.close();
}
}
]
}
notification = RED.notify(
'<p>' + RED._("deploy.successfulDeploy") + '</p>' +
'<p>' + RED._("deploy.unusedConfigNodes") + ' <a href="#" onclick="RED.sidebar.config.show(true); return false;">' + RED._("deploy.unusedConfigNodesLink") + '</a></p>', "success", false, 6000);
'<p>' + RED._("deploy.unusedConfigNodes") + '</p>', opts);
} else {
RED.notify('<p>' + RED._("deploy.successfulDeploy") + '</p>', "success");
}