Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal buttons causing JS error on run detail page #637

Open
ajstewart opened this issue Mar 2, 2022 · 0 comments
Open

Modal buttons causing JS error on run detail page #637

ajstewart opened this issue Mar 2, 2022 · 0 comments
Labels
help wanted Extra attention is needed low priority Issue is not of immediate concern. UI User Interface

Comments

@ajstewart
Copy link
Contributor

The modals on the run detail page, that are used for the various run task buttons, are causing a JS error in the browser console, along with other warnings. Something to do with the checkboxes that are used in these modals.

<!-- Run pipeline modal-->
<div class="modal fade" id="runPipeModal" tabindex="-1" role="dialog" aria-labelledby="runPipeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title font-weight-bold" id="runPipeModalLabel">Run {{ p_run.name }}</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="runPipeForm" action="{% url 'vast_pipeline:api_pipe_runs-run' p_run.id %}" method="post" novalidate>
{% csrf_token %}
<p>Please read the sections below and confirm how you wish '{{ p_run.name }}' to be processed.</p>
<hr>
<h5>Add New Images to Run</h5>
Follow these steps to add new images to the run:
<ul type="square">
<li>Enter the new images to be processed to the image list in the pipeline configuration file,
along with the selavy, noise and background entries.</li>
<li><b>Do not</b> remove the previous images or change any other settings.</li>
<li>Once the configuration file is prepared the run can be scheduled for processing using the 'Schedule Run' button below.</li>
</ul>
<hr>
<h5 style="color:#d9534f">Danger Area - Full Re-Run</h5>
<div style="color:#d9534f">
<p>
Use the option here to request that the run be completely re-processed.
Be aware that this will completely remove <b>all</b> previous
results of the pipeline, including all comments and tags assigned to sources.
</p>
Full Re-Run:
<div class="btn-group btn-group-toggle mr-auto" data-toggle="buttons">
<input type="checkbox" data-toggle="toggle" name="fullReRun" id="fullReRun-toggle" data-size="sm" data-onstyle='danger'>
</div>
</div>
<br>
<div class="modal-footer">
Debug log output:
<div class="btn-group btn-group-toggle mr-auto" data-toggle="buttons">
<input type="checkbox" name="debug" id="debugToggle" data-toggle="toggle" data-size="sm">
</div>
<button class="btn btn-secondary btn-icon-split" type="button" data-dismiss="modal">
<span class="icon">
<i class="fa fa-window-close"></i>
</span>
<span class="text">Cancel</span>
</button>
<button id="createPipeRun" class="btn btn-success btn-icon-split" type="submit">
<span class="icon">
<i class="fas fa-rocket fa-sm"></i>
</span>
<span class="text">Schedule Run</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Restore pipeline modal-->
<div class="modal fade" id="restorePipeModal" tabindex="-1" role="dialog" aria-labelledby="restorePipeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title font-weight-bold" id="restorePipeModalLabel">Restore Run {{ p_run.name }}</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="restorePipeForm" action="{% url 'vast_pipeline:api_pipe_runs-restore' p_run.id %}" method="post" novalidate>
{% csrf_token %}
<p>
This process will restore the pipeline run to the previous successful run.
For example, if an image was added that was wrong or the run errored part-way through, this procedure can restore the pipeline run to before the addition was attempted.
It can only be used once, which means you cannot restore the run state from more than one run previous.
</p>
<h5>Previous Successful Config</h5>
The pipeline run will be restored to the state of the configuration file below.
Note that if no configuration file is shown then the restore method cannot be used.
<pre id="prevrunConfigText" class="pre-scrollable" style="max-height: 50vh" contenteditable="false"><code id="prevrunConfigTextCode" class="language-yaml line-numbers" style="white-space: pre">{% if p_run.prev_config_txt %}{{ p_run.prev_config_txt }}{% else %}No previous config exists.{% endif %}</code></pre>
<hr>
<h5 style="color:#d9534f">Warning</h5>
<div style="color:#d9534f">
<p>
This process cannot be undone and the current state will be lost.
</p>
</div>
<div class="modal-footer">
Debug log output:
<div class="btn-group btn-group-toggle mr-auto" data-toggle="buttons">
<input type="checkbox" name="restoreDebug" id="restoreDebugToggle" data-toggle="toggle" data-size="sm">
</div>
<button class="btn btn-secondary btn-icon-split" type="button" data-dismiss="modal">
<span class="icon">
<i class="fa fa-window-close"></i>
</span>
<span class="text">Cancel</span>
</button>
<button id="restorePipeRun" class="btn btn-warning btn-icon-split" {% if p_run.prev_config_txt == None %}
disabled="disabled"
{% endif %} type="submit">
<span class="icon">
<i class="fas fa-window-restore fa-sm"></i>
</span>
<span class="text">Restore Run</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Delete pipeline modal-->
<div class="modal fade" id="deletePipeModal" tabindex="-1" role="dialog" aria-labelledby="deletePipeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title font-weight-bold" id="deletePipeModalLabel">Delete Run {{ p_run.name }}</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="deletePipeForm" action="{% url 'vast_pipeline:api_pipe_runs-delete' p_run.id %}" method="post" novalidate>
{% csrf_token %}
<p>
Delete the pipeline run and the associated data products.
The run directory will also be deleted.
Please manually back up the configuration file if you wish to return to the run in the future.
</p>
<h5>Note</h5>
<div>
<p>
Large runs may take a little time to remove so the run may still be present for a short time after the deletion process begins.
</p>
</div>
<h5 style="color:#d9534f">Warning</h5>
<div style="color:#d9534f">
<p>
This process cannot be undone the run will be permanently deleted.
</p>
</div>
<div class="modal-footer">
<button class="btn btn-secondary btn-icon-split" type="button" data-dismiss="modal">
<span class="icon">
<i class="fa fa-window-close"></i>
</span>
<span class="text">Cancel</span>
</button>
<button id="deletePipeRun" class="btn btn-danger btn-icon-split" type="submit">
<span class="icon">
<i class="fas fa-trash fa-sm"></i>
</span>
<span class="text">Delete Run</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Arrow pipeline modal-->
<div class="modal fade" id="arrowPipeModal" tabindex="-1" role="dialog" aria-labelledby="arrowPipeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title font-weight-bold" id="arrowPipeModalLabel">Generate Arrow Files for {{ p_run.name }}</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="arrowPipeForm" action="{% url 'vast_pipeline:api_pipe_runs-genarrow' p_run.id %}" method="post" novalidate>
{% csrf_token %}
<p>
Generate the arrow files containing the measurements and the measurement pairs.
If the arrow files are already present it is possible to overwrite these and generate new files.
The process can only be used for runs which have completed successfully.
</p>
<h5>What and Why?</h5>
<div>
<p>
<a target="_blank" href="https://arrow.apache.org/">Apache Arrow</a> is a column-based data storage format that is designed to be 'memory-mapped' which offers very fast data access.
For large pipeline runs it can be much more efficient to interact with the measurements data using the arrow format rather than the default parquet format.
If the arrow files are available then VAST Tools will automatically switch to using them.
</p>
</div>
<div class="modal-footer">
Overwrite Current Files:
<div class="btn-group btn-group-toggle mr-auto" data-toggle="buttons">
<input type="checkbox" name="arrowOverwrite" id="arrowOverwriteToggle" data-toggle="toggle" data-size="sm">
</div>
<button class="btn btn-secondary btn-icon-split" type="button" data-dismiss="modal">
<span class="icon">
<i class="fa fa-window-close"></i>
</span>
<span class="text">Cancel</span>
</button>
<button id="arrowPipeRun" class="btn btn-success btn-icon-split" type="submit">
<span class="icon">
<i class="fas fa-angle-double-right fa-sm"></i>
</span>
<span class="text">Generate Arrow Files</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>

Does not seem to affect functionality.

button.js:177 
        
       Uncaught TypeError: Cannot read properties of null (reading 'checked')
    at button.js:177:15
    at dispatch (jquery.min.js:2:43064)
    at v.handle (jquery.min.js:2:41048)

Screen Shot 2022-03-02 at 15 39 50

@ajstewart ajstewart added help wanted Extra attention is needed UI User Interface low priority Issue is not of immediate concern. labels Mar 2, 2022
@github-actions github-actions bot added this to To do in Pipeline Backlog Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed low priority Issue is not of immediate concern. UI User Interface
Projects
Development

No branches or pull requests

1 participant