vvysotskyi commented on a change in pull request #2154:
URL: https://github.com/apache/drill/pull/2154#discussion_r565520223
##########
File path: exec/java-exec/src/main/resources/rest/alertModals.ftl
##########
@@ -48,26 +48,29 @@
<script>
//Populate the alert modal with the right message params and show
function populateAndShowAlert(errorMsg, inputValues) {
+ let errorModal=$('#errorModal');
+ let title;
+ let body;
if (!(errorMsg in errorMap)) {
//Using default errorId to represent message
- modalHeader.innerHTML=errorMsg;
- modalBody.innerHTML="[Auto Description] "+JSON.stringify(inputValues);
+ title=errorMsg;
+ body="[Auto Description] "+JSON.stringify(inputValues);
} else {
- modalHeader.innerHTML=errorMap[errorMsg].msgHeader;
- modalBody.innerHTML=errorMap[errorMsg].msgBody;
+ title=errorMap[errorMsg].msgHeader;
+ body=errorMap[errorMsg].msgBody;
}
//Check if substitutions are needed
- let updatedHtml=modalBody.innerHTML;
if (inputValues != null) {
- var inputValuesKeys = Object.keys(inputValues);
+ let inputValuesKeys = Object.keys(inputValues);
for (i=0; i<inputValuesKeys.length; ++i) {
- let currKey=inputValuesKeys[i];
- updatedHtml=updatedHtml.replace(currKey,
escapeHtml(inputValues[currKey]));
+ let currKey=inputValuesKeys[i];
+ body=body.replace(currKey, escapeHtml(inputValues[currKey]));
}
- modalBody.innerHTML=updatedHtml;
}
+ errorModal.find('.modal-title').text(title);
Review comment:
@luocooong, can we commit it as it is, and leave this issue for a
contributor with good frontend knowledge?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]