Skip to content

Commit

Permalink
fix: type safety errors, JSDatasetMapper.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Oct 21, 2023
1 parent e340b06 commit 619bdf0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ const expectedDatasetAlternateVersion = {
dynamicFields: undefined
},
{
message: 'requestedVersionNotFound',
variant: 'info',
dynamicFields: { requestedVersion: '4.0', returnedVersion: '0.0' }
message: 'requestedVersionNotFoundShowDraft',
variant: 'warning',
dynamicFields: { requestedVersion: '4.0' }
}
],
summaryFields: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,18 @@ function removeMarkup(htmlString: string): string {
return htmlString.replace(/<\/?[^>]+(>|$)/g, '')
}

interface AlertTranslation {
heading: string
alertText: string
}

interface DatasetTranslation {
alerts: {
draftVersion: {
heading: string
alertText: string
}
requestedVersionNotFound: {
heading: string
alertText: string
}
unpublishedDataset: {
heading: string
alertText: string
}
shareUnpublishedDataset: {
heading: string
alertText: string
}
[DatasetAlertMessageKey.DRAFT_VERSION]: AlertTranslation
[DatasetAlertMessageKey.REQUESTED_VERSION_NOT_FOUND]: AlertTranslation
[DatasetAlertMessageKey.REQUESTED_VERSION_NOT_FOUND_SHOW_DRAFT]: AlertTranslation
[DatasetAlertMessageKey.UNPUBLISHED_DATASET]: AlertTranslation
[DatasetAlertMessageKey.SHARE_UNPUBLISHED_DATASET]: AlertTranslation
}
}

Expand Down

0 comments on commit 619bdf0

Please sign in to comment.