Skip to content

Commit

Permalink
feat(DH): Differentiate thumbnailUrl for content ghost
Browse files Browse the repository at this point in the history
  • Loading branch information
Angi-Kinas committed Jan 23, 2024
1 parent 1c5f626 commit 77875c2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ export class RecordMetadataComponent {

thumbnailUrl$ = this.facade.metadata$.pipe(
map((metadata) => {
return metadata?.overviews?.[0]?.url
// in order to differentiate between metadata not loaded yet
// and url not defined
// the content-ghost of image-overlay-preview relies on this differentiation
if (metadata?.overviews === undefined) {
return undefined
} else {
return metadata?.overviews?.[0]?.url ?? null
}
})
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class Gn4MetadataMapper extends MetadataBaseMapper<Gn4Record> {
useLimitations: [],
spatialExtents: [],
temporalExtents: [],
overviews: [],
}
const record: CatalogRecord = Object.keys(_source).reduce(
(prev, fieldName) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="h-52 bg-gray-100">
<gn-ui-thumbnail
class="h-52 w-full object-cover"
[thumbnailUrl]="record.overviews?.[0].url.toString()"
[thumbnailUrl]="record.overviews?.[0]?.url.toString()"
></gn-ui-thumbnail>
</div>
<div class="flex flex-col justify-between h-44 px-5 pt-4 pb-6">
Expand Down

0 comments on commit 77875c2

Please sign in to comment.