Skip to content

Commit

Permalink
fix help text logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Nov 18, 2024
1 parent a584d69 commit de3d0ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"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?",
"releaseCollectionQuestion": "This dataset cannot be published until <a>{{parentCollectionName}}</a> is published. Would you like to publish both right now?",
"releaseCollectionQuestion": "This dataset cannot be published until <a>{{parentCollectionName}}</a> is published. Would you like to publish both right now? Once you do so, it must remain public.",
"requiresMajorRelease": "Due to the nature of the changes to the current draft this will be a major release ({{versionNumber}})",
"termsText": "To change the terms for this version, click the Cancel button and go to the Terms tab for this dataset.",
"selectVersion": "Select if this is a minor or major version update.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export function PublishDatasetHelpText({
components={{ a: <Link to={RouteWithParams.COLLECTIONS(parentCollectionId)} /> }}
/>
)}
{releasedVersionExists && !requiresMajorVersionUpdate && (
<>{t('publish.previouslyReleasedQuestion')}</>
)}
{releasedVersionExists && <>{t('publish.previouslyReleasedQuestion')}</>}
</p>
<p>
{releasedVersionExists && requiresMajorVersionUpdate && (
<Trans t={t} i18nKey={'publish.requiresMajorRelease'} values={{ nextMajorVersion }} />
<>{t('publish.requiresMajorRelease', { versionNumber: nextMajorVersion })}</>
)}
</p>
<p>{t('publish.termsText')}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,19 @@ export const Superuser: Story = {
handleClose={() => {}}></PublishDatasetModal>
)
}
export const RequiresMajorVersionUpdate: Story = {
decorators: [WithLoggedInUser],
render: () => (
<PublishDatasetModal
show={true}
repository={new DatasetMockRepository()}
collectionRepository={new CollectionMockRepository()}
parentCollection={UpwardHierarchyNodeMother.createCollection()}
persistentId={'test'}
releasedVersionExists={true}
nextMinorVersion={'1.1'}
nextMajorVersion={'2.0'}
requiresMajorVersionUpdate={true}
handleClose={() => {}}></PublishDatasetModal>
)
}

0 comments on commit de3d0ee

Please sign in to comment.