Skip to content

Commit de3d0ee

Browse files
committed
fix help text logic
1 parent a584d69 commit de3d0ee

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

public/locales/en/dataset.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"publish": {
115115
"draftQuestion": "Are you sure you want to publish this dataset? Once you do so, it must remain public.",
116116
"previouslyReleasedQuestion": "Are you sure you want to republish this dataset?",
117-
"releaseCollectionQuestion": "This dataset cannot be published until <a>{{parentCollectionName}}</a> is published. Would you like to publish both right now?",
117+
"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.",
118118
"requiresMajorRelease": "Due to the nature of the changes to the current draft this will be a major release ({{versionNumber}})",
119119
"termsText": "To change the terms for this version, click the Cancel button and go to the Terms tab for this dataset.",
120120
"selectVersion": "Select if this is a minor or major version update.",

src/sections/dataset/publish-dataset/PublishDatasetHelpText.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export function PublishDatasetHelpText({
3535
components={{ a: <Link to={RouteWithParams.COLLECTIONS(parentCollectionId)} /> }}
3636
/>
3737
)}
38-
{releasedVersionExists && !requiresMajorVersionUpdate && (
39-
<>{t('publish.previouslyReleasedQuestion')}</>
40-
)}
38+
{releasedVersionExists && <>{t('publish.previouslyReleasedQuestion')}</>}
39+
</p>
40+
<p>
4141
{releasedVersionExists && requiresMajorVersionUpdate && (
42-
<Trans t={t} i18nKey={'publish.requiresMajorRelease'} values={{ nextMajorVersion }} />
42+
<>{t('publish.requiresMajorRelease', { versionNumber: nextMajorVersion })}</>
4343
)}
4444
</p>
4545
<p>{t('publish.termsText')}</p>

src/stories/dataset/publish-dataset/PublishDatasetModal.stories.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,19 @@ export const Superuser: Story = {
7474
handleClose={() => {}}></PublishDatasetModal>
7575
)
7676
}
77+
export const RequiresMajorVersionUpdate: Story = {
78+
decorators: [WithLoggedInUser],
79+
render: () => (
80+
<PublishDatasetModal
81+
show={true}
82+
repository={new DatasetMockRepository()}
83+
collectionRepository={new CollectionMockRepository()}
84+
parentCollection={UpwardHierarchyNodeMother.createCollection()}
85+
persistentId={'test'}
86+
releasedVersionExists={true}
87+
nextMinorVersion={'1.1'}
88+
nextMajorVersion={'2.0'}
89+
requiresMajorVersionUpdate={true}
90+
handleClose={() => {}}></PublishDatasetModal>
91+
)
92+
}

0 commit comments

Comments
 (0)