-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge branch 'develop' into 506-api-token-section-read-curren…
- Loading branch information
1 parent
b7d5a4d
commit 912a055
Showing
28 changed files
with
72 additions
and
342 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/sections/dataset/publish-dataset/PublishDatasetHelpText.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 17 additions & 41 deletions
58
src/sections/dataset/publish-dataset/PublishDatasetHelpText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,28 @@ | ||
import { useTranslation, Trans } from 'react-i18next' | ||
import { RouteWithParams } from '@/sections/Route.enum' | ||
import { Link } from 'react-router-dom' | ||
import { Stack } from '@iqss/dataverse-design-system' | ||
import styles from './PublishDatasetHelpText.module.scss' | ||
|
||
interface PublishDatasetHelpTextProps { | ||
releasedVersionExists: boolean | ||
parentCollectionIsReleased: boolean | undefined | ||
parentCollectionName: string | ||
parentCollectionId: string | ||
} | ||
|
||
function getWarningTextKey( | ||
releasedVersionExists: boolean, | ||
parentCollectionIsReleased: boolean | undefined | ||
): string { | ||
if (!releasedVersionExists) { | ||
if (!parentCollectionIsReleased) { | ||
return 'publish.releaseCollectionQuestion' | ||
} else return 'publish.draftQuestion' | ||
} | ||
return 'publish.previouslyReleasedQuestion' | ||
} | ||
|
||
export function PublishDatasetHelpText({ | ||
releasedVersionExists, | ||
parentCollectionIsReleased, | ||
parentCollectionName, | ||
parentCollectionId | ||
}: PublishDatasetHelpTextProps) { | ||
export function PublishDatasetHelpText({ releasedVersionExists }: PublishDatasetHelpTextProps) { | ||
const { t } = useTranslation('dataset') | ||
const warningText = getWarningTextKey(releasedVersionExists, parentCollectionIsReleased) | ||
|
||
const cc0Link = 'https://creativecommons.org/publicdomain/zero/1.0/' | ||
return ( | ||
<Stack direction="vertical"> | ||
<p className={styles.warningText}> | ||
{!parentCollectionIsReleased ? ( | ||
<Trans | ||
t={t} | ||
i18nKey={warningText} | ||
values={{ parentCollectionName }} | ||
components={{ a: <Link to={RouteWithParams.COLLECTIONS(parentCollectionId)} /> }} | ||
/> | ||
) : ( | ||
<>{t(warningText)}</> | ||
)} | ||
</p> | ||
<p>{t('publish.termsText')}</p> | ||
</Stack> | ||
<> | ||
{!releasedVersionExists && <p className={styles.warningText}>{t('publish.draftQuestion')}</p>} | ||
{releasedVersionExists && ( | ||
<p className={styles.warningText}>{t('publish.previouslyReleasedQuestion')}</p> | ||
)} | ||
<div className={styles.container}> | ||
<Trans | ||
t={t} | ||
i18nKey="publish.termsText1" | ||
values={{ cc0Link }} | ||
components={{ a: <a href={cc0Link} /> }} | ||
/> | ||
<p>{t('publish.termsText2')}</p> | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.