Skip to content

Commit

Permalink
fix: add collectionRepository prop to stories
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Oct 10, 2024
1 parent 2105f58 commit 0ef3618
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/stories/dataset/Dataset.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { WithDeaccessionedDataset } from './WithDeaccessionedDataset'
import { WithNotImplementedModal } from '../WithNotImplementedModal'
import { MetadataBlockInfoMockRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockRepository'
import { DatasetMockRepository } from './DatasetMockRepository'
import { CollectionMockRepository } from '@/stories/collection/CollectionMockRepository'

const meta: Meta<typeof Dataset> = {
title: 'Pages/Dataset',
Expand All @@ -35,6 +36,7 @@ export const Default: Story = {
decorators: [WithLayout, WithDataset, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -46,6 +48,7 @@ export const WithNormalPagination: Story = {
decorators: [WithLayout, WithDataset, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -57,6 +60,7 @@ export const Created: Story = {
decorators: [WithLayout, WithDatasetDraftAsOwner, WithLoggedInUser, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -70,6 +74,7 @@ export const MetadataUpdated: Story = {
decorators: [WithLayout, WithDatasetDraftAsOwner, WithLoggedInUser, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -81,6 +86,7 @@ export const DraftWithAllDatasetPermissions: Story = {
decorators: [WithLayout, WithDatasetDraftAsOwner, WithLoggedInUser, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -92,6 +98,7 @@ export const Deaccessioned: Story = {
decorators: [WithLayout, WithDeaccessionedDataset, WithLoggedInUser],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -103,6 +110,7 @@ export const LoggedInAsOwner: Story = {
decorators: [WithDataset, WithLayout, WithLoggedInUser, WithNotImplementedModal],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -115,6 +123,7 @@ export const Loading: Story = {
decorators: [WithLayout, WithDatasetLoading],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -127,6 +136,7 @@ export const DatasetNotFound: Story = {
decorators: [WithLayout, WithDatasetNotFound],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -139,6 +149,7 @@ export const DatasetAnonymizedView: Story = {
decorators: [WithLayout, WithAnonymizedView, WithDatasetPrivateUrl],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand All @@ -151,6 +162,7 @@ export const DatasetWithNoFiles: Story = {
decorators: [WithLayout, WithAnonymizedView, WithDataset],
render: () => (
<Dataset
collectionRepository={new CollectionMockRepository()}
datasetRepository={new DatasetMockRepository()}
fileRepository={new FileMockNoDataRepository()}
metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '../../../../tests/component/dataset/domain/models/DatasetMother'
import { WithLoggedInUser } from '../../WithLoggedInUser'
import { DatasetMockRepository } from '../DatasetMockRepository'
import { CollectionMockRepository } from '@/stories/collection/CollectionMockRepository'

const meta: Meta<typeof DatasetActionButtons> = {
title: 'Sections/Dataset Page/DatasetActionButtons',
Expand Down Expand Up @@ -39,6 +40,7 @@ export const WithPublishPermissions: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}
Expand All @@ -57,6 +59,7 @@ export const WithNoDatasetPermissions: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}
Expand All @@ -79,6 +82,7 @@ export const WithUpdateAndNoPublishDatasetPermissions: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { PublishDatasetMenu } from '../../../../sections/dataset/dataset-action-buttons/publish-dataset-menu/PublishDatasetMenu'
import { WithLoggedInUser } from '../../../WithLoggedInUser'
import { DatasetMockRepository } from '../../DatasetMockRepository'
import { CollectionMockRepository } from '@/stories/collection/CollectionMockRepository'

const meta: Meta<typeof PublishDatasetMenu> = {
title: 'Sections/Dataset Page/DatasetActionButtons/PublishDatasetMenu',
Expand All @@ -34,6 +35,7 @@ export const PublishingAllowed: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}
Expand All @@ -49,6 +51,7 @@ export const NoValidTermsOfAccess: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}
Expand All @@ -64,6 +67,7 @@ export const DatasetInReview: Story = {
isValid: true
})}
datasetRepository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
/>
)
}

0 comments on commit 0ef3618

Please sign in to comment.