AngersZhuuuu commented on a change in pull request #30573:
URL: https://github.com/apache/spark/pull/30573#discussion_r535873103



##########
File path: core/src/main/resources/org/apache/spark/ui/static/stagepage.js
##########
@@ -245,20 +245,33 @@ function createRowMetadataForColumn(colKey, data, 
checkboxId) {
 function reselectCheckboxesBasedOnTaskTableState() {
     var allChecked = true;
     var taskSummaryMetricsTableCurrentFilteredArray = 
taskSummaryMetricsTableCurrentStateArray.slice();
-    if (typeof taskTableSelector !== 'undefined' && 
taskSummaryMetricsTableCurrentStateArray.length > 0) {
-        for (var k = 0; k < optionalColumns.length; k++) {
-            if (taskTableSelector.column(optionalColumns[k]).visible()) {
-                $("#box-"+optionalColumns[k]).prop('checked', true);
-                
taskSummaryMetricsTableCurrentStateArray.push(taskSummaryMetricsTableArray.filter(row
 => (row.checkboxId).toString() == optionalColumns[k])[0]);
-                taskSummaryMetricsTableCurrentFilteredArray = 
taskSummaryMetricsTableCurrentStateArray.slice();
-            } else {
-                allChecked = false;
+    if ((typeof taskTableSelector !== 'undefined' && 
taskSummaryMetricsTableCurrentStateArray.length > 0) || typeof 
executorSummaryTableSelector !== 'undefined') {
+        if (typeof taskTableSelector !== 'undefined' && 
taskSummaryMetricsTableCurrentStateArray.length > 0) {

Review comment:
       > The condtion `typeof taskTableSelector !== 'undefined' && 
taskSummaryMetricsTableCurrentStateArray.length > 0` repeats twice here.
   > Can we separate the condition `typeof taskTableSelector !== 'undefined' && 
taskSummaryMetricsTableCurrentStateArray.length > 0` and `typeof 
executorSummaryTableSelector !== 'undefined'` ?
   
   Updated




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to