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 51ae59ca02ecb6b630f58a64e7fb3ec13e3cf357 Author: Brent Bovenzi <[email protected]> AuthorDate: Tue Apr 12 16:01:31 2022 -0400 Fix gantt/graph modal --- airflow/www/static/js/dag.js | 32 ++------------------------------ airflow/www/templates/airflow/dag.html | 3 +++ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js index 145d1f2666..ad769773a1 100644 --- a/airflow/www/static/js/dag.js +++ b/airflow/www/static/js/dag.js @@ -177,16 +177,9 @@ export function callModal({ if (mi >= 0) { $('#modal_map_index').show(); $('#modal_map_index .value').text(mi); - // Marking state and clear are not yet supported for mapped instances - $('#success_action').hide(); - $('#failed_action').hide(); - $('#clear_action').hide(); } else { $('#modal_map_index').hide(); $('#modal_map_index .value').text(''); - $('#success_action').show(); - $('#failed_action').show(); - $('#clear_action').show(); } if (isSubDag) { $('#div_btn_subdag').show(); @@ -335,7 +328,6 @@ $(document).on('click', '#btn_back', () => { $('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; @@ -350,28 +342,8 @@ $('form[data-action]').on('submit', function submit(e) { if (form.map_index) { form.map_index.value = mapIndex === undefined ? '' : mapIndex; } - form.action = $(this).data('action'); - form.submit(); - } -}); - -// DAG Modal actions -$('form button[data-action]').on('click', function onClick() { - const form = $(this).closest('form').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; - } - if (form.execution_date) { - form.execution_date.value = executionDate; - } - form.origin.value = window.location; - if (form.task_id) { - form.task_id.value = taskId; - } - 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 d946875bd6..d30139a27d 100644 --- a/airflow/www/templates/airflow/dag.html +++ b/airflow/www/templates/airflow/dag.html @@ -317,6 +317,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"> @@ -358,6 +359,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"> @@ -391,6 +393,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">
