From 7e465e9a49aca9ca8e720248ed88e2ed8fa071ea Mon Sep 17 00:00:00 2001 From: HazelGrant Date: Mon, 30 Oct 2023 12:00:18 -0400 Subject: [PATCH 1/9] Adds loading icon to path selector UI on table refresh --- .../app/assets/stylesheets/common.scss | 3 ++ .../path_selector/path_selector_data_table.js | 4 ++- .../session_contexts/_path_selector.html.erb | 29 ++++++++++--------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/apps/dashboard/app/assets/stylesheets/common.scss b/apps/dashboard/app/assets/stylesheets/common.scss index 7c7138f373..5a83201b73 100644 --- a/apps/dashboard/app/assets/stylesheets/common.scss +++ b/apps/dashboard/app/assets/stylesheets/common.scss @@ -1,3 +1,6 @@ +#loading-icon { + text-align: center; +} .clickable { cursor: pointer; diff --git a/apps/dashboard/app/javascript/path_selector/path_selector_data_table.js b/apps/dashboard/app/javascript/path_selector/path_selector_data_table.js index 39eabe8855..303e8859a5 100644 --- a/apps/dashboard/app/javascript/path_selector/path_selector_data_table.js +++ b/apps/dashboard/app/javascript/path_selector/path_selector_data_table.js @@ -83,6 +83,7 @@ export class PathSelectorTable { async reloadTable(url) { try { + $('#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); @@ -90,6 +91,7 @@ export class PathSelectorTable { this._table.rows.add(data.files); this._table.draw(); this.setLastVisited(data.path); + $('#loading-icon').hide(); } catch (err) { console.log(err); } @@ -141,7 +143,7 @@ export class PathSelectorTable { // note that this is storing the file system path, not the path of the URL // i.e., '/home/annie' not '/pun/sys/dashboard/files/fs/home/annie' getLastVisited() { - const lastVisited = localStorage.getItem(this.storageKey()); + const lastVisited = null; // localStorage.getItem(this.storageKey()); if(lastVisited === null) { return this.initialDirectory; } else { diff --git a/apps/dashboard/app/views/batch_connect/session_contexts/_path_selector.html.erb b/apps/dashboard/app/views/batch_connect/session_contexts/_path_selector.html.erb index a8b0c46845..db7d80c947 100644 --- a/apps/dashboard/app/views/batch_connect/session_contexts/_path_selector.html.erb +++ b/apps/dashboard/app/views/batch_connect/session_contexts/_path_selector.html.erb @@ -39,20 +39,23 @@ -