Skip to content

Commit

Permalink
Merge pull request #315 from NeurodataWithoutBorders/improve-list-ren…
Browse files Browse the repository at this point in the history
…dering-for-structure

Indicate that the list of interfaces is loading
  • Loading branch information
CodyCBakerPhD authored Aug 23, 2023
2 parents 50e317d + 8dc9bf5 commit 08c0226
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit 08c0226

Please sign in to comment.