From c49764d92afc3af9f37516cd51d6d1728a0cce43 Mon Sep 17 00:00:00 2001 From: Ellen Kraffmiller Date: Sat, 29 Jun 2024 10:24:59 -0400 Subject: [PATCH] undo change to DatasetCardHeader.tsx --- .../dataset-card/DatasetCardHeader.tsx | 15 +++------------ .../dataset-card/DatasetCardHeader.spec.tsx | 4 ++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/sections/collection/datasets-list/dataset-card/DatasetCardHeader.tsx b/src/sections/collection/datasets-list/dataset-card/DatasetCardHeader.tsx index 154c805d2..0cadea711 100644 --- a/src/sections/collection/datasets-list/dataset-card/DatasetCardHeader.tsx +++ b/src/sections/collection/datasets-list/dataset-card/DatasetCardHeader.tsx @@ -3,27 +3,18 @@ import { LinkToPage } from '../../../shared/link-to-page/LinkToPage' import { Route } from '../../../Route.enum' import { DatasetLabels } from '../../../dataset/dataset-labels/DatasetLabels' import { DatasetIcon } from '../../../dataset/dataset-icon/DatasetIcon' -import { DatasetPublishingStatus, DatasetVersion } from '../../../../dataset/domain/models/Dataset' +import { DatasetVersion } from '../../../../dataset/domain/models/Dataset' interface DatasetCardHeaderProps { persistentId: string version: DatasetVersion } -function getVersionSearchParam(version: DatasetVersion): string { - return version.publishingStatus == DatasetPublishingStatus.DRAFT - ? 'DRAFT' - : version.number.toString() -} + export function DatasetCardHeader({ persistentId, version }: DatasetCardHeaderProps) { return (
- + {version.title} diff --git a/tests/component/sections/collection/datasets-list/dataset-card/DatasetCardHeader.spec.tsx b/tests/component/sections/collection/datasets-list/dataset-card/DatasetCardHeader.spec.tsx index cff37a2db..4f1dba840 100644 --- a/tests/component/sections/collection/datasets-list/dataset-card/DatasetCardHeader.spec.tsx +++ b/tests/component/sections/collection/datasets-list/dataset-card/DatasetCardHeader.spec.tsx @@ -11,7 +11,7 @@ describe('DatasetCardHeader', () => { cy.findByText(dataset.version.title) .should('exist') - .should('have.attr', 'href', `/datasets?persistentId=${dataset.persistentId}&version=1.0`) + .should('have.attr', 'href', `/datasets?persistentId=${dataset.persistentId}`) dataset.version.labels.forEach((label) => { cy.findByText(label.value).should('exist') }) @@ -25,6 +25,6 @@ describe('DatasetCardHeader', () => { cy.findByText(dataset.version.title) .should('exist') - .should('have.attr', 'href', `/datasets?persistentId=${dataset.persistentId}&version=DRAFT`) + .should('have.attr', 'href', `/datasets?persistentId=${dataset.persistentId}`) }) })