Skip to content

Commit 3668c31

Browse files
committed
Merge branch 'develop' into 797-dataset-type-selection-step
Conflicts: src/dataset/infrastructure/repositories/DatasetJSDataverseRepository.ts src/sections/create-dataset/CreateDataset.tsx src/sections/shared/form/DatasetMetadataForm/MetadataForm/index.tsx src/sections/shared/form/DatasetMetadataForm/index.tsx src/stories/create-dataset/CreateDataset.stories.tsx src/stories/dataset/DatasetErrorMockRepository.ts src/stories/dataset/DatasetMockRepository.ts tests/component/sections/create-dataset/CreateDataset.spec.tsx tests/component/sections/layout/header/LoggedInHeaderActions.spec.tsx
2 parents d25628f + 24bdb22 commit 3668c31

File tree

124 files changed

+5103
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+5103
-232
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
1212
- Contact Owner button in File Page.
1313
- Share button in File Page.
1414
- Link Collection and Link Dataset features.
15+
- Edit Terms Integration.
1516
- With the addition of the new runtime configuration approach, we now support dynamic configuration for languages. If more than one language is configured, the Language Switcher will be shown in the header to allow users to change the language.
17+
- Added Notifications tab in Account Page
1618

1719
### Changed
1820

@@ -21,6 +23,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
2123
- Use of the new `sourceLastUpdateTime` query parameter from update dataset and file metadata endpoints to support optimistic concurrency control during editing operations. See [Edit Dataset Metadata](https://guides.dataverse.org/en/6.8/api/native-api.html#edit-dataset-metadata) and [Updating File Metadata](https://guides.dataverse.org/en/6.8/api/native-api.html#updating-file-metadata) guides for more details.
2224
- Changed the way we were handling DATE type metadata field validation to better match the backend validation and give users better error messages. For example, for an input like “foo AD”, we now show “Production Date is not a valid date. The AD year must be numeric.“. For an input like “99999 AD”, we now show “Production Date is not a valid date. The AD year cant be higher than 9999.“. For an input like “[-9999?], we now show “Production Date is not a valid date. The year in brackets cannot be negative.“, etc.
2325
- The SPA now fetches the runtime configuration from `config.js` on each load, allowing configurations without rebuilding the app. We don't use `.env` variables at build time anymore.
26+
- Renamed dataset template fetch/create use cases and DTOs to `getTemplatesByCollectionId` and `CreateTemplateDTO` for API alignment, and added new `getTemplate` and `deleteTemplate` use cases for retrieving a single template by ID and deleting templates.
2427

2528
### Fixed
2629

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@dnd-kit/sortable": "8.0.0",
1919
"@dnd-kit/utilities": "3.2.2",
2020
"@faker-js/faker": "7.6.0",
21-
"@iqss/dataverse-client-javascript": "2.0.0-alpha.79",
21+
"@iqss/dataverse-client-javascript": "2.0.0-alpha.85",
2222
"@iqss/dataverse-design-system": "*",
2323
"@istanbuljs/nyc-config-typescript": "1.0.2",
2424
"@tanstack/react-table": "8.9.2",

packages/design-system/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
3030
- Fix styles for vertical button groups when using tooltips.
3131
- **FormText:** Add `className` prop to allow custom styling.
3232
- **FormInput:** Add `size` prop to allow different input sizes (e.g., 'sm', 'lg'). Defaults to standard size if not specified.
33+
- **Badge:**:
34+
- Add `pill` prop to allow pill-shaped badges.
35+
- Add `dataTestId` prop to facilitate testing.
36+
- Add `className` prop to allow custom styling.
3337

3438
# [2.0.2](https://github.com/IQSS/dataverse-frontend/compare/@iqss/dataverse-design-system@2.0.1...@iqss/dataverse-design-system@2.0.2) (2024-06-23)
3539

packages/design-system/src/lib/components/badge/Badge.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,25 @@ import styles from './Badge.module.scss'
44

55
interface BadgeProps {
66
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info'
7+
pill?: boolean
8+
dataTestId?: string
9+
className?: string
710
children: ReactNode
811
}
912

10-
export function Badge({ variant = 'secondary', children }: BadgeProps) {
13+
export function Badge({
14+
variant = 'secondary',
15+
pill = false,
16+
className,
17+
dataTestId,
18+
children
19+
}: BadgeProps) {
1120
return (
12-
<BadgeBS bg={variant} className={styles[variant]}>
21+
<BadgeBS
22+
bg={variant}
23+
pill={pill}
24+
className={`${styles[variant]} ${className || ''}`}
25+
data-testid={dataTestId}>
1326
{children}
1427
</BadgeBS>
1528
)

packages/design-system/src/lib/components/modal/Modal.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ interface ModalProps {
1010
onHide: () => void
1111
centered?: boolean
1212
size?: 'sm' | 'lg' | 'xl'
13+
ariaLabel?: string
1314
}
1415

15-
function Modal({ show, onHide, centered, size, children }: PropsWithChildren<ModalProps>) {
16+
function Modal({
17+
show,
18+
onHide,
19+
centered,
20+
size,
21+
children,
22+
ariaLabel
23+
}: PropsWithChildren<ModalProps>) {
1624
return (
17-
<BSModal centered={centered} show={show} onHide={onHide} size={size}>
25+
<BSModal centered={centered} show={show} onHide={onHide} size={size} aria-label={ariaLabel}>
1826
{children}
1927
</BSModal>
2028
)

packages/design-system/src/lib/stories/badge/Badge.stories.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,28 @@ export const AllVariantsAtAGlance: Story = {
2525
</>
2626
)
2727
}
28+
29+
export const WithPillShape: Story = {
30+
render: () => (
31+
<>
32+
<Badge variant="primary" pill>
33+
Primary
34+
</Badge>
35+
<Badge variant="secondary" pill>
36+
Secondary
37+
</Badge>
38+
<Badge variant="success" pill>
39+
Success
40+
</Badge>
41+
<Badge variant="danger" pill>
42+
Danger
43+
</Badge>
44+
<Badge variant="warning" pill>
45+
Warning
46+
</Badge>
47+
<Badge variant="info" pill>
48+
Info
49+
</Badge>
50+
</>
51+
)
52+
}

public/locales/en/account.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,50 @@
4747
"datasetAndFile": "datasets or files"
4848
}
4949
}
50+
},
51+
"notifications": {
52+
"title": "Notifications",
53+
"userGuideLinkText": "User Guide",
54+
"demoServerLinkText": "Demo Site",
55+
"clearAllNotifications": "Clear All Notifications",
56+
"clearAllOnThisPage": "Clear All Notifications on this Page",
57+
"displayingNotifications": "Displaying {{start}} - {{end}} of {{total}} Notifications",
58+
"dismiss": "Dismiss",
59+
"noNotifications": "No notifications available.",
60+
"notification": {
61+
"createAcc": "Welcome to {{installationBrandName}}! Get started by adding or finding data. Have questions? Check out the <userGuideLink>{{userGuideLinkText}}</userGuideLink>. Want to test out Dataverse features? Use our <demoLink>{{demoServerLinkText}}</demoLink>. Also, check for your welcome email to verify your address.",
62+
"ingestCompleted": "Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> has one or more tabular files that completed the <userGuideLink>tabular ingest process</userGuideLink> and are available in archival formats.",
63+
"ingestCompletedWithErrors": "Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> has one or more tabular files that are available but are not supported for <b>tabular ingest</b>.",
64+
"genericObjectDeleted": "The dataverse, dataset, or file for this notification has been deleted.",
65+
"assignRole": "You have been granted the {{roleName}} role for <objectLink>{{- objectName}}</objectLink>.",
66+
"assignRoleFileDownloader": "You now have access to all published restricted and unrestricted files in <objectLink>{{- objectName}}</objectLink>.",
67+
"revokeRole": "You have been removed from a role in <objectLink>{{- objectName}}</objectLink>.",
68+
"createCollection": "<collectionLink>{{- collectionDisplayName}}</collectionLink> was created in <ownerLink>{{- ownerDisplayName}}</ownerLink> . To learn more about what you can do with your collection, check out the <userGuideLink>{{userGuideLinkText}}</userGuideLink>.",
69+
"createDataset": "<datasetLink>{{- datasetDisplayName}}</datasetLink> was created in <ownerLink>{{- ownerDisplayName}}</ownerLink>. To learn more about what you can do with your dataset, check out the <userGuideLink>{{userGuideLinkText}}</userGuideLink>.",
70+
"requestFileAccess": "File access requested for dataset: <datasetLink>{{- datasetDisplayName}}</datasetLink> was made by {{requestorFirstName}} {{requestorLastName}} ({{requestorEmail}}).",
71+
"requestedFileAccess": "You have requested access to files in dataset: <datasetLink>{{- datasetDisplayName}}</datasetLink>.",
72+
"grantFileAccess": "Access granted for files in dataset: <datasetLink>{{- datasetDisplayName}}</datasetLink>.",
73+
"rejectFileAccess": "Access rejected for requested files in dataset: <datasetLink>{{- datasetDisplayName}}</datasetLink>.",
74+
"datasetCreated": "<datasetLink>{{- datasetDisplayName}}</datasetLink> was created in <ownerLink>{{- ownerDisplayName}}</ownerLink> by {{requestorFirstName}} {{requestorLastName}}.",
75+
"submittedDataset": "<datasetLink>{{- datasetDisplayName}}</datasetLink> was submitted for review to be published in <ownerLink>{{- ownerDisplayName}}</ownerLink>. Don''t forget to publish it or send it back to the contributor, {{requestorFirstName}} {{requestorLastName}} ({{requestorEmail}})!",
76+
"returnedDataset": "<datasetLink>{{- datasetDisplayName}}</datasetLink> was returned by the curator of <ownerLink>{{- ownerDisplayName}}</ownerLink>.",
77+
"publishedDataset": "<datasetLink>{{- datasetDisplayName}}</datasetLink> was published in <ownerLink>{{- ownerDisplayName}}</ownerLink>.",
78+
"publishFailedPidReg": "<datasetLink>{{- datasetDisplayName}}</datasetLink> in <ownerLink>{{- ownerDisplayName}}</ownerLink> could not be published due to a failure to register, or update the Global Identifier for the dataset or one of the files in it. Contact support if this continues to happen.",
79+
"workflowFailure": "An external workflow run on <datasetLink>{{- datasetDisplayName}}</datasetLink> in <ownerLink>{{- ownerDisplayName}}</ownerLink> has failed. Check your email and/or view the Dataset page which may have additional details. Contact support if this continues to happen.",
80+
"workflowSuccess": "An external workflow run on <datasetLink>{{- datasetDisplayName}}</datasetLink> in <ownerLink>{{- ownerDisplayName}}</ownerLink> has succeeded. Check your email and/or view the Dataset page which may have additional details.",
81+
"statusUpdated": "The status of dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> has been updated to {{currentCurationStatus}}.",
82+
"pidreconciled": "The persistent identifier of dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> has been updated to {{datasetPersistentId}}.",
83+
"datasetMentioned": "Announcement Received: Newly released {{type}} <relatedLink>{{- name}}</relatedLink> {{relationship}} dataset <datasetLink>{{- datasetDisplayName}}</datasetLink>.",
84+
"datasetMentionedGeneric": "Announcement received for dataset <datasetLink>{{- datasetDisplayName}}</datasetLink>, additional info: {{- additionalInfo}}.",
85+
"checksumFail": "One or more files in your upload failed checksum validation for dataset <datasetLink>{{- datasetDisplayName}}</datasetLink>. Please re-run the upload script. If the problem persists, please contact support.",
86+
"importFilesystem": "Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> has been successfully uploaded and verified.",
87+
"globusUploadCompleted": "Globus transfer to Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> was successful. File(s) have been uploaded and verified.",
88+
"globusDownloadCompleted": "Globus transfer from the dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> was successful.",
89+
"globusUploadCompletedWithErrors": "Globus transfer to Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> is complete with errors.",
90+
"globusUploadFailedRemotely": "Remote data transfer between Globus collections for Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> failed, reported via Globus API.",
91+
"globusUploadFailedLocally": "Dataverse received a confirmation of a successful Globus data transfer for Dataset <datasetLink>{{- datasetDisplayName}}</datasetLink>, but failed to add the files to the dataset locally.",
92+
"globusDownloadCompletedWithErrors": "Globus transfer from the dataset <datasetLink>{{- datasetDisplayName}}</datasetLink> is complete with errors.",
93+
"importChecksum": "<datasetLink>{{datasetDisplayName}}</datasetLink>, dataset had file checksums added via a batch job."
94+
}
5095
}
5196
}

public/locales/en/dataset.json

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"filesTabTitle": "Files",
33
"metadataTabTitle": "Metadata",
4-
"termsTabTitle": "Terms",
4+
"termsTabTitle": "Terms and Guestbook",
55
"anonymizedFieldValue": "withheld",
66
"customTerms": {
77
"title": "Custom Dataset Terms",
88
"description": "The following custom terms have been defined for this dataset."
99
},
1010
"license": {
1111
"title": "License/Data Use Agreement",
12-
"altTextPrefix": "License image for "
12+
"altTextPrefix": "License image for ",
13+
"description": "This dataset will be published under the terms specified below. Our Community Norms as well as good scientific practices expect that proper credit is given via citation."
1314
},
1415
"citation": {
1516
"status": {
@@ -53,7 +54,7 @@
5354
"filesUpload": "Files (Upload)",
5455
"metadata": "Metadata",
5556
"tags": "Tags",
56-
"terms": "Terms",
57+
"terms": "Terms and Guestbook",
5758
"privateUrl": "Private URL",
5859
"thumbnailsPlusWidgets": "Thumbnails + Widgets",
5960
"delete": {
@@ -101,6 +102,10 @@
101102
"heading": "Success!",
102103
"alertText": "The terms for this dataset have been updated."
103104
},
105+
"licenseUpdated": {
106+
"heading": "Success!",
107+
"alertText": "The license for this dataset has been updated."
108+
},
104109
"thumbnailUpdated": {
105110
"heading": "Success!",
106111
"alertText": "Dataset thumbnail updated."
@@ -140,13 +145,16 @@
140145
"datasetDeletedSuccess": "The dataset has been deleted."
141146
},
142147
"termsTab": {
143-
"editTermsButton": "Edit Term Requirements",
148+
"editTermsButton": "Edit Terms and Guestbook",
144149
"licenseTitle": "Dataset Terms",
145150
"termsTitle": "Restricted Files + Terms of Access",
146151
"licenseHelpText": "Our <anchor>Community Norms</anchor> as well as good scientific practices expect that proper credit is given via citation. Please use the data citation shown on the dataset page.",
147152
"restrictedFiles": "Restricted Files",
148153
"termsOfAccess": "Terms of Access for Restricted Files",
154+
"termsOfAccessInfo": "Restricting limits access to published files. People who want to use the restricted files can request access by default. If you disable request access, you must add information about access to the Terms of Access field. Learn about restricting files and dataset access in the User Guide.",
155+
"termsOfAccessRequiredWhenRequestDisabled": "Add information about terms of access for restricted files when request access is disabled.",
149156
"requestAccess": "Request Access",
157+
"enableAccessRequest": "Enable access request",
150158
"dataAccessPlace": "Data Access Place",
151159
"originalArchive": "Original Archive",
152160
"availabilityStatus": "Availability Status",
@@ -184,6 +192,7 @@
184192
"studyCompletionTip": "Relationship of the data collected to the amount of data coded and stored in the Dataset. Information as to why certain items of collected information were not included in the dataset or a specific data file should be provided."
185193
},
186194
"publish": {
195+
"title": "Publish Dataset",
187196
"draftQuestion": "Are you sure you want to publish this dataset? Once you do so, it must remain published.",
188197
"draftSubtext": "This version of the dataset will be published with the following terms:",
189198
"previouslyReleasedQuestion": "Are you sure you want to republish this dataset?",
@@ -263,7 +272,6 @@
263272
"deaccessionedReason": "Deaccessioned Reason",
264273
"error": "Error on loading dataset versions"
265274
},
266-
"getDatasetVersionDiffError": "Error Fetching Dataset Version Differences",
267275
"datasetVersionSummary": {
268276
"firstPublished": "This is the First Published Version.",
269277
"firstDraft": "This is a draft version.",
@@ -328,5 +336,44 @@
328336
},
329337
"contact": {
330338
"tip": "Use email button above to contact."
339+
},
340+
"editTerms": {
341+
"pageTitle": "Edit Dataset Terms",
342+
"breadcrumbActionItem": "Edit Dataset Terms and Guestbook",
343+
"infoAlert": {
344+
"heading": "Edit Dataset Terms",
345+
"text": "Add the terms of use for this dataset to explain how to access and use your data."
346+
},
347+
"tabs": {
348+
"datasetTerms": "Dataset Terms",
349+
"restrictedFilesTerms": "Restricted Files + Terms of Access",
350+
"guestBook": "GuestBook"
351+
},
352+
"datasetTerms": {
353+
"title": "Dataset Terms",
354+
"description": "Configure the license and custom terms for this dataset.",
355+
"licenseRequired": "Please select a license for this dataset",
356+
"customTermsRequired": "Terms of use is required.",
357+
"customTermsLabel": "Custom Dataset Terms",
358+
"licenseDescription": "This dataset will be published under the terms specified below. Our Community Norms as well as good scientific practices expect that proper credit is given via citation."
359+
},
360+
"restrictedFilesTerms": {
361+
"title": "Restricted Files + Terms of Access",
362+
"description": "Set up access restrictions and terms for restricted files in this dataset."
363+
},
364+
"guestBook": {
365+
"title": "GuestBook",
366+
"description": "Select a guestbook to have a user provide additional information when downloading a file.",
367+
"testGuestbook": "Test Guestbook",
368+
"previewButton": "Preview Guestbook"
369+
},
370+
"unsavedChangesModal": {
371+
"title": "Unsaved Changes",
372+
"message": "You have unsaved changes on this tab. If you leave now, your changes on this tab won't be saved.",
373+
"stay": "Stay on this page",
374+
"leave": "Leave without saving"
375+
},
376+
"defaultLicenseUpdateError": "An error occurred while updating the dataset license. Please try again.",
377+
"defaultTermsOfAccessUpdateError": "An error occurred while updating the dataset terms of access. Please try again."
331378
}
332379
}

public/locales/en/header.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"brandLogoImage": "Dataverse brand logo",
77
"navigation": {
88
"addData": "Add Data",
9+
"notifications": "Notifications",
910
"newCollection": "New Collection",
1011
"newDataset": "New Dataset",
1112
"accountInfo": "Account Information",

0 commit comments

Comments
 (0)