This is an automated email from the ASF dual-hosted git repository. bbovenzi pushed a commit to branch mapped-instance-actions in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 4410c0119202dc97de631c6661117aaafb84f944 Author: Brent Bovenzi <[email protected]> AuthorDate: Tue Apr 12 16:01:31 2022 -0400 Fix gantt/graph modal --- airflow/www/static/js/dag.js | 15 +++++++-------- airflow/www/templates/airflow/dag.html | 3 +++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js index ca8b7cc676..ded26baeab 100644 --- a/airflow/www/static/js/dag.js +++ b/airflow/www/static/js/dag.js @@ -171,14 +171,11 @@ export function callModal({ $('#extra_links').prev('hr').hide(); $('#extra_links').empty().hide(); if (mi >= 0) { - // Marking state and clear are not yet supported for mapped instances - $('#success_action').hide(); - $('#failed_action').hide(); - $('#clear_action').hide(); + $('#modal_map_index').show(); + $('#modal_map_index .value').text(mi); } else { - $('#success_action').show(); - $('#failed_action').show(); - $('#clear_action').show(); + $('#modal_map_index').hide(); + $('#modal_map_index .value').text(''); } if (isSubDag) { $('#div_btn_subdag').show(); @@ -339,7 +336,6 @@ $(document).on('click', '.map_index_item', function mapItem() { $('form[data-action]').on('submit', function submit(e) { e.preventDefault(); const form = $(this).get(0); - // Somehow submit is fired twice. Only once is the executionDate/dagRunId valid if (dagRunId || executionDate) { if (form.dag_run_id) { form.dag_run_id.value = dagRunId; @@ -354,6 +350,9 @@ $('form[data-action]').on('submit', function submit(e) { if (form.map_index) { form.map_index.value = mapIndex === undefined ? '' : mapIndex; } + if (form.map_indexes) { + form.map_indexes.value = mapIndex === undefined ? '' : mapIndex; + } form.action = $(this).data('action'); form.submit(); } diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html index 1dafcb27f7..8259c7045c 100644 --- a/airflow/www/templates/airflow/dag.html +++ b/airflow/www/templates/airflow/dag.html @@ -310,6 +310,7 @@ <input type="hidden" name="dag_id" value="{{ dag.dag_id }}"> <input type="hidden" name="task_id"> <input type="hidden" name="execution_date"> + <input type="hidden" name="map_indexes"> <input type="hidden" name="origin" value="{{ request.base_url }}"> <div class="row"> <span class="btn-group col-xs-12 col-sm-9 task-instance-modal-column" data-toggle="buttons"> @@ -351,6 +352,7 @@ <input type="hidden" name="dag_id" value="{{ dag.dag_id }}"> <input type="hidden" name="task_id"> <input type="hidden" name="dag_run_id"> + <input type="hidden" name="map_indexes"> <input type="hidden" name="origin" value="{{ request.base_url }}"> <input type="hidden" name="state" value="failed"> <div class="row"> @@ -384,6 +386,7 @@ <input type="hidden" name="dag_id" value="{{ dag.dag_id }}"> <input type="hidden" name="task_id"> <input type="hidden" name="dag_run_id"> + <input type="hidden" name="map_indexes"> <input type="hidden" name="origin" value="{{ request.base_url }}"> <input type="hidden" name="state" value="success"> <div class="row">
