Skip to content

Commit 66d2a60

Browse files
authored
Merge pull request #549 from IQSS/feat/545-edit-collection-page
Edit Collection page
2 parents 02b04e5 + b6306f2 commit 66d2a60

File tree

88 files changed

+9885
-1909
lines changed

Some content is hidden

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

88 files changed

+9885
-1909
lines changed

merged-coverage/lcov.info

Lines changed: 6400 additions & 68 deletions
Large diffs are not rendered by default.

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
@@ -13,7 +13,7 @@
1313
},
1414
"dependencies": {
1515
"@faker-js/faker": "7.6.0",
16-
"@iqss/dataverse-client-javascript": "2.0.0-alpha.4",
16+
"@iqss/dataverse-client-javascript": "2.0.0-alpha.6",
1717
"@iqss/dataverse-design-system": "*",
1818
"@istanbuljs/nyc-config-typescript": "1.0.2",
1919
"@tanstack/react-table": "8.9.2",
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
import { PropsWithChildren } from 'react'
21
import { Dropdown } from 'react-bootstrap'
32

4-
export function DropdownHeader({ children }: PropsWithChildren) {
5-
return <Dropdown.Header>{children}</Dropdown.Header>
3+
interface DropdownHeaderProps {
4+
className?: string
5+
children: React.ReactNode
6+
}
7+
8+
export function DropdownHeader({ className, children }: DropdownHeaderProps) {
9+
return <Dropdown.Header className={className}>{children}</Dropdown.Header>
610
}

public/locales/en/collection.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@
3030
"question": "Are you sure you want to publish your collection? Once you do so it must remain published.",
3131
"error": "There was an error publishing your collection."
3232
},
33-
"publishedAlert": "Your collection is now public."
33+
"publishedAlert": "Your collection is now public.",
34+
"editedAlert": "You have successfully updated your collection!",
35+
"editCollection": {
36+
"edit": "Edit",
37+
"generalInfo": "General Information"
38+
}
3439
}
Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,4 @@
11
{
22
"pageTitle": "Create Collection",
3-
"fields": {
4-
"hostCollection": {
5-
"label": "Host Collection",
6-
"description": "The collection which contains this data.",
7-
"required": "Host Collection is required"
8-
},
9-
"name": {
10-
"label": "Collection Name",
11-
"description": "The project, department, university, professor, or journal this collection will contain data for.",
12-
"required": "Collection Name is required"
13-
},
14-
"affiliation": {
15-
"label": "Affiliation",
16-
"description": "The organization with which this collection is affiliated."
17-
},
18-
"alias": {
19-
"label": "Identifier",
20-
"description": "Short name used for the URL of this collection.",
21-
"required": "Identifier is required",
22-
"invalid": {
23-
"format": "Identifier is not valid. Valid characters are a-Z, 0-9, '_', and '-'.",
24-
"maxLength": "Identifier must be at most {{maxLength}} characters."
25-
},
26-
"suggestion": "Psst... try this"
27-
},
28-
"storage": {
29-
"label": "Storage",
30-
"description": "A storage service to be used for datasets in this collection."
31-
},
32-
"type": {
33-
"label": "Category",
34-
"description": "The type that most closely reflects this collection.",
35-
"required": "Category is required"
36-
},
37-
"description": {
38-
"label": "Description",
39-
"description": "A summary describing the purpose, nature or scope of this collection.",
40-
"subLabel": "This field supports only certain <htmlTooltip>HTML tags</htmlTooltip>.",
41-
"htmlAllowedTags": "<a>, <b>, <blockquote>, <br>, <code>, <del>, <dd>, <dl>, <dt>, <em>, <hr>, <h1>-<h3>, <i>, <img>, <kbd>, <li>, <ol>, <p>, <pre>, <s>, <sup>, <sub>, <strong>, <strike>, <u>, <ul>"
42-
},
43-
"contacts": {
44-
"label": "Email",
45-
"description": "The email address(es) of the contact(s) for the collection.",
46-
"required": "Email is required",
47-
"invalid": "Email is not a valid email"
48-
},
49-
"metadataFields": {
50-
"sectionLabel": "Metadata Fields",
51-
"helperText": "Choose the metadata fields to use in dataset templates and when adding a dataset to this collection.",
52-
"useMetadataFieldsFrom": "Use metadata fields from",
53-
"inputLevelsTable": {
54-
"hideTableAriaLabel": "Hide input levels table",
55-
"requiredByDataverse": "Required by Dataverse",
56-
"hidden": "Hidden",
57-
"optional": "Optional",
58-
"required": "Required",
59-
"conditionallyRequired": "Conditionally Required"
60-
}
61-
},
62-
"browseSearchFacets": {
63-
"label": "Browse/Search Facets",
64-
"helperText": "Choose and order the metadata fields to use as facets when browsing this collection.",
65-
"useBrowseSearchFacetsFrom": "Use browse/search facets from",
66-
"selectedFacets": "Selected"
67-
}
68-
},
69-
"confirmResetModal": {
70-
"title": "Reset Modifications",
71-
"warning": "Are you sure you want to reset the selected metadata fields? If you do this, any customizations (hidden, required, optional) you have done will no longer appear.",
72-
"continue": "Continue",
73-
"cancel": "Cancel"
74-
},
75-
"submitStatus": {
76-
"success": "Collection created successfully."
77-
},
78-
"formButtons": {
79-
"save": "Create Collection",
80-
"cancel": "Cancel"
81-
},
823
"notAllowedToCreateCollection": "You do not have permissions to create a collection within this collection."
834
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"pageTitle": "Edit Collection",
3+
"notAllowedToEditCollection": "You do not have permissions to edit this collection.",
4+
"infoAlert": {
5+
"heading": "Edit Collection",
6+
"text": "Edit your collection and click Save Changes. Asterisks indicate required fields."
7+
}
8+
}

public/locales/en/shared.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,91 @@
6161
"editMode": "Save Changes"
6262
},
6363
"cancelButton": "Cancel"
64+
},
65+
"collectionForm": {
66+
"fields": {
67+
"hostCollection": {
68+
"label": "Host Collection",
69+
"description": "The collection which contains this data.",
70+
"required": "Host Collection is required"
71+
},
72+
"name": {
73+
"label": "Collection Name",
74+
"description": "The project, department, university, professor, or journal this collection will contain data for.",
75+
"required": "Collection Name is required"
76+
},
77+
"affiliation": {
78+
"label": "Affiliation",
79+
"description": "The organization with which this collection is affiliated."
80+
},
81+
"alias": {
82+
"label": "Identifier",
83+
"description": "Short name used for the URL of this collection.",
84+
"required": "Identifier is required",
85+
"invalid": {
86+
"format": "Identifier is not valid. Valid characters are a-Z, 0-9, '_', and '-'.",
87+
"maxLength": "Identifier must be at most {{maxLength}} characters."
88+
},
89+
"suggestion": "Psst... try this"
90+
},
91+
"storage": {
92+
"label": "Storage",
93+
"description": "A storage service to be used for datasets in this collection."
94+
},
95+
"type": {
96+
"label": "Category",
97+
"description": "The type that most closely reflects this collection.",
98+
"required": "Category is required"
99+
},
100+
"description": {
101+
"label": "Description",
102+
"description": "A summary describing the purpose, nature or scope of this collection.",
103+
"subLabel": "This field supports only certain <htmlTooltip>HTML tags</htmlTooltip>.",
104+
"htmlAllowedTags": "<a>, <b>, <blockquote>, <br>, <code>, <del>, <dd>, <dl>, <dt>, <em>, <hr>, <h1>-<h3>, <i>, <img>, <kbd>, <li>, <ol>, <p>, <pre>, <s>, <sup>, <sub>, <strong>, <strike>, <u>, <ul>"
105+
},
106+
"contacts": {
107+
"label": "Email",
108+
"description": "The email address(es) of the contact(s) for the collection.",
109+
"required": "Email is required",
110+
"invalid": "Email is not a valid email"
111+
},
112+
"metadataFields": {
113+
"sectionLabel": "Metadata Fields",
114+
"helperText": "Choose the metadata fields to use in dataset templates and when adding a dataset to this collection.",
115+
"useMetadataFieldsFrom": "Use metadata fields from",
116+
"inputLevelsTable": {
117+
"hideTableAriaLabel": "Hide input levels table",
118+
"requiredByDataverse": "Required by Dataverse",
119+
"hidden": "Hidden",
120+
"optional": "Optional",
121+
"required": "Required",
122+
"conditionallyRequired": "Conditionally Required"
123+
}
124+
},
125+
"browseSearchFacets": {
126+
"label": "Browse/Search Facets",
127+
"helperText": "Choose and order the metadata fields to use as facets when browsing this collection.",
128+
"useBrowseSearchFacetsFrom": "Use browse/search facets from",
129+
"selectedFacets": "Selected",
130+
"invalid": {
131+
"minLength": "At least one facet must be selected."
132+
}
133+
}
134+
},
135+
"confirmResetModal": {
136+
"title": "Reset Modifications",
137+
"warning": "Are you sure you want to reset the selected metadata fields? If you do this, any customizations (hidden, required, optional) you have done will no longer appear.",
138+
"continue": "Continue",
139+
"cancel": "Cancel"
140+
},
141+
"submitStatus": {
142+
"createSuccess": "Collection created successfully.",
143+
"editSuccess": "Collection updated successfully."
144+
},
145+
"saveButton": {
146+
"createMode": "Create Collection",
147+
"editMode": "Save Changes"
148+
},
149+
"cancelButton": "Cancel"
64150
}
65151
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { UpwardHierarchyNode } from '../../../shared/hierarchy/domain/models/UpwardHierarchyNode'
2+
import { CollectionContact } from './CollectionContact'
3+
import { CollectionType } from './CollectionType'
4+
import { CollectionInputLevel } from './CollectionInputLevel'
25

36
export interface Collection {
47
id: string
@@ -8,10 +11,8 @@ export interface Collection {
811
description?: string
912
affiliation?: string
1013
inputLevels?: CollectionInputLevel[]
11-
}
12-
13-
export interface CollectionInputLevel {
14-
datasetFieldName: string
15-
include: boolean
16-
required: boolean
14+
type: CollectionType
15+
contacts: CollectionContact[]
16+
isMetadataBlockRoot: boolean
17+
isFacetRoot: boolean
1718
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface CollectionContact {
2+
email: string
3+
displayOrder: number
4+
}

0 commit comments

Comments
 (0)