-
Notifications
You must be signed in to change notification settings - Fork 1
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
Demo: add placeholder views #337
base: main
Are you sure you want to change the base?
Conversation
- this breaks View when dynamically toggling sort bar on an already loaded collection browser
|
*/ | ||
if (!model && !this.isScrollingToCell) { | ||
if (!this.placeholderType && !model && !this.isScrollingToCell) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this block fires even though we render the placeholder. this reduces fetch checks since we request details for each result...
… on empty base query
@@ -489,6 +538,50 @@ export class AppRoot extends LitElement { | |||
} | |||
} | |||
|
|||
private async showEmptyPlaceholder(placeholderType: string) { | |||
switch (placeholderType) { | |||
case 'empty query': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we are on demo for developers but we should not use string slugs for checking conditions. I would write these something like empty-query
, empty-collection
, empty-profile
something like this.
const pageNumber = Math.floor(offsetIndex / this.pageSize) + 1; | ||
console.warn('****** FETCH PAGE tileModelAtCellIndex', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please our custom log() function to render logs messages for development purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I can remove these, actually once we get stable work on offshoot 👍
@@ -995,7 +1002,15 @@ export class CollectionBrowser | |||
this.restoreState(); | |||
} | |||
|
|||
willUpdate() { | |||
this.setPlaceholderType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, when willUpdate()
function executes? (still learning)
this.baseQuery, | ||
JSON.stringify(this.selectedFacets) | ||
); | ||
console.log('CB will reset', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add our log()
util function here.
f0b9733
to
e46fed6
Compare
12f72f6
to
2b23159
Compare
setPlaceholder
call out of lifecycle since it is an anti-patternwillUpdate
lifecycle - as a render cycle will be called & any state set there will not re-trigger loadTesting: https://internetarchive.github.io/iaux-collection-browser/pr/pr-337
👍