Skip to content

Commit

Permalink
Switch to a modal dialog for showing the job results.
Browse files Browse the repository at this point in the history
Also use a list group instead of a native list for the lines of the job
result.
  • Loading branch information
drgrice1 committed Nov 30, 2023
1 parent cd7a684 commit b73d7d0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
9 changes: 0 additions & 9 deletions htdocs/js/JobManager/jobmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,4 @@
filter_select.addEventListener('change', toggle_filter_elements);
toggle_filter_elements();
}

// Activate the results popovers.
document.querySelectorAll('.result-popover-btn').forEach((popoverBtn) => {
new bootstrap.Popover(popoverBtn, {
trigger: 'hover focus',
customClass: 'job-queue-result-popover',
html: true
});
});
})();
8 changes: 0 additions & 8 deletions htdocs/js/JobManager/jobmanager.scss

This file was deleted.

46 changes: 28 additions & 18 deletions templates/ContentGenerator/Instructor/JobManager.html.ep
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
% use WeBWorK::Utils qw(getAssetURL);
%
% content_for css => begin
<%= stylesheet getAssetURL($ce, 'js/JobManager/jobmanager.css') =%>
% end
%
% content_for js => begin
<%= javascript getAssetURL($ce, 'js/ActionTabs/actiontabs.js'), defer => undef =%>
<%= javascript getAssetURL($ce, 'js/SelectAll/selectall.js'), defer => undef =%>
Expand Down Expand Up @@ -187,25 +183,39 @@
<div class="d-flex justify-content-between gap-1">
<%= maketext($jobs->{$jobID}{state}) =%>
% if (defined $jobs->{$jobID}{result}) {
% content_for "result_$jobID", begin
% if (ref($jobs->{$jobID}{result}) eq 'ARRAY') {
<ul class="m-0">
% for (@{ $jobs->{$jobID}{result} } ) {
<li><%= $_ %></li>
% }
</ul>
% } else {
<%= $jobs->{$jobID}{result} =%>
% }
% end
<a role="button" class="result-popover-btn" tabindex="0" data-bs-toggle="popover"
data-bs-title="<%= maketext('Result for job [_1]', $jobID) %>"
data-bs-content="<%= content("result_$jobID")->xml_escape %>">
<a role="button" class="result-btn" tabindex="0" data-bs-toggle="modal" href="#"
data-bs-target="<%= "#result-$jobID" %>">
<i class="fa-solid fa-circle-info fa-xl" aria-hidden="true"></i>
<span class="visually-hidden">
<%= maketext('Result for job [_1]', $jobID) %>
</span>
</a>
<div class="result-modal modal fade" id="<%= "result-$jobID" %>" tabindex="-1"
aria-labelledby="<%= "result-$jobID-label" %>" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="<%= "result-$jobID-label" %>">
<%= maketext('Result for job [_1]', $jobID) %>
</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="<%= maketext("Close") %>">
</button>
</div>
<div class="modal-body">
% if (ref($jobs->{$jobID}{result}) eq 'ARRAY') {
<ul class="list-group list-group-flush">
% for (@{ $jobs->{$jobID}{result} } ) {
<li class="list-group-item py-1"><%= $_ %></li>
% }
</ul>
% } else {
<%= $jobs->{$jobID}{result} =%>
% }
</div>
</div>
</div>
</div>
% }
</div>
</td>
Expand Down
3 changes: 2 additions & 1 deletion templates/HelpFiles/InstructorJobManager.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
. 'executed. If a job is "finished" it means that the execution of the job has successfully '
. 'completed. If a job is "failed" it means that the execution of job has completed, but there were '
. 'errors in the execution of the job. If the job is in the "finished" or "failed" state, then there '
. 'will also be a popover containing information about what happened when the job was executed.') =%>
. 'will also be a button which when clicked will show a dialog containing information about what happened '
. 'when the job was executed.') =%>
</dd>
</dl>
%
Expand Down

0 comments on commit b73d7d0

Please sign in to comment.