Skip to content

Commit

Permalink
feat(dh): redesign abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jan 22, 2024
1 parent 9ae0a68 commit 9c05f94
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 70 deletions.
37 changes: 0 additions & 37 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,6 @@ describe('dataset pages', () => {
expect(text).not.to.equal('')
})
})
it('should display the keywords', () => {
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.find('gn-ui-content-ghost')
.find('gn-ui-max-lines')
.children('div')
.children('div')
.children('div')
.children('gn-ui-badge')
.should('have.length.gt', 0)
})
it('should display the lineage and usage tabs', () => {
cy.get('datahub-record-metadata')
.find('[id="about"]')
Expand Down Expand Up @@ -177,31 +165,6 @@ describe('dataset pages', () => {
cy.get('[data-cy="organization-name"]').click()
cy.url().should('include', '/search?publisher=')
})
it('should go to dataset search page when clicking on keyword and filter by keyword', () => {
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.find('gn-ui-content-ghost')
.find('gn-ui-max-lines')
.children('div')
.contains('Read more')
.click()

cy.get('datahub-record-metadata')
.find('gn-ui-badge')
.children('div')
.first()
.as('keyword')

cy.get('@keyword').then((key) => {
keyword = key.text().toUpperCase()
cy.get('@keyword').first().click()
cy.url().should('include', '/search?q=')
cy.get('gn-ui-fuzzy-search')
.find('input')
.should('have.value', keyword)
})
})
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
class="sm:block"
[metadata]="facade.metadata$ | async"
[incomplete]="facade.isIncomplete$ | async"
(keyword)="onInfoKeywordClick($event)"
>
</gn-ui-metadata-info>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
<p
class="text-[28px] text-title text-center mb-6 font-title sm:text-left"
translate
>
record.metadata.about
</p>
<div class="mb-6 md-description sm:mb-4 sm:pr-16">
<gn-ui-content-ghost ghostClass="h-32" [showContent]="fieldReady('abstract')">
<gn-ui-max-lines [maxLines]="6" *ngIf="metadata.abstract">
<div>
<gn-ui-markdown-parser
[textContent]="metadata.abstract"
></gn-ui-markdown-parser>
<ng-container *ngIf="metadata.keywords?.length">
<p class="mb-3 font-medium text-primary text-sm" translate>
record.metadata.keywords
</p>
<div class="sm:pb-4 sm:pr-16">
<gn-ui-badge
class="inline-block mr-2 mb-2 lowercase"
(click)="onKeywordClick(keyword)"
[clickable]="true"
*ngFor="let keyword of metadata.keywords"
>{{ keyword }}</gn-ui-badge
>
</div>
</ng-container>
</div>
</gn-ui-max-lines>
</gn-ui-content-ghost>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ describe('MetadataInfoComponent', () => {
const displayedElement = fixture.nativeElement.querySelector('.noUsage')
expect(displayedElement).toBeFalsy()
})
it('should display the keywords section', () => {
// Use waitForAsync to handle asynchronous changes in the DOM.
fixture.whenStable().then(() => {
const displayedElement =
fixture.nativeElement.querySelector('ng-container')
expect(displayedElement).toBeTruthy()
})
})
it('should display the abstract section', () => {
const displayedElement =
fixture.nativeElement.querySelector('.md-description p')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,4 @@ export class MetadataInfoComponent {
fieldReady(propName: string) {
return !this.incomplete || propName in this.metadata
}

onKeywordClick(keyword: string) {
this.keyword.emit(keyword)
}
}

0 comments on commit 9c05f94

Please sign in to comment.