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

356 publish dataset #423

Merged
merged 106 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 100 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
714ade7
feat: add publish() to DatasetRepository
ekraffmiller Jun 11, 2024
cce7ec8
feat: basic version of PublishDatasetModal
ekraffmiller Jun 12, 2024
aac3f9f
feat: add PublishDatasetModal.stories.tsx
ekraffmiller Jun 12, 2024
3795f0a
Connect PublishDatasetModal.tsx to PublishDatasetMenu.tsx
ekraffmiller Jun 17, 2024
735dba9
Fix: use DRAFT version DatasetCardHeader search param, if it exists
ekraffmiller Jun 17, 2024
e658983
fix: add version param to DatasetCardHeader.spec.tsx
ekraffmiller Jun 17, 2024
cd07b34
update component test for DatasetCardHeader.spec.tsx
ekraffmiller Jun 17, 2024
abaeecb
feat: add getDatasetLocks() useCase
ekraffmiller Jun 24, 2024
2879655
Dataset.tsx: add hook for setting PublishInProgress message
ekraffmiller Jun 24, 2024
674772a
fix: remove console.log() add new function to DatasetMockRepository.ts
ekraffmiller Jun 24, 2024
5b8a0d0
Set PublishInProgress alert (need to fix refresh issue)
ekraffmiller Jun 25, 2024
8310cf1
Dataset.tsx: separate logic into two hooks
ekraffmiller Jun 25, 2024
0e6f346
Dataset.tsx: make polling async
ekraffmiller Jun 25, 2024
1705e49
Dataset.tsx - make publishInProgress a param, create a custom hook fo…
ekraffmiller Jun 25, 2024
064c2c8
fix: lint errors and warnings
ekraffmiller Jun 25, 2024
c74a05a
fix: add publish() and getLocks() DatasetErrorMockRepository.ts
ekraffmiller Jun 25, 2024
d7415df
test: deploy to beta
ekraffmiller Jun 25, 2024
dacde47
fix Dataset.stories.tsx: add datasetRepository prop
ekraffmiller Jun 25, 2024
77f2aed
fix DatasetActionButtons.stories.tsx: add datasetRepository prop
ekraffmiller Jun 25, 2024
d030a59
fix PublishDatasetMenu.stories.tsx: add datasetRepository prop
ekraffmiller Jun 25, 2024
6c59105
usePollDatasetLocks.ts: check locks before setting interval
ekraffmiller Jun 25, 2024
34eb5a4
feat: add Radio Group to design system
ekraffmiller Jun 26, 2024
1724772
test: add Radio Group to component test
ekraffmiller Jun 26, 2024
bec57db
PublishDatasetModal.tsx: add Radio Buttons for VersionUpdateType
ekraffmiller Jun 26, 2024
afd9892
usePollDatasetLocks.ts: clear interval when component unmounts
ekraffmiller Jun 27, 2024
97f7f84
PublishDatasetModal.tsx: add logic to show Update Current only if use…
ekraffmiller Jun 27, 2024
4cd4344
add logic for logged in as superUser and releasedVersionExists
ekraffmiller Jun 28, 2024
9a28bfe
add PublishDatasetHelpText.tsx
ekraffmiller Jun 28, 2024
110b9a6
add CC0 link to help text
ekraffmiller Jun 28, 2024
d981dcd
add more styles and text to PublishDatasetHelpText.tsx
ekraffmiller Jun 28, 2024
c49764d
undo change to DatasetCardHeader.tsx
ekraffmiller Jun 29, 2024
2cf0955
fix: lint errors
ekraffmiller Jun 29, 2024
7a7325b
fix: add publicationDate to test Dataset
ekraffmiller Jun 29, 2024
f18a57f
usePollDatasetLocks.ts: remove Alert when navigating to published dat…
ekraffmiller Jun 29, 2024
80b432b
PublishDatasetModal.tsx: set versionUpdateType to MAJOR by default
ekraffmiller Jun 29, 2024
38414d6
Dataset.stories.tsx: add createdParam to Created story
ekraffmiller Jun 29, 2024
23fad9a
Dataset.spec.tsx: add datasetMockRepository prop
ekraffmiller Jun 29, 2024
a0b155c
Revert changes to DatasetAlerts.tsx
ekraffmiller Jun 29, 2024
df0b957
Revert changes to DatasetAlerts.tsx
ekraffmiller Jun 30, 2024
4318698
remove Draft alert after publishing
ekraffmiller Jun 30, 2024
a7802ac
revert changes to deploy-beta-testing.yml
ekraffmiller Jun 30, 2024
b83158b
merge latest from develop
ekraffmiller Jun 30, 2024
d34c106
fix import statement
ekraffmiller Jun 30, 2024
140488b
fix Dataset.stories.tsx
ekraffmiller Jun 30, 2024
49382be
update AlertProvider.tsx to avoid race conditions
ekraffmiller Jul 1, 2024
9a2194b
revert JSDatasetVersionMapper.ts assignment for someDatasetVersionHas…
ekraffmiller Jul 1, 2024
ebd9dfd
move logic from Dataset.tsx to usePollDatasetLocks.ts
ekraffmiller Jul 1, 2024
03a9cf1
fix:functional update in AlertProvider.tsx addDatasetAlert()
ekraffmiller Jul 1, 2024
b9ccab8
fix:expected data for userRepository.getAuthenticated()
ekraffmiller Jul 1, 2024
5918c3c
fix:usePollDatasetLocks.ts remove DraftAlert when navigating to publi…
ekraffmiller Jul 1, 2024
935bf8e
fix: AlertContext.ts make setDatasetAlerts required
ekraffmiller Jul 2, 2024
68ed323
test: useCheckPublishCompleted.spec.ts with renderHook()
ekraffmiller Jul 2, 2024
4bfc82e
add default license to DatasetDTO in DatasetDTOMapper.ts
ekraffmiller Jul 2, 2024
537bbe4
remove console.log
ekraffmiller Jul 2, 2024
7dbf419
Dataset.tsx: update datasetAlerts logic
ekraffmiller Jul 2, 2024
2590d08
PublishDatasetModal.tsx: add License
ekraffmiller Jul 2, 2024
b1892ca
JSDatasetVersionMapper.ts - check for publicationDate in toSomeDatase…
ekraffmiller Jul 2, 2024
ce527a7
add more test coverage to useCheckPublishCompleted.ts
ekraffmiller Jul 8, 2024
8424acd
fix lint error
ekraffmiller Jul 8, 2024
de12bfb
add e2e test for publish dataset to Dataset.spec.tsx
ekraffmiller Jul 8, 2024
1cf2dd5
clean up debug code
ekraffmiller Jul 8, 2024
28a1ff0
clean up publicationDate mapping logic
ekraffmiller Jul 8, 2024
89f039f
clean up publicationDate mapping logic
ekraffmiller Jul 8, 2024
f7e9e1f
add defaultLicense to Create Dataset use case
ekraffmiller Jul 8, 2024
2ca38f3
fix lint error
ekraffmiller Jul 9, 2024
d3aac21
add test coverage for Dataset.tsx
ekraffmiller Jul 10, 2024
c91082d
add missing parameter to Dataset component
ekraffmiller Jul 10, 2024
3ee88ca
fix lint error
ekraffmiller Jul 10, 2024
587675c
prettier formatting
ekraffmiller Jul 10, 2024
aebccd8
resolve merge conflicts from develop
ekraffmiller Jul 15, 2024
deceb1a
fix: add getLocks datasetRepository stub
ekraffmiller Jul 15, 2024
eb398b5
fix: add datasetRepository param to story
ekraffmiller Jul 15, 2024
6233b52
fix: prettier format
ekraffmiller Jul 15, 2024
a75f348
remove cloning from FormRadioGroup.tsx, update CHANGELOG.md
ekraffmiller Jul 15, 2024
cf777fa
Dataset.tsx: update logic in useEffect()
ekraffmiller Jul 16, 2024
50f1d47
DatasetAlerts.tsx: fix dependencies
ekraffmiller Jul 16, 2024
8e5d286
PublishDatasetHelpText.module.scss: fix white space
ekraffmiller Jul 16, 2024
43a02ff
PublishDatasetHelpText.tsx: fix import order
ekraffmiller Jul 16, 2024
020ddb2
PublishDatasetMenu.tsx: fix import order
ekraffmiller Jul 16, 2024
7b97d99
move translations to dataset.json
ekraffmiller Jul 16, 2024
3fef2d5
add constant for dataset locks polling interval
ekraffmiller Jul 16, 2024
c886670
remove empty files
ekraffmiller Jul 16, 2024
0c73691
replace hard-coded string in test with BASE_URL
ekraffmiller Jul 16, 2024
067e309
fix imports
ekraffmiller Jul 16, 2024
57f85e7
fix error handling in PublishDatasetModal
ekraffmiller Jul 16, 2024
1f9d0bd
fix formatting
ekraffmiller Jul 16, 2024
a0a2024
DatasetJSDataverseRepository.ts: make jsVersionUpdateType assignment …
ekraffmiller Jul 16, 2024
b8d89aa
feat: refactor new ideas for managing states
g-saracca Jul 17, 2024
cd87db3
Dataset.tsx: move datasetAlerts logic to custom hook
ekraffmiller Jul 17, 2024
abc3252
Dataset.spec.tsx: add alert test
ekraffmiller Jul 17, 2024
1aad727
PublishDatasetModal.tsx: close modal on submit action
ekraffmiller Jul 17, 2024
4de411b
PublishDatasetModal.tsx: handleClose() if SubmitComplete
ekraffmiller Jul 17, 2024
2c50228
feat: refactor alerts management
g-saracca Jul 18, 2024
12467af
ChangeCurationStatusMenu.tsx: show NotImplementedModal
ekraffmiller Jul 18, 2024
4075949
remove console.log
ekraffmiller Jul 18, 2024
120c68c
resolve merge conflicts
ekraffmiller Jul 31, 2024
ae7e48b
resolve merge conflicts
ekraffmiller Aug 1, 2024
deb731d
resolve merge conflicts
ekraffmiller Aug 1, 2024
596c61b
fix: lint error
ekraffmiller Aug 1, 2024
94921e0
fix: add 'DRAFT' to url
ekraffmiller Aug 1, 2024
821c651
feat: changes to avoid extra api calls showing errors
g-saracca Aug 2, 2024
675682c
fix: make isPublishing optional
ekraffmiller Aug 2, 2024
da684f6
fix: use docker compose v2
ekraffmiller Aug 5, 2024
185ecc7
fix: use docker compose v2 in rm-env.sh
ekraffmiller Aug 5, 2024
5248139
fix: use the correct version update type when publishing
ekraffmiller Aug 5, 2024
941b489
fix: check previously released when setting versionUpdateType
ekraffmiller Aug 5, 2024
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
2 changes: 2 additions & 0 deletions packages/design-system/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
- **Card:** NEW card element to show header and body.
- **ProgressBar:** NEW progress bar element to show progress.
- **SelectAdvanced:** NEW ehanced select to search across options, and perform both single and multiple selections.
- **FormRadioGroup:** NEW radio group element to show radio buttons.
- **FormRadio:** NEW radio element to show radio button.
- **NavbarDropdownItem:** Now accepts `as` prop and takes `as` Element props.
- **FormInputGroup:** extend Props Interface to accept `hasValidation` prop to properly show rounded corners in an <InputGroup> with validation
- **Button:** extend Props Interface to accept `size` prop.
Expand Down
3 changes: 2 additions & 1 deletion packages/design-system/src/lib/components/form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Form as FormBS } from 'react-bootstrap'
import { FormGroupWithMultipleFields } from './form-group-multiple-fields/FormGroupWithMultipleFields'
import { FormInputGroup } from './form-group/form-input-group/FormInputGroup'
import { FormCheckboxGroup } from './form-checkbox-group/FormCheckboxGroup'
import { FormRadioGroup } from './form-radio-group/FormRadioGroup'

interface FormProps {
className?: string
Expand All @@ -23,5 +24,5 @@ Form.InputGroup = FormInputGroup
Form.Group = FormGroup
Form.GroupWithMultipleFields = FormGroupWithMultipleFields
Form.CheckboxGroup = FormCheckboxGroup

Form.RadioGroup = FormRadioGroup
export { Form }
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Row } from '../../grid/Row'
import { FormCheckbox } from './form-element/FormCheckbox'
import { FormFeedback } from './form-element/FormFeedback'
import { FormSelectAdvanced } from './form-element/FormSelectAdvanced'
import { FormRadio } from './form-element/FormRadio'

interface FormGroupProps extends ColProps {
as?: typeof Col | typeof Row
Expand All @@ -31,6 +32,7 @@ FormGroup.SelectAdvanced = FormSelectAdvanced
FormGroup.TextArea = FormTextArea
FormGroup.Text = FormText
FormGroup.Checkbox = FormCheckbox
FormGroup.Radio = FormRadio
FormGroup.Feedback = FormFeedback

export { FormGroup }
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Form as FormBS } from 'react-bootstrap'
import * as React from 'react'

export interface FormRadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
id: string
label: string
isValid?: boolean
isInvalid?: boolean
invalidFeedback?: string
validFeedback?: string
}

export const FormRadio = React.forwardRef(function FormRadio(
{ label, id, isValid, isInvalid, validFeedback, invalidFeedback, ...props }: FormRadioProps,
ref
) {
return (
<FormBS.Check type="radio" id={id}>
<FormBS.Check.Input
type="radio"
isValid={isValid}
isInvalid={isInvalid}
ref={ref as React.ForwardedRef<HTMLInputElement>}
{...props}
/>
<FormBS.Check.Label>{label}</FormBS.Check.Label>
<FormBS.Control.Feedback type="invalid">{invalidFeedback}</FormBS.Control.Feedback>
<FormBS.Control.Feedback type="valid">{validFeedback}</FormBS.Control.Feedback>
</FormBS.Check>
)
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'src/lib/assets/styles/design-tokens/typography.module';

.title {
display: inline-block;
margin-bottom: 0.5rem;
font-weight: $dv-font-weight-bold;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { PropsWithChildren } from 'react'
import { Row } from '../../grid/Row'
import { Col } from '../../grid/Col'
import { RequiredInputSymbol } from '../required-input-symbol/RequiredInputSymbol'
import { QuestionMarkTooltip } from '../../tooltip/question-mark-tooltip/QuestionMarkTooltip'
import styles from './FormRadioGroup.module.scss'

interface FormRadioGroupProps {
title: string
required?: boolean
message?: string
isValid?: boolean
isInvalid?: boolean
}

export function FormRadioGroup({
ekraffmiller marked this conversation as resolved.
Show resolved Hide resolved
title,
required,
message,
isValid,
isInvalid,
children
}: PropsWithChildren<FormRadioGroupProps>) {
const validationClass = isInvalid ? 'is-invalid' : isValid ? 'is-valid' : ''
return (
<Row className="mb-3">
<Col sm={3}>
<span className={styles.title}>
{title} {required && <RequiredInputSymbol />}{' '}
{message && (
<QuestionMarkTooltip placement="right" message={message}></QuestionMarkTooltip>
)}
</span>
</Col>
<Col sm={9}>
{<div className={validationClass}></div>}
{children}
</Col>
</Row>
)
}
26 changes: 25 additions & 1 deletion packages/design-system/src/lib/stories/form/Form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,31 @@ export const Checkbox: Story = {
</Form>
)
}

export const Radio: Story = {
render: () => (
<Form>
<Form.RadioGroup title="Version Update Types">
<Form.Group.Radio
defaultChecked
name="update-type"
label="Minor Version"
id="version-update-minor"
/>
<Form.Group.Radio
required
name="update-type"
label="Major Version"
id="version-update-majoy"
/>
<Form.Group.Radio
name="update-type"
label="Update Current Version"
id="version-type-update-current"
/>
</Form.RadioGroup>
</Form>
)
}
export const GroupWithMultipleFields: Story = {
render: () => (
<Form>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { FormGroup } from '../../../../src/lib/components/form/form-group/FormGroup'
import { Form } from '../../../../src/lib'
import { FormRadioGroup } from '../../../../src/lib/components/form/form-radio-group/FormRadioGroup'

const option1Label = 'Test Label 1'
const option2Label = 'Test Label 2'
const option3Label = 'Test Label 3'
const radioName = 'radio-name'

describe('FormRadio', () => {
it('renders label and radio input', () => {
cy.mount(
<FormRadioGroup title="Radio">
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<FormGroup.Radio id="radio-3" label={option3Label} name={radioName} />
</FormRadioGroup>
)

const radio1 = cy.findByLabelText(option1Label)
radio1.should('exist')

const radio2 = cy.findByLabelText(option2Label)
radio2.should('exist')

const radio3 = cy.findByLabelText(option3Label)
radio3.should('exist')
})

it('renders without label', () => {
cy.mount(
<FormRadioGroup title="Radio">
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<FormGroup.Radio id="radio-3" label={option3Label} name={radioName} />
</FormRadioGroup>
)

const radio2 = cy.findByLabelText(option2Label)

radio2.click()

radio2.should('be.checked')
})

it('should render with the required symbol', () => {
cy.mount(
<FormRadioGroup title="Radio" required>
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<FormGroup.Radio id="radio-3" label={option3Label} name={radioName} />
</FormRadioGroup>
)

const requiredSymbol = cy.findByRole('img')
requiredSymbol.should('exist')
})

it('should render with the a tooltip message', () => {
const tooltipMessage = 'This is a tooltip message'
cy.mount(
<FormRadioGroup title="Radio" required message={tooltipMessage}>
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<FormGroup.Radio id="radio-3" label={option3Label} name={radioName} />
</FormRadioGroup>
)

cy.findByLabelText('tooltip icon').trigger('mouseover')
cy.findByRole('tooltip').should('be.visible')
cy.findByText(tooltipMessage).should('be.visible')
})

it('renders with invalid feedback', () => {
cy.mount(
<FormRadioGroup title="Radio">
<FormGroup.Radio
id="radio-1"
label={option1Label}
name={radioName}
isInvalid
invalidFeedback="Invalid feedback"
/>
</FormRadioGroup>
)

cy.findByText('Invalid feedback').should('exist')
})

it('renders with valid feedback', () => {
cy.mount(
<FormRadioGroup title="Radio">
<FormGroup.Radio
id="radio-1"
label={option1Label}
name={radioName}
isValid
validFeedback="Valid feedback"
/>
</FormRadioGroup>
)

cy.findByText('Valid feedback').should('exist')
})

it('renders with invalid feedback as a group', () => {
cy.mount(
<FormRadioGroup title="Radio" isInvalid>
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<Form.Group.Feedback type="valid">Valid radio</Form.Group.Feedback>
<Form.Group.Feedback type="invalid">Invalid radio</Form.Group.Feedback>
</FormRadioGroup>
)

cy.findByText('Invalid radio').should('be.visible')
cy.findByText('Valid radio').should('not.be.visible')
})

it('renders with valid feedback as a group', () => {
cy.mount(
<FormRadioGroup title="Radio" isValid>
<FormGroup.Radio id="radio-1" label={option1Label} name={radioName} />
<FormGroup.Radio id="radio-2" label={option2Label} name={radioName} />
<Form.Group.Feedback type="valid">Valid radio</Form.Group.Feedback>
<Form.Group.Feedback type="invalid">Invalid radio</Form.Group.Feedback>
</FormRadioGroup>
)

cy.findByText('Invalid radio').should('not.be.visible')
cy.findByText('Valid radio').should('be.visible')
})
describe('FormRadioGroup', () => {
it('calls the onChange prop when a radio button is clicked', () => {
const handleChange = cy.stub()
const option1Label = 'Test Label 1'
const radioName = 'radio-name'

cy.mount(
<FormRadioGroup title="Radio">
<FormGroup.Radio
id="radio-1"
onChange={handleChange}
label={option1Label}
name={radioName}
/>
</FormRadioGroup>
)

const radio1 = cy.findByLabelText(option1Label)
radio1.click()

cy.wrap(handleChange).should('have.been.calledOnce')
})
})
})
13 changes: 13 additions & 0 deletions public/locales/en/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,18 @@
"heading": "Unpublished Dataset Private URL",
"alertText": "This unpublished dataset is being privately shared."
}
},
"publish": {
"draftQuestion": "Are you sure you want to publish this dataset? Once you do so, it must remain public.",
"previouslyReleasedQuestion": "Are you sure you want to republish this dataset?",
"termsText1": "By default datasets are published with the CC0-\"Public Domain Dedication\" waiver. Learn more about the CC0 waiver <a href=\"{{cc0Link}}\">here</a>: ",
"termsText2": "To publish with custom Terms of Use, click the Cancel button and go to the Terms tab for this dataset.",
"selectVersion": "Select if this is a minor or major version update.",
"continueButton": "Continue",
"cancelButton": "Cancel",
"minorVersion": "Minor Version",
"majorVersion": "Major Version",
"updateCurrentVersion": "Update Current Version",
"error": "An error occurred while publishing the dataset."
}
}
5 changes: 3 additions & 2 deletions src/dataset/domain/models/Dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export interface DatasetLicense {
iconUri?: string
}

const defaultLicense: DatasetLicense = {
export const defaultLicense: DatasetLicense = {
name: 'CC0 1.0',
uri: 'https://creativecommons.org/publicdomain/zero/1.0',
iconUri: 'https://licensebuttons.net/p/zero/1.0/88x31.png'
Expand Down Expand Up @@ -380,7 +380,8 @@ export class Dataset {
public readonly hierarchy: UpwardHierarchyNode,
public readonly thumbnail?: string,
public readonly privateUrl?: PrivateUrl, // will be set if the user requested a version that did not exist
public readonly requestedVersion?: string
public readonly requestedVersion?: string,
public readonly publicationDate?: string
) {}

public checkIsLockedFromPublishing(userPersistentId: string): boolean {
Expand Down
5 changes: 5 additions & 0 deletions src/dataset/domain/models/VersionUpdateType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum VersionUpdateType {
MAJOR = 'major',
MINOR = 'minor',
UPDATE_CURRENT = 'updateCurrent'
}
5 changes: 4 additions & 1 deletion src/dataset/domain/repositories/DatasetRepository.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { Dataset } from '../models/Dataset'
import { Dataset, DatasetLock } from '../models/Dataset'
import { DatasetPaginationInfo } from '../models/DatasetPaginationInfo'
import { DatasetDTO } from '../useCases/DTOs/DatasetDTO'
import { DatasetsWithCount } from '../models/DatasetsWithCount'
import { VersionUpdateType } from '../models/VersionUpdateType'

export interface DatasetRepository {
getByPersistentId: (persistentId: string, version?: string) => Promise<Dataset | undefined>
getLocks(persistentId: string): Promise<DatasetLock[]>
getByPrivateUrlToken: (privateUrlToken: string) => Promise<Dataset | undefined>
create: (dataset: DatasetDTO, collectionId?: string) => Promise<{ persistentId: string }>
updateMetadata: (datasetId: string | number, datasetDTO: DatasetDTO) => Promise<void>
getAllWithCount: (
collectionId: string,
paginationInfo: DatasetPaginationInfo
) => Promise<DatasetsWithCount>
publish(persistentId: string, versionUpdateType: VersionUpdateType): Promise<void>
}
3 changes: 3 additions & 0 deletions src/dataset/domain/useCases/DTOs/DatasetDTO.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DatasetLicense } from '../../models/Dataset'

export interface DatasetDTO {
licence: DatasetLicense
metadataBlocks: DatasetMetadataBlockValuesDTO[]
}

Expand Down
Loading
Loading