Skip to content

Commit

Permalink
fix: call submitPublish() with VersionUpdateType.MAJOR when requiresM…
Browse files Browse the repository at this point in the history
…ajorVersionUpdate=true
  • Loading branch information
ekraffmiller committed Jan 6, 2025
1 parent ad1f70a commit cb7403e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sections/dataset/publish-dataset/PublishDatasetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function PublishDatasetModal({
const { t } = useTranslation('dataset')
const { user } = useSession()
const navigate = useNavigate()
console.log('requiresMajorVersionUpdate', requiresMajorVersionUpdate)
const { submissionStatus, submitPublish, publishError } = usePublishDataset(
repository,
collectionRepository,
Expand Down Expand Up @@ -139,7 +138,10 @@ export function PublishDatasetModal({
<Button
variant="primary"
onClick={() => {
submitPublish(selectedVersionUpdateType)
const versionUpdateType = requiresMajorVersionUpdate
? VersionUpdateType.MAJOR
: selectedVersionUpdateType
submitPublish(versionUpdateType)
}}
type="submit">
{t('publish.continueButton')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ describe('PublishDatasetModal', () => {
cy.findByText(
/Due to the nature of the changes to the current draft this will be a major release \(2\.0\)/
).should('exist')
cy.findByText('Continue').click()
cy.get('@repositoryPublish').should(
'have.been.calledWith',
'testPersistentId',
VersionUpdateType.MAJOR
)
})

it('Displays warning text for unreleased Collection', () => {
Expand Down

0 comments on commit cb7403e

Please sign in to comment.