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] Fix read more button #934

Merged
merged 2 commits into from
Jul 4, 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
10 changes: 10 additions & 0 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ describe('dataset pages', () => {
expect(text).not.to.equal('')
})
})
it('should display the read more button and expand description', () => {
cy.visit('/dataset/01491630-78ce-49f3-b479-4b30dabc4c69')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-max-lines')
.as('maxLines')
cy.get('@maxLines').find('.ease-out').should('exist')
cy.get('[data-cy=readMoreButton]').click()
cy.get('@maxLines').find('.ease-in').should('exist')
})
it('should display the thumbnail image and magnify', () => {
cy.get('datahub-record-metadata')
.find('[id="about"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
<div
*ngIf="metadata"
class="font-title text-[28px] max-w-screen-sm line-clamp-4 ml-4"
class="font-title text-[28px] max-w-screen-sm line-clamp-3 ml-4"
[style.color]="foregroundColor"
>
{{ metadata.title }}
Expand Down
3 changes: 2 additions & 1 deletion libs/ui/elements/src/lib/ui-elements.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DownloadItemComponent } from './download-item/download-item.component'
import { DownloadsListComponent } from './downloads-list/downloads-list.component'
import { ApiCardComponent } from './api-card/api-card.component'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import { UiLayoutModule } from '@geonetwork-ui/ui/layout'
import { MaxLinesComponent, UiLayoutModule } from '@geonetwork-ui/ui/layout'
import { TranslateModule } from '@ngx-translate/core'
import { RelatedRecordCardComponent } from './related-record-card/related-record-card.component'
import { MetadataContactComponent } from './metadata-contact/metadata-contact.component'
Expand Down Expand Up @@ -49,6 +49,7 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
ThumbnailComponent,
TimeSincePipe,
BadgeComponent,
MaxLinesComponent,
],
declarations: [
MetadataInfoComponent,
Expand Down
1 change: 1 addition & 0 deletions libs/ui/layout/src/lib/max-lines/max-lines.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*ngIf="showToggleButton"
(click)="toggleDisplay()"
class="text-secondary cursor-pointer pt-2.5"
data-cy="readMoreButton"
>
{{ (isExpanded ? 'ui.readLess' : 'ui.readMore') | translate }}
</div>
Loading