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

feat(DH): Add basiclightbox for thumbnail preview #761

Merged
merged 7 commits into from
Jan 24, 2024

Conversation

Angi-Kinas
Copy link
Collaborator

@Angi-Kinas Angi-Kinas commented Jan 11, 2024

This PR adds a thumbnail preview to the dataset details page:

image

image

Copy link
Contributor

github-actions bot commented Jan 11, 2024

Affected libs: api-metadata-converter, feature-editor, api-repository, feature-catalog, feature-record, feature-router, feature-search, feature-map, feature-dataviz, feature-auth, ui-search, ui-elements, ui-catalog, data-access-datafeeder, util-data-fetcher, common-fixtures, util-shared, ui-widgets, ui-inputs, ui-map, data-access-gn4, util-app-config, common-domain, ui-dataviz, util-i18n, ui-layout,
Affected apps: datahub, metadata-converter, metadata-editor, demo, webcomponents, map-viewer, search, datafeeder, data-platform,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

@Angi-Kinas Angi-Kinas marked this pull request as ready for review January 15, 2024 13:08
@coveralls
Copy link

coveralls commented Jan 15, 2024

Coverage Status

coverage: 83.998% (-16.0%) from 100.0%
when pulling 1ba7227 on DH-add-record-thumbnail
into 725d837 on main.

Copy link
Collaborator

@tkohr tkohr left a 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"
Copy link
Collaborator

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?

@Angi-Kinas Angi-Kinas force-pushed the DH-add-record-thumbnail branch 3 times, most recently from ffa8569 to bc62291 Compare January 17, 2024 11:46
Copy link
Collaborator

@tkohr tkohr left a 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:

lightbox

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)
Copy link
Collaborator

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.

Copy link
Collaborator

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

@Angi-Kinas Angi-Kinas force-pushed the DH-add-record-thumbnail branch from 36b47b8 to 77875c2 Compare January 23, 2024 12:59
Copy link
Collaborator

@jahow jahow left a 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!

@Angi-Kinas Angi-Kinas merged commit 177cac3 into main Jan 24, 2024
8 checks passed
@Angi-Kinas Angi-Kinas deleted the DH-add-record-thumbnail branch January 24, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants