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

Adds loading icon to path selector UI on table refresh #3144

Merged
merged 9 commits into from
Oct 31, 2023
3 changes: 3 additions & 0 deletions apps/dashboard/app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#loading-icon {
text-align: center;
}
johrstrom marked this conversation as resolved.
Show resolved Hide resolved

.clickable {
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,20 @@ export class PathSelectorTable {

async reloadTable(url) {
try {
$(`#${this.tableId}_wrapper`).hide();
$('#loading-icon').show();
const response = await fetch(url, { headers: { 'Accept': 'application/json' }, cache: 'no-store' });
const data = await this.dataFromJsonResponse(response);
$(`#${this.breadcrumbId}`).html(data.path_selector_breadcrumbs_html);
this._table.clear();
this._table.rows.add(data.files);
this._table.draw();
this.setLastVisited(data.path);
this._table.draw();
$('#loading-icon').hide();
$(`#${this.tableId}_wrapper`).show();
} catch (err) {
$('#loading-icon').hide();
$(`#${this.tableId}_wrapper`).show();
console.log(err);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,23 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="modal-body">
<div>
<ol id="<%= breadcrumb_id %>" class="breadcrumb breadcrumb-no-delimiter">
</ol>
<table class="table table-hover table-condensed d-table w-100" id="<%= table_id %>">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<ol id="<%= breadcrumb_id %>" class="breadcrumb breadcrumb-no-delimiter">
</ol>
<div class="spinner-border" role="status" id="loading-icon">
<span class="sr-only">Loading...</span>
</div>
johrstrom marked this conversation as resolved.
Show resolved Hide resolved
<table class="table table-hover table-condensed d-table w-100" id="<%= table_id %>">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="modal-footer sticky-footer">
Expand Down