Skip to content
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
27 changes: 14 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@dnd-kit/sortable": "8.0.0",
"@dnd-kit/utilities": "3.2.2",
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.0.0-alpha.20",
"@iqss/dataverse-client-javascript": "2.0.0-alpha.24",
"@iqss/dataverse-design-system": "*",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@tanstack/react-table": "8.9.2",
Expand Down Expand Up @@ -49,6 +49,7 @@
"react-toastify": "11.0.2",
"react-topbar-progress-indicator": "4.1.1",
"sass": "1.58.1",
"turndown": "7.2.0",
"typescript": "5.7.2",
"use-deep-compare": "1.2.1",
"vite-plugin-istanbul": "4.0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/sections/collection/CollectionInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Collection } from '../../collection/domain/models/Collection'
import TurndownService from 'turndown'
import styles from './Collection.module.scss'
import { MarkdownComponent } from '../dataset/markdown/MarkdownComponent'
import { Badge } from '@iqss/dataverse-design-system'
Expand All @@ -7,6 +8,7 @@ import { DatasetLabelSemanticMeaning } from '../../dataset/domain/models/Dataset
interface CollectionInfoProps {
collection: Collection
}
const turndownService = new TurndownService()

export function CollectionInfo({ collection }: CollectionInfoProps) {
return (
Expand All @@ -26,7 +28,7 @@ export function CollectionInfo({ collection }: CollectionInfoProps) {
</header>
{collection.description && (
<div>
<MarkdownComponent markdown={collection.description} />
<MarkdownComponent markdown={turndownService.turndown(collection.description)} />
</div>
)}
</>
Expand Down
5 changes: 3 additions & 2 deletions tests/component/sections/collection/CollectionInfo.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ describe('CollectionInfo', () => {
name: 'Collection Name',
affiliation: 'Affiliation',
isReleased: true,
description: 'Here is a description with [a link](https://dataverse.org)'
description: 'Here is a <b>description</b> with <a href="https://dataverse.org">a link</a>'
})
cy.customMount(<CollectionInfo collection={collection} />)

cy.findByRole('heading', { name: 'Collection Name' }).should('exist')
cy.findByText('(Affiliation)').should('exist')
cy.findByText(/Here is a description with/).should('exist')
cy.findByText(/Here is a/).should('exist')
cy.findByRole('link', { name: 'a link' }).should('exist')
cy.get('strong').contains('description').should('exist')
cy.findByText('Unpublished').should('not.exist')
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ describe('File JSDataverse Repository', () => {
dataset.persistentId,
dataset.version,
new FilePaginationInfo(),
new FileCriteria().withFilterByType('text/tab-separated-values')
new FileCriteria().withFilterByType('text/plain')
)
.then((files) => {
expect(files.length).to.equal(1)
expect(files.length).to.equal(2)
})
})

Expand Down