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

[Datahub] [Redesign] Thumbail preview #779

Merged
merged 6 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,32 @@ describe('dataset pages', () => {
.should('have.value', keyword)
})
})
it('should open the lightbox', () => {
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-thumbnail')
.first()
.next()
.find('gn-ui-button')
.click()
cy.get('.basicLightbox--visible')
})
})

describe('metadata quality widget enabled', () => {
beforeEach(() => {
// this will enable metadata quality widget
cy.intercept('GET', '/assets/configuration/default.toml', {
fixture: 'config-with-metadata-quality.toml',
})
cy.reload()
})

it('should display quality widget', () => {
cy.get('gn-ui-metadata-quality gn-ui-progress-bar')
.eq(0)
.should('have.attr', 'ng-reflect-value', 75)
})
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@
>
</gn-ui-metadata-info>
</div>
<div>
<div class="-mt-44">
<gn-ui-image-overlay-preview
[imageUrl]="thumbnailUrl$ | async"
(isPlaceholderShown)="showOverlay = !$event"
*ngIf="showOverlay"
>
</gn-ui-image-overlay-preview>
<gn-ui-metadata-contact
(organizationClick)="onOrganizationClick($event)"
[metadata]="facade.metadata$ | async"
>
</gn-ui-metadata-contact>
<div *ngIf="metadataQualityDisplay">
<p class="text text-gray-700 text-xs mb-3 uppercase" translate>
record.metadata.quality
Expand All @@ -33,21 +44,8 @@
[metadataQualityDisplay]="metadataQualityDisplay"
></gn-ui-metadata-quality>
</div>
<gn-ui-image-overlay-preview
[imageUrl]="thumbnailUrl$ | async"
(isPlaceholderShown)="showOverlay = !$event"
*ngIf="showOverlay"
>
</gn-ui-image-overlay-preview>
<div>
<gn-ui-metadata-contact
(organizationClick)="onOrganizationClick($event)"
[metadata]="facade.metadata$ | async"
>
</gn-ui-metadata-contact>
<gn-ui-metadata-catalog [sourceLabel]="sourceLabel$ | async">
</gn-ui-metadata-catalog>
</div>
<gn-ui-metadata-catalog [sourceLabel]="sourceLabel$ | async">
</gn-ui-metadata-catalog>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<gn-ui-content-ghost
[showContent]="imageUrl !== undefined"
ghostClass="h-36 mb-3"
ghostClass="h-48 mb-3"
>
<div
*ngIf="imageUrl"
[showContent]="imageUrl !== undefined"
data-cy="record-thumbnail"
class="flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden w-full border border-gray-300 h-36 group-hover:shadow-xl group-hover:border-0 mb-3"
class="flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden w-full border border-gray-300 group-hover:shadow-xl group-hover:border-0 h-48 mb-3"
>
<gn-ui-thumbnail
class="relative h-full w-full"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="py-5 px-5 rounded bg-gray-100 text-black mb-6 sm:mb-12">
<div class="py-5 px-5 rounded bg-gray-100 text-black mb-6">
<div class="grid gap-3">
<div>
<p class="text-sm font-medium" translate>record.metadata.contact</p>
Expand Down
Loading