-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(DH): Add basiclightbox for thumbnail preview #761
Conversation
Affected libs:
|
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.
Thanks for this neat feature @Angi-Kinas. I left some suggestions inline. I think it would also be nice to have a little test for this (maybe e2e?).
</gn-ui-metadata-catalog> | ||
<gn-ui-thumbnail | ||
class="relative h-full w-full" | ||
[thumbnailUrl]="(facade.metadata$ | async).overviews?.[0]?.url" |
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.
Looks like the same logic as for lightbox$
. Maybe both could be resolved with one variable (eg. thumbnailUrl
or overviewUrl
) on this level, which can then be passed to different UI components?
apps/datahub/src/app/record/record-metadata/record-metadata.component.html
Outdated
Show resolved
Hide resolved
apps/datahub/src/app/record/record-metadata/record-metadata.component.ts
Outdated
Show resolved
Hide resolved
ffa8569
to
bc62291
Compare
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.
Thanks for the refactoring and error handling @Angi-Kinas !
I'm just noticing the following problem:
My impression is that it occurs on records with CORS errors in the console (for the map for instance), not sure if this can be related.
Do you think you could also add a e2e test that checks if the overlay-preview opens and displays the image?
@@ -85,6 +88,7 @@ export class ThumbnailComponent implements OnInit, OnChanges { | |||
private setNewSrcImage(image: ThumbnailImageObject) { | |||
this.imgFit = image.fit | |||
this.imgUrl = image.url | |||
this.placeholderShown.emit(this.isPlaceholder) |
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 wondering why this is not inside setPlaceholder()
always returning true
.
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 can answer for @Angi-Kinas since we've done this together: we wanted this output to emit either true
or false
according to the state of the thumbnail, and not just emit true
when the placeholder shows up
display thumbnail if image is a placeholder
36b47b8
to
77875c2
Compare
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.
Thanks for the added tests!
This PR adds a thumbnail preview to the dataset details page: