-
Notifications
You must be signed in to change notification settings - Fork 681
versions: Improve the loading indicator #10740
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| <CrateHeader @crate={{this.crate}} /> | ||
|
|
||
| <div local-class="results-meta"> | ||
| <span local-class="page-description" data-test-page-description> | ||
| <span local-class="page-description" | ||
| class="{{if (and this.loadMoreTask.isRunning (not this.sortedVersions)) 'is-empty'}}" | ||
| data-test-page-description | ||
| > | ||
| <strong>{{ this.sortedVersions.length }}</strong> of <strong>{{ this.crate.num_versions }}</strong> | ||
| <strong>{{ this.crate.name }}</strong> versions since | ||
| {{date-format this.crate.created_at 'PPP'}} | ||
|
|
@@ -16,22 +19,27 @@ | |
| </div> | ||
| </div> | ||
|
|
||
| <ul local-class="list"> | ||
| <ul local-class="list" class="{{unless this.sortedVersions 'is-empty'}}"> | ||
| {{#each this.sortedVersions as |version|}} | ||
| <li> | ||
| <VersionList::Row @version={{version}} local-class="row" data-test-version={{version.num}} /> | ||
| </li> | ||
| {{/each}} | ||
| </ul> | ||
| {{#if this.next_page}} | ||
| {{#if this.loadMoreTask.isRunning}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we also hide the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, this is regarding the initial load (like the 'is-empty' check mentioned above)? I presume this could be achieved via style="{{unless this.sortedVersions 'visibility:hidden'}}"(which could also be implemented using a CSS class and style). I don't really have a preference on this, but I think the reasoning behind it is to make it more noticeable that it's still loading and is an initial load. So, I'm okay with this. I'm also wondering if we should prevent the page loading progress (the yellow one at the top) from completing until the first versions have finished loading.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
done! |
||
| <div local-class="loading"> | ||
| <button type="button" data-test-id="loading" disabled={{this.loadMoreTask.isRunning}} | ||
| {{on "click" (perform this.loadMoreTask)}} | ||
| > | ||
| Loading...<LoadingSpinner local-class="loading-spinner" /> | ||
| </button> | ||
| </div> | ||
| {{else if this.next_page}} | ||
| <div local-class="load-more"> | ||
| <button type="button" data-test-id="load-more" disabled={{this.loadMoreTask.isRunning}} | ||
| {{on "click" (perform this.loadMoreTask)}} | ||
| > | ||
| Load More | ||
| {{#if this.loadMoreTask.isRunning}} | ||
| <LoadingSpinner local-class="loading-spinner" /> | ||
| {{/if}} | ||
| </button> | ||
| </div> | ||
| {{/if}} | ||
| {{/if}} | ||
Uh oh!
There was an error while loading. Please reload this page.