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
6 changes: 5 additions & 1 deletion apps/dashboard/app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.clickable {
cursor: pointer;
}
Expand All @@ -21,3 +20,8 @@
z-index: 1100;
background-color: inherit;
}

.rem-5 {
width: 5rem;
height: 5rem;
}
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,25 @@
<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="d-flex justify-content-center">
<div id="loading-icon" class="spinner-border rem-5" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<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