kkhatua commented on a change in pull request #1591: DRILL-6933: Fix ctrl+enter 
when Impersonation is disabled
URL: https://github.com/apache/drill/pull/1591#discussion_r244891310
 
 

 ##########
 File path: exec/java-exec/src/main/resources/rest/profile/profile.ftl
 ##########
 @@ -506,7 +504,8 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
     document.getElementById('queryForm')
             .addEventListener('keydown', function(e) {
       if (!(e.keyCode == 13 && (e.metaKey || e.ctrlKey))) return;
-      if (e.target.form) doSubmitQueryWithUserName();
+      if (e.target.form) 
+        <#if 
model.isImpersonationOnlyEnabled()>doSubmitQueryWithUserName()<#else>submitQuery()</#if>;
 
 Review comment:
   Yes, this was the root cause, because we trap the key even (Ctrl + Enter) 
and submit the query. 
   We were trapping the event it for only impersonation scenarios. This takes 
care of that and abstracts the submit call. (i.e. the AJAX call). This way, we 
have only one method to do the actual submission, and the non-existent 
`username` will be handled by not setting header.
   
   Also, PR #1592 will use this method to further improve the user experience 
by blocking interaction.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to