Skip to content

Commit

Permalink
#2824 Fixed event handlers new xid not displaying after saving edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrykb0802 committed Jul 24, 2024
1 parent 25ccc99 commit e9247d2
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 52 deletions.
64 changes: 33 additions & 31 deletions WebContent/WEB-INF/jsp/eventHandlers.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -461,35 +461,38 @@
$set("xid", selectedHandlerNode.object.xid);
stopImageFader("saveImg");
showDwrMessages([message]);
}
else {
if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_EMAIL %>"/>) {
var emailList = emailRecipients.createRecipientArray();
var escalList = escalRecipients.createRecipientArray();
var inactiveList = inactiveRecipients.createRecipientArray();
EventHandlersDwr.saveEmailEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias,
disabled, emailList, $get("sendEscalation"), $get("escalationDelayType"), $get("escalationDelay"),
escalList, $get("sendInactive"), $get("inactiveOverride"), inactiveList, saveEventHandlerCB);
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SMS %>"/>) {
var smsList = smsRecipients.createRecipientArray();
EventHandlersDwr.saveSmsEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias, disabled, smsList, saveEventHandlerCB);
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SET_POINT %>"/>) {
EventHandlersDwr.saveSetPointEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias,
disabled, $get("targetPointSelect"), $get("activeAction"), $get("setPointValueActive"),
$get("activePointId"), $get("inactiveAction"), $get("setPointValueInactive"),
$get("inactivePointId"), saveEventHandlerCB);
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_PROCESS %>"/>) {
EventHandlersDwr.saveProcessEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid,
alias, disabled, $get("activeProcessCommand"), $get("inactiveProcessCommand"), saveEventHandlerCB);
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SCRIPT %>"/>) {
EventHandlersDwr.saveScriptEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid,
alias, disabled, $get("activeScriptCommand"), $get("inactiveScriptCommand"), saveEventHandlerCB);
}
return;
}
if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_EMAIL %>"/>) {
var emailList = emailRecipients.createRecipientArray();
var escalList = escalRecipients.createRecipientArray();
var inactiveList = inactiveRecipients.createRecipientArray();
EventHandlersDwr.saveEmailEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias,
disabled, emailList, $get("sendEscalation"), $get("escalationDelayType"), $get("escalationDelay"),
escalList, $get("sendInactive"), $get("inactiveOverride"), inactiveList, saveEventHandlerCB);
}
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SMS %>"/>) {
var smsList = smsRecipients.createRecipientArray();
EventHandlersDwr.saveSmsEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias, disabled, smsList, saveEventHandlerCB);
}
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SET_POINT %>"/>) {
EventHandlersDwr.saveSetPointEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias,
disabled, $get("targetPointSelect"), $get("activeAction"), $get("setPointValueActive"),
$get("activePointId"), $get("inactiveAction"), $get("setPointValueInactive"),
$get("inactivePointId"), saveEventHandlerCB);
}
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_PROCESS %>"/>) {
EventHandlersDwr.saveProcessEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid,
alias, disabled, $get("activeProcessCommand"), $get("inactiveProcessCommand"), saveEventHandlerCB);
}
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SCRIPT %>"/>) {
EventHandlersDwr.saveScriptEventHandler(selectedEventTypeNode.object.typeId,
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid,
alias, disabled, $get("activeScriptCommand"), $get("inactiveScriptCommand"), saveEventHandlerCB);
}
}
Expand All @@ -500,7 +503,6 @@
showDwrMessages(response.messages, $("genericMessages"));
else {
var handler = response.data.handler;
setUserMessage("<fmt:message key="eventHandlers.saved"/>");
if (!selectedHandlerNode) {
selectedHandlerNode = createHandlerNode(handler);
selectedEventTypeNode.addChild(selectedHandlerNode);
Expand All @@ -509,7 +511,7 @@
}
else
$set(handler.id +"Msg", handler.message);
setUserMessage("<fmt:message key="eventHandlers.saved"/>");
selectedHandlerNode.object = handler;
}
}
Expand Down
4 changes: 2 additions & 2 deletions webapp-resources/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,6 @@ validate.required=Ben\u00f6tigter Wert
validate.text.incompatible=Text renderer is incompatible with data type
validate.event.incompatible=Event text renderer is incompatible with data type
validate.xidUsed=Diese XID wird bereits vergeben
validate.valueRestored=Previous value restored
viewEdit.addViewComponent=F\u00fcge Komponente hinzu
viewEdit.anonymous=Anonymer Zugriff
viewEdit.background=Hintergrundbild
Expand Down Expand Up @@ -3342,4 +3341,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2989,7 +2989,6 @@ validate.required=Required value
validate.text.incompatible=Text renderer is incompatible with data type
validate.event.incompatible=Event text renderer is incompatible with data type
validate.xidUsed=This XID is already in use
validate.valueRestored=Previous value restored
viewEdit.addViewComponent=Add component to view
viewEdit.anonymous=Anonymous access
viewEdit.background=Background image
Expand Down Expand Up @@ -3345,4 +3344,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,6 @@ validate.required=Se requiere un valor
validate.text.incompatible=El generador de Texto es incompatibles con el tipo de dato
validate.event.incompatible=Event text renderer is incompatible with data type
validate.xidUsed=Este XID ya est\u00e1 en uso
validate.valueRestored=Previous value restored
viewEdit.addViewComponent=Agregar componente a la vista
viewEdit.anonymous=Acceso Anonymous
viewEdit.background=Imagen de fondo
Expand Down Expand Up @@ -3385,4 +3384,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_fi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,6 @@ validate.ped.xidUsed=Sama XID ''{0}'' on k\u00e4yt\u00f6ss\u00e4 useille tapahtu
validate.ped.xidMissing=Kaikilla tunnistimilla pit\u00e4\u00e4 olla XID. Ei tallennettu
validate.invalidCron=Virhe cron-lauseessa: {0}
validate.pachube.dataStreadIdRequired=Data stream id vaaditaan
validate.valueRestored=Previous value restored

confirmation.pointDisabled=Piste poistettu k\u00e4yt\u00f6st\u00e4
confirmation.pointEnabled=Piste otettu k\u00e4ytt\u00f6\u00f6n
Expand Down Expand Up @@ -3471,4 +3470,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2816,7 +2816,6 @@ validate.required=Valeur requise
validate.text.incompatible=Texte rendu est incompatible avec le type de données
validate.event.incompatible=Event text renderer is incompatible with data type
validate.xidUsed=Ce XID est déjà en utilisation
validate.valueRestored=Previous value restored
viewEdit.addViewComponent=Ajouter composants à la vue
viewEdit.anonymous=Accès anonyme
viewEdit.background=Image de fond
Expand Down Expand Up @@ -3339,4 +3338,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_lu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3037,7 +3037,6 @@ validate.required=N\u00e9ideschen W\u00e4ert
validate.text.incompatible=Text renderer is incompatible with data type
validate.event.incompatible=Event text renderer is incompatible with data type
validate.xidUsed=Des XID get scho verginn
validate.valueRestored=Previous value restored
viewEdit.addViewComponent=Komponente b\u00e4if\u00fcgen
viewEdit.anonymous=Anonymen Zougr\u00ebff
viewEdit.background=Hannergrondbild
Expand Down Expand Up @@ -3358,4 +3357,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,6 @@ validate.ped.xidUsed=Dezelfde XID ''{0}'' is in gebruik voor meerdere gebeurteni
validate.ped.xidMissing=Alle gebeurtenis detectoren moeten een XID definieren. Niet opgeslagen
validate.invalidCron=Fout in cron expressie: {0}
validate.pachube.dataStreadIdRequired=Data stream id is verplicht
validate.valueRestored=Previous value restored

confirmation.pointDisabled=Data punt is uitgeschakeld
confirmation.pointEnabled=Data punt is ingeschakeld
Expand Down Expand Up @@ -3461,4 +3460,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
2 changes: 1 addition & 1 deletion webapp-resources/messages_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,6 @@ validate.ped.xidUsed=The same XID ''{0}'' is being used for multiple event detec
validate.ped.xidMissing=All event detectors must define an XID. Not saved
validate.invalidCron=Error in cron expression: {0}
validate.pachube.dataStreadIdRequired=Data stream id is required
validate.valueRestored=Previous value restored

confirmation.pointDisabled=Data point has been disabled
confirmation.pointEnabled=Data point has been enabled
Expand Down Expand Up @@ -3484,3 +3483,4 @@ event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,6 @@ validate.ped.xidUsed=O mesmo XID ''{0}'' est\u00e1 sendo utilizado. N\u00e3o sal
validate.ped.xidMissing=Todos os detectores de evento devem definir um XID. N\u00e3o salvo.
validate.invalidCron=Erro na express\u00e3o cron: {0}
validate.pachube.dataStreadIdRequired=Id de fluxo de dados \u00e9 necess\u00e1rio
validate.valueRestored=Previous value restored

confirmation.pointDisabled=Data point foi desabilitado
confirmation.pointEnabled=Data point foi habilitado
Expand Down Expand Up @@ -3497,4 +3496,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,6 @@ validate.ped.xidUsed=\u042d\u0442\u043e\u0442 XID ''{0}'' \u0443\u0436\u0435 \u0
validate.ped.xidMissing=\u0412\u0441\u0435 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c XID. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e
validate.invalidCron=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043a\u0440\u043e\u043d\u0430: {0}
validate.pachube.dataStreadIdRequired=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445
validate.valueRestored=Previous value restored

confirmation.pointDisabled=\u0422\u043e\u0447\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430
confirmation.pointEnabled=\u0422\u043e\u0447\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430
Expand Down Expand Up @@ -3493,4 +3492,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored
4 changes: 2 additions & 2 deletions webapp-resources/messages_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,6 @@ validate.axis.invalid=\u5fc5\u987b\u662f A, B, C, D, E, F, G, H\u4e2d\u7684\u4e0
validate.ped.xidUsed=\u76f8\u540c\u7684XID ''{0}'' \u7528\u4e8e\u591a\u4e2a\u4e8b\u4ef6\u76d1\u89c6\u5668\u3002\u672a\u4fdd\u5b58
validate.ped.xidMissing=\u6240\u6709\u4e8b\u4ef6\u76d1\u89c6\u5668\u5fc5\u987b\u5b9a\u4e49\u4e00\u4e2aXID\u3002\u672a\u4fdd\u5b58
validate.invalidCron=\u5b9a\u65f6\u8868\u8fbe\u5f0f\u9519\u8bef: {0}
validate.valueRestored=Previous value restored

confirmation.pointDisabled=\u6570\u636e\u70b9\u5df2\u65e0\u6548
confirmation.pointEnabled=\u6570\u636e\u70b9\u5df2\u4f7f\u80fd
Expand Down Expand Up @@ -3446,4 +3445,5 @@ dsEdit.sql.statementLimit.warning=Setting the value 0 in the Statement limit fie
event.sms.failure=Failed to send sms titled "{0}" to "{1}". Message: "{2}"
event.script.failure=Failed execute script: "{0}", Message: "{1}"
event.system.sms=Sms send failure
event.system.script=Script event handler failure
event.system.script=Script event handler failure
validate.valueRestored=Previous value restored

0 comments on commit e9247d2

Please sign in to comment.