Skip to content

Commit

Permalink
feat: edit/create collection form reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Nov 8, 2024
1 parent d69359c commit 9cd8bea
Show file tree
Hide file tree
Showing 39 changed files with 676 additions and 500 deletions.
79 changes: 0 additions & 79 deletions public/locales/en/createCollection.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,4 @@
{
"pageTitle": "Create Collection",
"fields": {
"hostCollection": {
"label": "Host Collection",
"description": "The collection which contains this data.",
"required": "Host Collection is required"
},
"name": {
"label": "Collection Name",
"description": "The project, department, university, professor, or journal this collection will contain data for.",
"required": "Collection Name is required"
},
"affiliation": {
"label": "Affiliation",
"description": "The organization with which this collection is affiliated."
},
"alias": {
"label": "Identifier",
"description": "Short name used for the URL of this collection.",
"required": "Identifier is required",
"invalid": {
"format": "Identifier is not valid. Valid characters are a-Z, 0-9, '_', and '-'.",
"maxLength": "Identifier must be at most {{maxLength}} characters."
},
"suggestion": "Psst... try this"
},
"storage": {
"label": "Storage",
"description": "A storage service to be used for datasets in this collection."
},
"type": {
"label": "Category",
"description": "The type that most closely reflects this collection.",
"required": "Category is required"
},
"description": {
"label": "Description",
"description": "A summary describing the purpose, nature or scope of this collection.",
"subLabel": "This field supports only certain <htmlTooltip>HTML tags</htmlTooltip>.",
"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>"
},
"contacts": {
"label": "Email",
"description": "The email address(es) of the contact(s) for the collection.",
"required": "Email is required",
"invalid": "Email is not a valid email"
},
"metadataFields": {
"sectionLabel": "Metadata Fields",
"helperText": "Choose the metadata fields to use in dataset templates and when adding a dataset to this collection.",
"useMetadataFieldsFrom": "Use metadata fields from",
"inputLevelsTable": {
"hideTableAriaLabel": "Hide input levels table",
"requiredByDataverse": "Required by Dataverse",
"hidden": "Hidden",
"optional": "Optional",
"required": "Required",
"conditionallyRequired": "Conditionally Required"
}
},
"browseSearchFacets": {
"label": "Browse/Search Facets",
"helperText": "Choose and order the metadata fields to use as facets when browsing this collection.",
"useBrowseSearchFacetsFrom": "Use browse/search facets from",
"selectedFacets": "Selected"
}
},
"confirmResetModal": {
"title": "Reset Modifications",
"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.",
"continue": "Continue",
"cancel": "Cancel"
},
"submitStatus": {
"success": "Collection created successfully."
},
"formButtons": {
"save": "Create Collection",
"cancel": "Cancel"
},
"notAllowedToCreateCollection": "You do not have permissions to create a collection within this collection."
}
2 changes: 1 addition & 1 deletion public/locales/en/editCollectionGeneralInfo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"pageTitle": "Edit Collection General Information",
"pageTitle": "Edit Collection",
"notAllowedToEditCollection": "You do not have permissions to edit a collection within this collection."
}
81 changes: 81 additions & 0 deletions public/locales/en/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,86 @@
"editMode": "Save Changes"
},
"cancelButton": "Cancel"
},
"collectionForm": {
"fields": {
"hostCollection": {
"label": "Host Collection",
"description": "The collection which contains this data.",
"required": "Host Collection is required"
},
"name": {
"label": "Collection Name",
"description": "The project, department, university, professor, or journal this collection will contain data for.",
"required": "Collection Name is required"
},
"affiliation": {
"label": "Affiliation",
"description": "The organization with which this collection is affiliated."
},
"alias": {
"label": "Identifier",
"description": "Short name used for the URL of this collection.",
"required": "Identifier is required",
"invalid": {
"format": "Identifier is not valid. Valid characters are a-Z, 0-9, '_', and '-'.",
"maxLength": "Identifier must be at most {{maxLength}} characters."
},
"suggestion": "Psst... try this"
},
"storage": {
"label": "Storage",
"description": "A storage service to be used for datasets in this collection."
},
"type": {
"label": "Category",
"description": "The type that most closely reflects this collection.",
"required": "Category is required"
},
"description": {
"label": "Description",
"description": "A summary describing the purpose, nature or scope of this collection.",
"subLabel": "This field supports only certain <htmlTooltip>HTML tags</htmlTooltip>.",
"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>"
},
"contacts": {
"label": "Email",
"description": "The email address(es) of the contact(s) for the collection.",
"required": "Email is required",
"invalid": "Email is not a valid email"
},
"metadataFields": {
"sectionLabel": "Metadata Fields",
"helperText": "Choose the metadata fields to use in dataset templates and when adding a dataset to this collection.",
"useMetadataFieldsFrom": "Use metadata fields from",
"inputLevelsTable": {
"hideTableAriaLabel": "Hide input levels table",
"requiredByDataverse": "Required by Dataverse",
"hidden": "Hidden",
"optional": "Optional",
"required": "Required",
"conditionallyRequired": "Conditionally Required"
}
},
"browseSearchFacets": {
"label": "Browse/Search Facets",
"helperText": "Choose and order the metadata fields to use as facets when browsing this collection.",
"useBrowseSearchFacetsFrom": "Use browse/search facets from",
"selectedFacets": "Selected"
}
},
"confirmResetModal": {
"title": "Reset Modifications",
"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.",
"continue": "Continue",
"cancel": "Cancel"
},
"submitStatus": {
"success": "Collection created successfully."
},
"formButtons": {
"save": "Create Collection",
"cancel": "Cancel"
}
}
}
4 changes: 2 additions & 2 deletions src/sections/Route.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export enum Route {
FILES = '/files',
COLLECTIONS_BASE = '/collections',
COLLECTIONS = '/collections/:collectionId',
CREATE_COLLECTION = '/collections/:ownerCollectionId/create',
CREATE_COLLECTION = '/collections/:parentCollectionId/create',
EDIT_COLLECTION_GENERAL_INFO = '/collections/:collectionId/edit-general-info',
ACCOUNT = '/account'
}

export const RouteWithParams = {
COLLECTIONS: (collectionId?: string) =>
collectionId ? `/collections/${collectionId}` : Route.COLLECTIONS_BASE,
CREATE_COLLECTION: (ownerCollectionId: string) => `/collections/${ownerCollectionId}/create`,
CREATE_COLLECTION: (parentCollectionId: string) => `/collections/${parentCollectionId}/create`,
CREATE_DATASET: (collectionId: string) => `/datasets/${collectionId}/create`,
EDIT_COLLECTION_GENERAL_INFO: (collectionId: string) =>
`/collections/${collectionId}/edit-general-info`
Expand Down
Loading

0 comments on commit 9cd8bea

Please sign in to comment.