ashb commented on a change in pull request #22272:
URL: https://github.com/apache/airflow/pull/22272#discussion_r829270236



##########
File path: airflow/www/static/js/dag.js
##########
@@ -135,12 +135,18 @@ export function callModal(t, d, extraLinks, tryNumbers, 
sd, drID, mi) {
   mapIndex = mi;
   $('#dag_run_id').text(drID);
   $('#task_id').text(t);
-  $('#map_index').text(mapIndex);
   $('#execution_date').text(formatDateTime(d));
   $('#taskInstanceModal').modal({});
   $('#taskInstanceModal').css('margin-top', '0');
   $('#extra_links').prev('hr').hide();
   $('#extra_links').empty().hide();
+  if (mi >= 0) {
+    $('#modal_map_index').show();
+    $('#map_index, #modal_map_index .value').text(mi);

Review comment:
       Hmmm good question. This was already there, I just moved it. This might 
be setting the form control. 

##########
File path: airflow/www/templates/airflow/task_instance.html
##########
@@ -27,23 +27,33 @@
   <h4>
     <span class="text-muted">Task Instance:</span> <span>{{ task_id }}</span>
     <span class="text-muted">at</span> <time datetime="{{ execution_date 
}}">{{ execution_date }}</time>
+    {% if map_index and map_index != -1 %}

Review comment:
       I've been testing this by hacking `ti.map_index=5` in the `def task` in 
the view (the task instance details view)

##########
File path: airflow/www/templates/airflow/task_instance.html
##########
@@ -27,23 +27,33 @@
   <h4>
     <span class="text-muted">Task Instance:</span> <span>{{ task_id }}</span>
     <span class="text-muted">at</span> <time datetime="{{ execution_date 
}}">{{ execution_date }}</time>
+    {% if map_index and map_index != -1 %}

Review comment:
       Not quite working right though.

##########
File path: airflow/www/static/js/dag.js
##########
@@ -135,12 +135,18 @@ export function callModal(t, d, extraLinks, tryNumbers, 
sd, drID, mi) {
   mapIndex = mi;
   $('#dag_run_id').text(drID);
   $('#task_id').text(t);
-  $('#map_index').text(mapIndex);
   $('#execution_date').text(formatDateTime(d));
   $('#taskInstanceModal').modal({});
   $('#taskInstanceModal').css('margin-top', '0');
   $('#extra_links').prev('hr').hide();
   $('#extra_links').empty().hide();
+  if (mi >= 0) {
+    $('#modal_map_index').show();
+    $('#map_index, #modal_map_index .value').text(mi);

Review comment:
       It wasn't needed though, so I've removed this new addition, (left the 
second selector here)

##########
File path: airflow/www/templates/airflow/task_instance.html
##########
@@ -27,23 +27,33 @@
   <h4>
     <span class="text-muted">Task Instance:</span> <span>{{ task_id }}</span>
     <span class="text-muted">at</span> <time datetime="{{ execution_date 
}}">{{ execution_date }}</time>
+    {% if map_index and map_index != -1 %}

Review comment:
       ```suggestion
       {% if map_index|defined and map_index != -1 %}
   ```
   
   I think




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to