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

Indicate that the list of interfaces is loading #315

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/renderer/src/stories/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export class List extends LitElement {
items: {
type: Array,
reflect: true
},
emptyMessage: {
type: String,
reflect: true
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export class GuidedStructurePage extends Page {
async updated() {
const selected = this.info.globalState.interfaces;

if (Object.keys(selected).length > 0) this.list.emptyMessage = "Loading valid interfaces...";

this.search.options = await fetch(`${baseUrl}/neuroconv`)
.then((res) => res.json())
.then((json) =>
Expand Down Expand Up @@ -106,6 +108,7 @@ export class GuidedStructurePage extends Page {
this.list.add({ ...found, key }); // Add previously selected items
}

this.addButton.removeAttribute("hidden");
super.updated(); // Call if updating data
}

Expand All @@ -114,6 +117,7 @@ export class GuidedStructurePage extends Page {
this.list.style.display = "inline-block";
this.list.clear();
this.addButton.style.display = "block";
this.addButton.setAttribute("hidden", "");

return html`
<div style="width: 100%; text-align: center;">${this.list} ${this.addButton}</div>
Expand Down