From b8fc1f87d4728dc1e1303754308efb8772d29424 Mon Sep 17 00:00:00 2001 From: German Saracca Date: Wed, 20 Mar 2024 17:08:36 -0300 Subject: [PATCH 01/20] feat(DynamicFormFieldsRender): Initial setup with mocked data --- .../domain/models/MetadataBlockInfo.ts | 60 + .../MetadataBlockInfoRepository.ts | 3 +- .../getMetadataBlockInfoByCollectionId.ts | 14 + .../MetadataBlockInfoJSDataverseRepository.ts | 11 +- .../create-dataset/CreateDatasetFactory.tsx | 9 +- .../create-dataset/CreateDatasetForm.tsx | 11 +- ...etadataBlocksInfoByCollectionIdResponse.ts | 3860 +++++++++++++++++ .../useDefineDatasetMetadataFormFields.tsx | 56 + 8 files changed, 4020 insertions(+), 4 deletions(-) create mode 100644 src/metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId.ts create mode 100644 src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts create mode 100644 src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx diff --git a/src/metadata-block-info/domain/models/MetadataBlockInfo.ts b/src/metadata-block-info/domain/models/MetadataBlockInfo.ts index 7fa9e53a3..80229a9aa 100644 --- a/src/metadata-block-info/domain/models/MetadataBlockInfo.ts +++ b/src/metadata-block-info/domain/models/MetadataBlockInfo.ts @@ -11,3 +11,63 @@ export interface MetadataFieldInfo { export const METADATA_FIELD_DISPLAY_FORMAT_PLACEHOLDER = '#VALUE' export const METADATA_FIELD_DISPLAY_FORMAT_NAME_PLACEHOLDER = '#NAME' + +// 👇👇 New types for #336 + +export interface MetadataBlockInfo2 { + id: number + name: string + displayName: string + metadataFields: Record + displayOnCreate?: boolean // If true, the block will be displayed on the create dataset form +} + +export interface MetadataField2 { + name: string + displayName: string + title: string + type: TypeMetadataField + typeClass: TypeClassMetadataField + watermark: WatermarkMetadataField + description: string + multiple: boolean + isControlledVocabulary: boolean + displayFormat: string + isRequired: boolean + displayOrder: number + controlledVocabularyValues?: string[] + childMetadataFields?: Record + displayOnCreate?: boolean // If true, the field will be displayed on the create metadata block +} + +export enum TypeMetadataField { + Date = 'DATE', + Email = 'EMAIL', + Float = 'FLOAT', + Int = 'INT', + None = 'NONE', + Text = 'TEXT', + Textbox = 'TEXTBOX', + URL = 'URL' +} + +export enum TypeClassMetadataField { + Compound = 'compound', + ControlledVocabulary = 'controlledVocabulary', + Primitive = 'primitive' +} + +export enum WatermarkMetadataField { + Empty = '', + EnterAFloatingPointNumber = 'Enter a floating-point number.', + EnterAnInteger = 'Enter an integer.', + FamilyNameGivenNameOrOrganization = 'FamilyName, GivenName or Organization', + HTTPS = 'https://', + NameEmailXyz = 'name@email.xyz', + OrganizationXYZ = 'Organization XYZ', + The1FamilyNameGivenNameOr2Organization = '1) FamilyName, GivenName or 2) Organization', + The1FamilyNameGivenNameOr2OrganizationXYZ = '1) Family Name, Given Name or 2) Organization XYZ', + WatermarkEnterAnInteger = 'Enter an integer...', + YYYYOrYYYYMMOrYYYYMMDD = 'YYYY or YYYY-MM or YYYY-MM-DD', + YyyyMmDD = 'YYYY-MM-DD' +} diff --git a/src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository.ts b/src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository.ts index 51cb5579f..f90b0dfea 100644 --- a/src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository.ts +++ b/src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository.ts @@ -1,5 +1,6 @@ -import { MetadataBlockInfo } from '../models/MetadataBlockInfo' +import { MetadataBlockInfo, MetadataBlockInfo2 } from '../models/MetadataBlockInfo' export interface MetadataBlockInfoRepository { getByName: (name: string) => Promise + getByColecctionId: (collectionId: string, create: boolean) => Promise } diff --git a/src/metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId.ts b/src/metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId.ts new file mode 100644 index 000000000..0a9c049d4 --- /dev/null +++ b/src/metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId.ts @@ -0,0 +1,14 @@ +import { MetadataBlockInfo2 } from '../models/MetadataBlockInfo' +import { MetadataBlockInfoRepository } from '../repositories/MetadataBlockInfoRepository' + +export async function getMetadataBlockInfoByCollectionId( + metadataBlockInfoRepository: MetadataBlockInfoRepository, + collectionId: string, + create: boolean +): Promise { + return metadataBlockInfoRepository + .getByColecctionId(collectionId, create) + .catch((error: Error) => { + throw new Error(error.message) + }) +} diff --git a/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts b/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts index 2071898c9..9b8327af1 100644 --- a/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts +++ b/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts @@ -1,11 +1,12 @@ import { MetadataBlockInfoRepository } from '../../domain/repositories/MetadataBlockInfoRepository' -import { MetadataBlockInfo } from '../../domain/models/MetadataBlockInfo' +import { MetadataBlockInfo, MetadataBlockInfo2 } from '../../domain/models/MetadataBlockInfo' import { getMetadataBlockByName, MetadataBlock as JSMetadataBlockInfo, ReadError } from '@iqss/dataverse-client-javascript' import { JSMetadataBlockInfoMapper } from '../mappers/JSMetadataBlockInfoMapper' +import { metadataBlocksInfoByCollectionIdResponse } from '../../../sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse' export class MetadataBlockInfoJSDataverseRepository implements MetadataBlockInfoRepository { getByName(name: string): Promise { @@ -18,4 +19,12 @@ export class MetadataBlockInfoJSDataverseRepository implements MetadataBlockInfo throw new Error(error.message) }) } + + getByColecctionId(_collectionId: string, _create: boolean): Promise { + return new Promise((resolve) => { + setTimeout(() => { + resolve(metadataBlocksInfoByCollectionIdResponse) + }, 1_000) + }) + } } diff --git a/src/sections/create-dataset/CreateDatasetFactory.tsx b/src/sections/create-dataset/CreateDatasetFactory.tsx index f3c81186e..52b1e8e07 100644 --- a/src/sections/create-dataset/CreateDatasetFactory.tsx +++ b/src/sections/create-dataset/CreateDatasetFactory.tsx @@ -1,11 +1,18 @@ import { CreateDatasetForm } from './CreateDatasetForm' import { ReactElement } from 'react' import { DatasetJSDataverseRepository } from '../../dataset/infrastructure/repositories/DatasetJSDataverseRepository' +import { MetadataBlockInfoJSDataverseRepository } from '../../metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository' const repository = new DatasetJSDataverseRepository() +const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository() export class CreateDatasetFactory { static create(): ReactElement { - return + return ( + + ) } } diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 3a9800754..5ed8b4c34 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -7,23 +7,32 @@ import { useCreateDatasetForm, SubmissionStatus } from './useCreateDatasetForm' import styles from '/src/sections/dataset/Dataset.module.scss' import { useLoading } from '../loading/LoadingContext' import { DatasetRepository } from '../../dataset/domain/repositories/DatasetRepository' +import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' import { useDatasetFormData } from './useDatasetFormData' import { Route } from '../Route.enum' import { useNavigate } from 'react-router-dom' import { useDatasetValidator } from './useDatasetValidator' import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' +import { useDefineDatasetMetadataFormFields } from './useDefineDatasetMetadataFormFields' interface CreateDatasetFormProps { repository: DatasetRepository + metadataBlockInfoRepository: MetadataBlockInfoRepository } -export function CreateDatasetForm({ repository }: CreateDatasetFormProps) { +export function CreateDatasetForm({ + repository, + metadataBlockInfoRepository +}: CreateDatasetFormProps) { const navigate = useNavigate() const { t } = useTranslation('createDataset') const { isLoading, setIsLoading } = useLoading() const { validationErrors, datasetIsValid } = useDatasetValidator() const { formData, updateFormData } = useDatasetFormData(datasetIsValid) const { submissionStatus, submitForm } = useCreateDatasetForm(repository, datasetIsValid) + const { fieldsToRender, isLoading: isLoadingFieldsToRender } = useDefineDatasetMetadataFormFields( + metadataBlockInfoRepository + ) const handleFieldChange = (event: ChangeEvent) => { const { name, checked } = event.target diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts new file mode 100644 index 000000000..00134fbd9 --- /dev/null +++ b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts @@ -0,0 +1,3860 @@ +import { MetadataBlockInfo2 } from '../../../metadata-block-info/domain/models/MetadataBlockInfo' + +export const metadataBlocksInfoByCollectionIdResponse = [ + { + id: 1, + name: 'citation', + displayName: 'Citation Metadata', + displayOnCreate: true, + metadataFields: { + title: { + name: 'title', + displayName: 'Title', + title: 'Title', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The main title of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOnCreate: true, + displayOrder: 0 + }, + subtitle: { + name: 'subtitle', + displayName: 'Subtitle', + title: 'Subtitle', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'A secondary title that amplifies or states certain limitations on the main title', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + displayOnCreate: true, + isRequired: false, + displayOrder: 1 + }, + alternativeTitle: { + name: 'alternativeTitle', + displayName: 'Alternative Title', + title: 'Alternative Title', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Either 1) a title commonly used to refer to the Dataset or 2) an abbreviation of the main title', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + alternativeURL: { + name: 'alternativeURL', + displayName: 'Alternative URL', + title: 'Alternative URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + 'Another URL where one can view or access the data in the Dataset, e.g. a project or personal webpage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + otherId: { + name: 'otherId', + displayName: 'Other Identifier', + title: 'Other Identifier', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + "Another unique identifier for the Dataset (e.g. producer's or another repository's identifier)", + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 4, + displayOnCreate: true, + childMetadataFields: { + otherIdAgency: { + name: 'otherIdAgency', + displayName: 'Other Identifier Agency', + title: 'Agency', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the agency that generated the other identifier', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 5 + }, + otherIdValue: { + name: 'otherIdValue', + displayName: 'Other Identifier Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Another identifier uniquely identifies the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 6 + } + } + }, + author: { + name: 'author', + displayName: 'Author', + title: 'Author', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'The entity, e.g. a person or organization, that created the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 7, + displayOnCreate: true, + childMetadataFields: { + authorName: { + name: 'authorName', + displayName: 'Author Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) Family Name, Given Name or 2) Organization XYZ', + description: + "The name of the author, such as the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOrder: 8 + }, + authorAffiliation: { + name: 'authorAffiliation', + displayName: 'Author Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the author, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 9 + }, + authorIdentifierScheme: { + name: 'authorIdentifierScheme', + displayName: 'Author Identifier Type', + title: 'Identifier Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The type of identifier that uniquely identifies the author (e.g. ORCID, ISNI)', + multiple: false, + isControlledVocabulary: true, + displayFormat: '- #VALUE:', + isRequired: false, + displayOrder: 10, + controlledVocabularyValues: [ + 'ORCID', + 'ISNI', + 'LCNA', + 'VIAF', + 'GND', + 'DAI', + 'ResearcherID', + 'ScopusID' + ] + }, + authorIdentifier: { + name: 'authorIdentifier', + displayName: 'Author Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Uniquely identifies the author when paired with an identifier type', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 11 + } + } + }, + datasetContact: { + name: 'datasetContact', + displayName: 'Point of Contact', + title: 'Point of Contact', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, e.g. a person or organization, that users of the Dataset can contact with questions', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 12, + displayOnCreate: true, + childMetadataFields: { + datasetContactName: { + name: 'datasetContactName', + displayName: 'Point of Contact Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the point of contact, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 13 + }, + datasetContactAffiliation: { + name: 'datasetContactAffiliation', + displayName: 'Point of Contact Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the point of contact, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 14 + }, + datasetContactEmail: { + name: 'datasetContactEmail', + displayName: 'Point of Contact E-mail', + title: 'E-mail', + type: 'EMAIL', + typeClass: 'primitive', + watermark: 'name@email.xyz', + description: "The point of contact's email address", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#EMAIL', + isRequired: true, + displayOrder: 15 + } + } + }, + dsDescription: { + name: 'dsDescription', + displayName: 'Description', + title: 'Description', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'A summary describing the purpose, nature, and scope of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 16, + displayOnCreate: true, + childMetadataFields: { + dsDescriptionValue: { + name: 'dsDescriptionValue', + displayName: 'Description Text', + title: 'Text', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'A summary describing the purpose, nature, and scope of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOrder: 17 + }, + dsDescriptionDate: { + name: 'dsDescriptionDate', + displayName: 'Description Date', + title: 'Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 18 + } + } + }, + subject: { + name: 'subject', + displayName: 'Subject', + title: 'Subject', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The area of study relevant to the Dataset', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: true, + displayOrder: 19, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Agricultural Sciences', + 'Arts and Humanities', + 'Astronomy and Astrophysics', + 'Business and Management', + 'Chemistry', + 'Computer and Information Science', + 'Earth and Environmental Sciences', + 'Engineering', + 'Law', + 'Mathematical Sciences', + 'Medicine, Health and Life Sciences', + 'Physics', + 'Social Sciences', + 'Other' + ] + }, + keyword: { + name: 'keyword', + displayName: 'Keyword', + title: 'Keyword', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 20, + displayOnCreate: true, + childMetadataFields: { + keywordValue: { + name: 'keywordValue', + displayName: 'Keyword Term', + title: 'Term', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'A key term that describes important aspects of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 21 + }, + keywordVocabulary: { + name: 'keywordVocabulary', + displayName: 'Keyword Controlled Vocabulary Name', + title: 'Controlled Vocabulary Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 22 + }, + keywordVocabularyURI: { + name: 'keywordVocabularyURI', + displayName: 'Keyword Controlled Vocabulary URL', + title: 'Controlled Vocabulary URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL where one can access information about the term's controlled vocabulary", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 23 + } + } + }, + topicClassification: { + name: 'topicClassification', + displayName: 'Topic Classification', + title: 'Topic Classification', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24, + displayOnCreate: true, + childMetadataFields: { + topicClassValue: { + name: 'topicClassValue', + displayName: 'Topic Classification Term', + title: 'Term', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'A topic or subject term', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 25 + }, + topicClassVocab: { + name: 'topicClassVocab', + displayName: 'Topic Classification Controlled Vocabulary Name', + title: 'Controlled Vocabulary Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 26 + }, + topicClassVocabURI: { + name: 'topicClassVocabURI', + displayName: 'Topic Classification Controlled Vocabulary URL', + title: 'Controlled Vocabulary URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL where one can access information about the term's controlled vocabulary", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 27 + } + } + }, + publication: { + name: 'publication', + displayName: 'Related Publication', + title: 'Related Publication', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The article or report that uses the data in the Dataset. The full list of related publications will be displayed on the metadata tab', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 28, + displayOnCreate: true, + childMetadataFields: { + publicationCitation: { + name: 'publicationCitation', + displayName: 'Related Publication Citation', + title: 'Citation', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'The full bibliographic citation for the related publication', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 29 + }, + publicationIDType: { + name: 'publicationIDType', + displayName: 'Related Publication Identifier Type', + title: 'Identifier Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The type of identifier that uniquely identifies a related publication', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE: ', + isRequired: false, + displayOrder: 30, + controlledVocabularyValues: [ + 'ark', + 'arXiv', + 'bibcode', + 'cstr', + 'doi', + 'ean13', + 'eissn', + 'handle', + 'isbn', + 'issn', + 'istc', + 'lissn', + 'lsid', + 'pmid', + 'purl', + 'upc', + 'url', + 'urn', + 'DASH-NRS' + ] + }, + publicationIDNumber: { + name: 'publicationIDNumber', + displayName: 'Related Publication Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The identifier for a related publication', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 31 + }, + publicationURL: { + name: 'publicationURL', + displayName: 'Related Publication URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + 'The URL form of the identifier entered in the Identifier field, e.g. the DOI URL if a DOI was entered in the Identifier field. Used to display what was entered in the ID Type and ID Number fields as a link. If what was entered in the Identifier field has no URL form, the URL of the publication webpage is used, e.g. a journal article webpage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 32 + } + } + }, + notesText: { + name: 'notesText', + displayName: 'Notes', + title: 'Notes', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Additional information about the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 33, + displayOnCreate: true + }, + language: { + name: 'language', + displayName: 'Language', + title: 'Language', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: "A language that the Dataset's files is written in", + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 34, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Abkhaz', + 'Afar', + 'Afrikaans', + 'Akan', + 'Albanian', + 'Amharic', + 'Arabic', + 'Aragonese', + 'Armenian', + 'Assamese', + 'Avaric', + 'Avestan', + 'Aymara', + 'Azerbaijani', + 'Bambara', + 'Bashkir', + 'Basque', + 'Belarusian', + 'Bengali, Bangla', + 'Bihari', + 'Bislama', + 'Bosnian', + 'Breton', + 'Bulgarian', + 'Burmese', + 'Catalan,Valencian', + 'Chamorro', + 'Chechen', + 'Chichewa, Chewa, Nyanja', + 'Chinese', + 'Chuvash', + 'Cornish', + 'Corsican', + 'Cree', + 'Croatian', + 'Czech', + 'Danish', + 'Divehi, Dhivehi, Maldivian', + 'Dutch', + 'Dzongkha', + 'English', + 'Esperanto', + 'Estonian', + 'Ewe', + 'Faroese', + 'Fijian', + 'Finnish', + 'French', + 'Fula, Fulah, Pulaar, Pular', + 'Galician', + 'Georgian', + 'German', + 'Greek (modern)', + 'Guaraní', + 'Gujarati', + 'Haitian, Haitian Creole', + 'Hausa', + 'Hebrew (modern)', + 'Herero', + 'Hindi', + 'Hiri Motu', + 'Hungarian', + 'Interlingua', + 'Indonesian', + 'Interlingue', + 'Irish', + 'Igbo', + 'Inupiaq', + 'Ido', + 'Icelandic', + 'Italian', + 'Inuktitut', + 'Japanese', + 'Javanese', + 'Kalaallisut, Greenlandic', + 'Kannada', + 'Kanuri', + 'Kashmiri', + 'Kazakh', + 'Khmer', + 'Kikuyu, Gikuyu', + 'Kinyarwanda', + 'Kyrgyz', + 'Komi', + 'Kongo', + 'Korean', + 'Kurdish', + 'Kwanyama, Kuanyama', + 'Latin', + 'Luxembourgish, Letzeburgesch', + 'Ganda', + 'Limburgish, Limburgan, Limburger', + 'Lingala', + 'Lao', + 'Lithuanian', + 'Luba-Katanga', + 'Latvian', + 'Manx', + 'Macedonian', + 'Malagasy', + 'Malay', + 'Malayalam', + 'Maltese', + 'Māori', + 'Marathi (Marāṭhī)', + 'Marshallese', + 'Mixtepec Mixtec', + 'Mongolian', + 'Nauru', + 'Navajo, Navaho', + 'Northern Ndebele', + 'Nepali', + 'Ndonga', + 'Norwegian Bokmål', + 'Norwegian Nynorsk', + 'Norwegian', + 'Nuosu', + 'Southern Ndebele', + 'Occitan', + 'Ojibwe, Ojibwa', + 'Old Church Slavonic,Church Slavonic,Old Bulgarian', + 'Oromo', + 'Oriya', + 'Ossetian, Ossetic', + 'Panjabi, Punjabi', + 'Pāli', + 'Persian (Farsi)', + 'Polish', + 'Pashto, Pushto', + 'Portuguese', + 'Quechua', + 'Romansh', + 'Kirundi', + 'Romanian', + 'Russian', + 'Sanskrit (Saṁskṛta)', + 'Sardinian', + 'Sindhi', + 'Northern Sami', + 'Samoan', + 'Sango', + 'Serbian', + 'Scottish Gaelic, Gaelic', + 'Shona', + 'Sinhala, Sinhalese', + 'Slovak', + 'Slovene', + 'Somali', + 'Southern Sotho', + 'Spanish, Castilian', + 'Sundanese', + 'Swahili', + 'Swati', + 'Swedish', + 'Tamil', + 'Telugu', + 'Tajik', + 'Thai', + 'Tigrinya', + 'Tibetan Standard, Tibetan, Central', + 'Turkmen', + 'Tagalog', + 'Tswana', + 'Tonga (Tonga Islands)', + 'Turkish', + 'Tsonga', + 'Tatar', + 'Twi', + 'Tahitian', + 'Uyghur, Uighur', + 'Ukrainian', + 'Urdu', + 'Uzbek', + 'Venda', + 'Vietnamese', + 'Volapük', + 'Walloon', + 'Welsh', + 'Wolof', + 'Western Frisian', + 'Xhosa', + 'Yiddish', + 'Yoruba', + 'Zhuang, Chuang', + 'Zulu', + 'Not applicable' + ] + }, + producer: { + name: 'producer', + displayName: 'Producer', + title: 'Producer', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such a person or organization, managing the finances or other administrative processes involved in the creation of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 35, + displayOnCreate: true, + childMetadataFields: { + producerName: { + name: 'producerName', + displayName: 'Producer Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the entity, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOrder: 36 + }, + producerAffiliation: { + name: 'producerAffiliation', + displayName: 'Producer Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the producer, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 37 + }, + producerAbbreviation: { + name: 'producerAbbreviation', + displayName: 'Producer Abbreviated Name', + title: 'Abbreviated Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: "The producer's abbreviated name (e.g. IQSS, ICPSR)", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 38 + }, + producerURL: { + name: 'producerURL', + displayName: 'Producer URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the producer's website", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 39 + }, + producerLogoURL: { + name: 'producerLogoURL', + displayName: 'Producer Logo URL', + title: 'Logo URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the producer's logo", + multiple: false, + isControlledVocabulary: false, + displayFormat: '
', + isRequired: false, + displayOrder: 40 + } + } + }, + productionDate: { + name: 'productionDate', + displayName: 'Production Date', + title: 'Production Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the data were produced (not distributed, published, or archived)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 41 + }, + productionPlace: { + name: 'productionPlace', + displayName: 'Production Location', + title: 'Production Location', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The location where the data and any related materials were produced or collected', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 42 + }, + contributor: { + name: 'contributor', + displayName: 'Contributor', + title: 'Contributor', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 43, + childMetadataFields: { + contributorType: { + name: 'contributorType', + displayName: 'Contributor Type', + title: 'Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Indicates the type of contribution made to the dataset', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE ', + isRequired: false, + displayOrder: 44, + controlledVocabularyValues: [ + 'Data Collector', + 'Data Curator', + 'Data Manager', + 'Editor', + 'Funder', + 'Hosting Institution', + 'Project Leader', + 'Project Manager', + 'Project Member', + 'Related Person', + 'Researcher', + 'Research Group', + 'Rights Holder', + 'Sponsor', + 'Supervisor', + 'Work Package Leader', + 'Other' + ] + }, + contributorName: { + name: 'contributorName', + displayName: 'Contributor Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the contributor, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 45 + } + } + }, + grantNumber: { + name: 'grantNumber', + displayName: 'Funding Information', + title: 'Funding Information', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: "Information about the Dataset's financial support", + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 46, + childMetadataFields: { + grantNumberAgency: { + name: 'grantNumberAgency', + displayName: 'Funding Information Agency', + title: 'Agency', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: 'The agency that provided financial support for the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 47 + }, + grantNumberValue: { + name: 'grantNumberValue', + displayName: 'Funding Information Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The grant identifier or contract identifier of the agency that provided financial support for the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 48 + } + } + }, + distributor: { + name: 'distributor', + displayName: 'Distributor', + title: 'Distributor', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such as a person or organization, designated to generate copies of the Dataset, including any editions or revisions', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 49, + childMetadataFields: { + distributorName: { + name: 'distributorName', + displayName: 'Distributor Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the entity, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 50 + }, + distributorAffiliation: { + name: 'distributorAffiliation', + displayName: 'Distributor Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the distributor, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 51 + }, + distributorAbbreviation: { + name: 'distributorAbbreviation', + displayName: 'Distributor Abbreviated Name', + title: 'Abbreviated Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: "The distributor's abbreviated name (e.g. IQSS, ICPSR)", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOrder: 52 + }, + distributorURL: { + name: 'distributorURL', + displayName: 'Distributor URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the distributor's webpage", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 53 + }, + distributorLogoURL: { + name: 'distributorLogoURL', + displayName: 'Distributor Logo URL', + title: 'Logo URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL of the distributor's logo image, used to show the image on the Dataset's page", + multiple: false, + isControlledVocabulary: false, + displayFormat: '
', + isRequired: false, + displayOrder: 54 + } + } + }, + distributionDate: { + name: 'distributionDate', + displayName: 'Distribution Date', + title: 'Distribution Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the Dataset was made available for distribution/presentation', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 55 + }, + depositor: { + name: 'depositor', + displayName: 'Depositor', + title: 'Depositor', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + 'The entity, such as a person or organization, that deposited the Dataset in the repository', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 56 + }, + dateOfDeposit: { + name: 'dateOfDeposit', + displayName: 'Deposit Date', + title: 'Deposit Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the Dataset was deposited into the repository', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 57 + }, + timePeriodCovered: { + name: 'timePeriodCovered', + displayName: 'Time Period', + title: 'Time Period', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The time period that the data refer to. Also known as span. This is the time period covered by the data, not the dates of coding, collecting data, or making documents machine-readable', + multiple: true, + isControlledVocabulary: false, + displayFormat: ';', + isRequired: false, + displayOrder: 58, + childMetadataFields: { + timePeriodCoveredStart: { + name: 'timePeriodCoveredStart', + displayName: 'Time Period Start Date', + title: 'Start Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The start date of the time period that the data refer to', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOrder: 59 + }, + timePeriodCoveredEnd: { + name: 'timePeriodCoveredEnd', + displayName: 'Time Period End Date', + title: 'End Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The end date of the time period that the data refer to', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOrder: 60 + } + } + }, + dateOfCollection: { + name: 'dateOfCollection', + displayName: 'Date of Collection', + title: 'Date of Collection', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'The dates when the data were collected or generated', + multiple: true, + isControlledVocabulary: false, + displayFormat: ';', + isRequired: false, + displayOrder: 61, + childMetadataFields: { + dateOfCollectionStart: { + name: 'dateOfCollectionStart', + displayName: 'Date of Collection Start Date', + title: 'Start Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the data collection started', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOrder: 62 + }, + dateOfCollectionEnd: { + name: 'dateOfCollectionEnd', + displayName: 'Date of Collection End Date', + title: 'End Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the data collection ended', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOrder: 63 + } + } + }, + kindOfData: { + name: 'kindOfData', + displayName: 'Data Type', + title: 'Data Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The type of data included in the files (e.g. survey data, clinical data, or machine-readable text)', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 64 + }, + series: { + name: 'series', + displayName: 'Series', + title: 'Series', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'Information about the dataset series to which the Dataset belong', + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 65, + childMetadataFields: { + seriesName: { + name: 'seriesName', + displayName: 'Series Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the dataset series', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 66 + }, + seriesInformation: { + name: 'seriesInformation', + displayName: 'Series Information', + title: 'Information', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Can include 1) a history of the series and 2) a summary of features that apply to the series', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 67 + } + } + }, + software: { + name: 'software', + displayName: 'Software', + title: 'Software', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'Information about the software used to generate the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: ',', + isRequired: false, + displayOrder: 68, + childMetadataFields: { + softwareName: { + name: 'softwareName', + displayName: 'Software Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of software used to generate the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOrder: 69 + }, + softwareVersion: { + name: 'softwareVersion', + displayName: 'Software Version', + title: 'Version', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The version of the software used to generate the Dataset, e.g. 4.11', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE', + isRequired: false, + displayOrder: 70 + } + } + }, + relatedMaterial: { + name: 'relatedMaterial', + displayName: 'Related Material', + title: 'Related Material', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about the material related to the Dataset, such as appendices or sampling information available outside of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 71 + }, + relatedDatasets: { + name: 'relatedDatasets', + displayName: 'Related Dataset', + title: 'Related Dataset', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + "Information, such as a persistent ID or citation, about a related dataset, such as previous research on the Dataset's subject", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 72 + }, + otherReferences: { + name: 'otherReferences', + displayName: 'Other Reference', + title: 'Other Reference', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about another type of resource that provides background or supporting material to the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 73 + }, + dataSources: { + name: 'dataSources', + displayName: 'Data Source', + title: 'Data Source', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about sources of the Dataset (e.g. a book, article, serial, or machine-readable data file)', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 74 + }, + originOfSources: { + name: 'originOfSources', + displayName: 'Origin of Historical Sources', + title: 'Origin of Historical Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'For historical sources, the origin and any rules followed in establishing them as sources', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 75 + }, + characteristicOfSources: { + name: 'characteristicOfSources', + displayName: 'Characteristic of Sources', + title: 'Characteristic of Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Characteristics not already noted elsewhere', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 76 + }, + accessToSources: { + name: 'accessToSources', + displayName: 'Documentation and Access to Sources', + title: 'Documentation and Access to Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + '1) Methods or procedures for accessing data sources and 2) any special permissions needed for access', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 77 + } + } + }, + { + id: 2, + name: 'geospatial', + displayName: 'Geospatial Metadata', + displayOnCreate: false, + metadataFields: { + geographicCoverage: { + name: 'geographicCoverage', + displayName: 'Geographic Coverage', + title: 'Geographic Coverage', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Information on the geographic coverage of the data. Includes the total geographic scope of the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0, + childMetadataFields: { + country: { + name: 'country', + displayName: 'Geographic Coverage Country / Nation', + title: 'Country / Nation', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The country or nation that the Dataset is about.', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 1, + controlledVocabularyValues: [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'American Samoa', + 'Andorra', + 'Angola', + 'Anguilla', + 'Antarctica', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Aruba', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bermuda', + 'Bhutan', + 'Bolivia, Plurinational State of', + 'Bonaire, Sint Eustatius and Saba', + 'Bosnia and Herzegovina', + 'Botswana', + 'Bouvet Island', + 'Brazil', + 'British Indian Ocean Territory', + 'Brunei Darussalam', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Cayman Islands', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Christmas Island', + 'Cocos (Keeling) Islands', + 'Colombia', + 'Comoros', + 'Congo', + 'Congo, the Democratic Republic of the', + 'Cook Islands', + 'Costa Rica', + 'Croatia', + 'Cuba', + 'Curaçao', + 'Cyprus', + 'Czech Republic', + "Côte d'Ivoire", + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Falkland Islands (Malvinas)', + 'Faroe Islands', + 'Fiji', + 'Finland', + 'France', + 'French Guiana', + 'French Polynesia', + 'French Southern Territories', + 'Gabon', + 'Gambia', + 'Georgia', + 'Germany', + 'Ghana', + 'Gibraltar', + 'Greece', + 'Greenland', + 'Grenada', + 'Guadeloupe', + 'Guam', + 'Guatemala', + 'Guernsey', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Heard Island and Mcdonald Islands', + 'Holy See (Vatican City State)', + 'Honduras', + 'Hong Kong', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran, Islamic Republic of', + 'Iraq', + 'Ireland', + 'Isle of Man', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jersey', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + "Korea, Democratic People's Republic of", + 'Korea, Republic of', + 'Kuwait', + 'Kyrgyzstan', + "Lao People's Democratic Republic", + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macao', + 'Macedonia, the Former Yugoslav Republic of', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Martinique', + 'Mauritania', + 'Mauritius', + 'Mayotte', + 'Mexico', + 'Micronesia, Federated States of', + 'Moldova, Republic of', + 'Monaco', + 'Mongolia', + 'Montenegro', + 'Montserrat', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Caledonia', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Niue', + 'Norfolk Island', + 'Northern Mariana Islands', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Palestine, State of', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Pitcairn', + 'Poland', + 'Portugal', + 'Puerto Rico', + 'Qatar', + 'Romania', + 'Russian Federation', + 'Rwanda', + 'Réunion', + 'Saint Barthélemy', + 'Saint Helena, Ascension and Tristan da Cunha', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Martin (French part)', + 'Saint Pierre and Miquelon', + 'Saint Vincent and the Grenadines', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Sint Maarten (Dutch part)', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'South Georgia and the South Sandwich Islands', + 'South Sudan', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Svalbard and Jan Mayen', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syrian Arab Republic', + 'Taiwan, Province of China', + 'Tajikistan', + 'Tanzania, United Republic of', + 'Thailand', + 'Timor-Leste', + 'Togo', + 'Tokelau', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Turks and Caicos Islands', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'United States Minor Outlying Islands', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Venezuela, Bolivarian Republic of', + 'Viet Nam', + 'Virgin Islands, British', + 'Virgin Islands, U.S.', + 'Wallis and Futuna', + 'Western Sahara', + 'Yemen', + 'Zambia', + 'Zimbabwe', + 'Åland Islands' + ] + }, + state: { + name: 'state', + displayName: 'Geographic Coverage State / Province', + title: 'State / Province', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 2 + }, + city: { + name: 'city', + displayName: 'Geographic Coverage City', + title: 'City', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 3 + }, + otherGeographicCoverage: { + name: 'otherGeographicCoverage', + displayName: 'Geographic Coverage Other', + title: 'Other', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Other information on the geographic coverage of the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 4 + } + } + }, + country: { + name: 'country', + displayName: 'Geographic Coverage Country / Nation', + title: 'Country / Nation', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The country or nation that the Dataset is about.', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 1, + controlledVocabularyValues: [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'American Samoa', + 'Andorra', + 'Angola', + 'Anguilla', + 'Antarctica', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Aruba', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bermuda', + 'Bhutan', + 'Bolivia, Plurinational State of', + 'Bonaire, Sint Eustatius and Saba', + 'Bosnia and Herzegovina', + 'Botswana', + 'Bouvet Island', + 'Brazil', + 'British Indian Ocean Territory', + 'Brunei Darussalam', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Cayman Islands', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Christmas Island', + 'Cocos (Keeling) Islands', + 'Colombia', + 'Comoros', + 'Congo', + 'Congo, the Democratic Republic of the', + 'Cook Islands', + 'Costa Rica', + 'Croatia', + 'Cuba', + 'Curaçao', + 'Cyprus', + 'Czech Republic', + "Côte d'Ivoire", + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Falkland Islands (Malvinas)', + 'Faroe Islands', + 'Fiji', + 'Finland', + 'France', + 'French Guiana', + 'French Polynesia', + 'French Southern Territories', + 'Gabon', + 'Gambia', + 'Georgia', + 'Germany', + 'Ghana', + 'Gibraltar', + 'Greece', + 'Greenland', + 'Grenada', + 'Guadeloupe', + 'Guam', + 'Guatemala', + 'Guernsey', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Heard Island and Mcdonald Islands', + 'Holy See (Vatican City State)', + 'Honduras', + 'Hong Kong', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran, Islamic Republic of', + 'Iraq', + 'Ireland', + 'Isle of Man', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jersey', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + "Korea, Democratic People's Republic of", + 'Korea, Republic of', + 'Kuwait', + 'Kyrgyzstan', + "Lao People's Democratic Republic", + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macao', + 'Macedonia, the Former Yugoslav Republic of', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Martinique', + 'Mauritania', + 'Mauritius', + 'Mayotte', + 'Mexico', + 'Micronesia, Federated States of', + 'Moldova, Republic of', + 'Monaco', + 'Mongolia', + 'Montenegro', + 'Montserrat', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Caledonia', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Niue', + 'Norfolk Island', + 'Northern Mariana Islands', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Palestine, State of', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Pitcairn', + 'Poland', + 'Portugal', + 'Puerto Rico', + 'Qatar', + 'Romania', + 'Russian Federation', + 'Rwanda', + 'Réunion', + 'Saint Barthélemy', + 'Saint Helena, Ascension and Tristan da Cunha', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Martin (French part)', + 'Saint Pierre and Miquelon', + 'Saint Vincent and the Grenadines', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Sint Maarten (Dutch part)', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'South Georgia and the South Sandwich Islands', + 'South Sudan', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Svalbard and Jan Mayen', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syrian Arab Republic', + 'Taiwan, Province of China', + 'Tajikistan', + 'Tanzania, United Republic of', + 'Thailand', + 'Timor-Leste', + 'Togo', + 'Tokelau', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Turks and Caicos Islands', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'United States Minor Outlying Islands', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Venezuela, Bolivarian Republic of', + 'Viet Nam', + 'Virgin Islands, British', + 'Virgin Islands, U.S.', + 'Wallis and Futuna', + 'Western Sahara', + 'Yemen', + 'Zambia', + 'Zimbabwe', + 'Åland Islands' + ] + }, + state: { + name: 'state', + displayName: 'Geographic Coverage State / Province', + title: 'State / Province', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 2 + }, + city: { + name: 'city', + displayName: 'Geographic Coverage City', + title: 'City', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 3 + }, + otherGeographicCoverage: { + name: 'otherGeographicCoverage', + displayName: 'Geographic Coverage Other', + title: 'Other', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Other information on the geographic coverage of the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 4 + }, + geographicUnit: { + name: 'geographicUnit', + displayName: 'Geographic Unit', + title: 'Geographic Unit', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Lowest level of geographic aggregation covered by the Dataset, e.g., village, county, region.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 5 + }, + geographicBoundingBox: { + name: 'geographicBoundingBox', + displayName: 'Geographic Bounding Box', + title: 'Geographic Bounding Box', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + "The fundamental geometric description for any Dataset that models geography is the geographic bounding box. It describes the minimum box, defined by west and east longitudes and north and south latitudes, which includes the largest geographic extent of the Dataset's geographic coverage. This element is used in the first pass of a coordinate-based search. Inclusion of this element in the codebook is recommended, but is required if the bound polygon box is included. ", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 6, + childMetadataFields: { + westLongitude: { + name: 'westLongitude', + displayName: 'Geographic Bounding Box Westernmost (Left) Longitude', + title: 'Westernmost (Left) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 7 + }, + eastLongitude: { + name: 'eastLongitude', + displayName: 'Geographic Bounding Box Easternmost (Right) Longitude', + title: 'Easternmost (Right) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 8 + }, + northLatitude: { + name: 'northLatitude', + displayName: 'Geographic Bounding Box Northernmost (Top) Latitude', + title: 'Northernmost (Top) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9 + }, + southLatitude: { + name: 'southLatitude', + displayName: 'Geographic Bounding Box Southernmost (Bottom) Latitude', + title: 'Southernmost (Bottom) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 10 + } + } + }, + westLongitude: { + name: 'westLongitude', + displayName: 'Geographic Bounding Box Westernmost (Left) Longitude', + title: 'Westernmost (Left) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 7 + }, + eastLongitude: { + name: 'eastLongitude', + displayName: 'Geographic Bounding Box Easternmost (Right) Longitude', + title: 'Easternmost (Right) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 8 + }, + northLatitude: { + name: 'northLatitude', + displayName: 'Geographic Bounding Box Northernmost (Top) Latitude', + title: 'Northernmost (Top) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9 + }, + southLatitude: { + name: 'southLatitude', + displayName: 'Geographic Bounding Box Southernmost (Bottom) Latitude', + title: 'Southernmost (Bottom) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 10 + } + } + }, + { + id: 4, + name: 'astrophysics', + displayName: 'Astronomy and Astrophysics Metadata', + displayOnCreate: false, + metadataFields: { + astroType: { + name: 'astroType', + displayName: 'Type', + title: 'Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The nature or genre of the content of the files in the dataset.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 0, + controlledVocabularyValues: [ + 'Image', + 'Mosaic', + 'EventList', + 'Spectrum', + 'Cube', + 'Table', + 'Catalog', + 'LightCurve', + 'Simulation', + 'Figure', + 'Artwork', + 'Animation', + 'PrettyPicture', + 'Documentation', + 'Other', + 'Library', + 'Press Release', + 'Facsimile', + 'Historical', + 'Observation', + 'Object', + 'Value', + 'ValuePair', + 'Survey' + ] + }, + astroFacility: { + name: 'astroFacility', + displayName: 'Facility', + title: 'Facility', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The observatory or facility where the data was obtained. ', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 1 + }, + astroInstrument: { + name: 'astroInstrument', + displayName: 'Instrument', + title: 'Instrument', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The instrument used to collect the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 2 + }, + astroObject: { + name: 'astroObject', + displayName: 'Object', + title: 'Object', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Astronomical Objects represented in the data (Given as SIMBAD recognizable names preferred).', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 3 + }, + 'resolution.Spatial': { + name: 'resolution.Spatial', + displayName: 'Spatial Resolution', + title: 'Spatial Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The spatial (angular) resolution that is typical of the observations, in decimal degrees.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 4 + }, + 'resolution.Spectral': { + name: 'resolution.Spectral', + displayName: 'Spectral Resolution', + title: 'Spectral Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The spectral resolution that is typical of the observations, given as the ratio \\u03bb/\\u0394\\u03bb.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 5 + }, + 'resolution.Temporal': { + name: 'resolution.Temporal', + displayName: 'Time Resolution', + title: 'Time Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The temporal resolution that is typical of the observations, given in seconds.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 6 + }, + 'coverage.Spectral.Bandpass': { + name: 'coverage.Spectral.Bandpass', + displayName: 'Bandpass', + title: 'Bandpass', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Conventional bandpass name', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 7 + }, + 'coverage.Spectral.CentralWavelength': { + name: 'coverage.Spectral.CentralWavelength', + displayName: 'Central Wavelength (m)', + title: 'Central Wavelength (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The central wavelength of the spectral bandpass, in meters.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 8 + }, + 'coverage.Spectral.Wavelength': { + name: 'coverage.Spectral.Wavelength', + displayName: 'Wavelength Range', + title: 'Wavelength Range', + type: 'NONE', + typeClass: 'compound', + watermark: 'Enter a floating-point number.', + description: 'The minimum and maximum wavelength of the spectral bandpass.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9, + childMetadataFields: { + 'coverage.Spectral.MinimumWavelength': { + name: 'coverage.Spectral.MinimumWavelength', + displayName: 'Wavelength Range Minimum (m)', + title: 'Minimum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The minimum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 10 + }, + 'coverage.Spectral.MaximumWavelength': { + name: 'coverage.Spectral.MaximumWavelength', + displayName: 'Wavelength Range Maximum (m)', + title: 'Maximum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The maximum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 11 + } + } + }, + 'coverage.Spectral.MinimumWavelength': { + name: 'coverage.Spectral.MinimumWavelength', + displayName: 'Wavelength Range Minimum (m)', + title: 'Minimum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The minimum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 10 + }, + 'coverage.Spectral.MaximumWavelength': { + name: 'coverage.Spectral.MaximumWavelength', + displayName: 'Wavelength Range Maximum (m)', + title: 'Maximum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The maximum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 11 + }, + 'coverage.Temporal': { + name: 'coverage.Temporal', + displayName: 'Dataset Date Range', + title: 'Dataset Date Range', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: ' Time period covered by the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 12, + childMetadataFields: { + 'coverage.Temporal.StartTime': { + name: 'coverage.Temporal.StartTime', + displayName: 'Dataset Date Range Start', + title: 'Start', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset Start Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 13 + }, + 'coverage.Temporal.StopTime': { + name: 'coverage.Temporal.StopTime', + displayName: 'Dataset Date Range End', + title: 'End', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset End Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 14 + } + } + }, + 'coverage.Temporal.StartTime': { + name: 'coverage.Temporal.StartTime', + displayName: 'Dataset Date Range Start', + title: 'Start', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset Start Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 13 + }, + 'coverage.Temporal.StopTime': { + name: 'coverage.Temporal.StopTime', + displayName: 'Dataset Date Range End', + title: 'End', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset End Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 14 + }, + 'coverage.Spatial': { + name: 'coverage.Spatial', + displayName: 'Sky Coverage', + title: 'Sky Coverage', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The sky coverage of the data object.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 15 + }, + 'coverage.Depth': { + name: 'coverage.Depth', + displayName: 'Depth Coverage', + title: 'Depth Coverage', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The (typical) depth coverage, or sensitivity, of the data object in Jy.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 16 + }, + 'coverage.ObjectDensity': { + name: 'coverage.ObjectDensity', + displayName: 'Object Density', + title: 'Object Density', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The (typical) density of objects, catalog entries, telescope pointings, etc., on the sky, in number per square degree.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 17 + }, + 'coverage.ObjectCount': { + name: 'coverage.ObjectCount', + displayName: 'Object Count', + title: 'Object Count', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer.', + description: 'The total number of objects, catalog entries, etc., in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 18 + }, + 'coverage.SkyFraction': { + name: 'coverage.SkyFraction', + displayName: 'Fraction of Sky', + title: 'Fraction of Sky', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The fraction of the sky represented in the observations, ranging from 0 to 1.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 19 + }, + 'coverage.Polarization': { + name: 'coverage.Polarization', + displayName: 'Polarization', + title: 'Polarization', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The polarization coverage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 20 + }, + redshiftType: { + name: 'redshiftType', + displayName: 'RedshiftType', + title: 'RedshiftType', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'RedshiftType string C "Redshift"; or "Optical" or "Radio" definitions of Doppler velocity used in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 21 + }, + 'resolution.Redshift': { + name: 'resolution.Redshift', + displayName: 'Redshift Resolution', + title: 'Redshift Resolution', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The resolution in redshift (unitless) or Doppler velocity (km/s) in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 22 + }, + 'coverage.RedshiftValue': { + name: 'coverage.RedshiftValue', + displayName: 'Redshift Value', + title: 'Redshift Value', + type: 'FLOAT', + typeClass: 'compound', + watermark: 'Enter a floating-point number.', + description: + 'The value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 23, + childMetadataFields: { + 'coverage.Redshift.MinimumValue': { + name: 'coverage.Redshift.MinimumValue', + displayName: 'Redshift Value Minimum', + title: 'Minimum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The minimum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24 + }, + 'coverage.Redshift.MaximumValue': { + name: 'coverage.Redshift.MaximumValue', + displayName: 'Redshift Value Maximum', + title: 'Maximum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The maximum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 25 + } + } + }, + 'coverage.Redshift.MinimumValue': { + name: 'coverage.Redshift.MinimumValue', + displayName: 'Redshift Value Minimum', + title: 'Minimum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The minimum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24 + }, + 'coverage.Redshift.MaximumValue': { + name: 'coverage.Redshift.MaximumValue', + displayName: 'Redshift Value Maximum', + title: 'Maximum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The maximum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 25 + } + } + }, + { + id: 5, + name: 'biomedical', + displayName: 'Life Sciences Metadata', + displayOnCreate: false, + metadataFields: { + studyDesignType: { + name: 'studyDesignType', + displayName: 'Design Type', + title: 'Design Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Design types that are based on the overall experimental design.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 0, + controlledVocabularyValues: [ + 'Case Control', + 'Cross Sectional', + 'Cohort Study', + 'Nested Case Control Design', + 'Not Specified', + 'Parallel Group Design', + 'Perturbation Design', + 'Randomized Controlled Trial', + 'Technological Design', + 'Other' + ] + }, + studyOtherDesignType: { + name: 'studyOtherDesignType', + displayName: 'Other Design Type', + title: 'Other Design Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Design Type, list any other design types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 1 + }, + studyFactorType: { + name: 'studyFactorType', + displayName: 'Factor Type', + title: 'Factor Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Factors used in the Dataset.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 2, + controlledVocabularyValues: [ + 'Age', + 'Biomarkers', + 'Cell Surface Markers', + 'Cell Type/Cell Line', + 'Developmental Stage', + 'Disease State', + 'Drug Susceptibility', + 'Extract Molecule', + 'Genetic Characteristics', + 'Immunoprecipitation Antibody', + 'Organism', + 'Passages', + 'Platform', + 'Sex', + 'Strain', + 'Time Point', + 'Tissue Type', + 'Treatment Compound', + 'Treatment Type', + 'Other' + ] + }, + studyOtherFactorType: { + name: 'studyOtherFactorType', + displayName: 'Other Factor Type', + title: 'Other Factor Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Factor Type, list any other factor types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 3 + }, + studyAssayOrganism: { + name: 'studyAssayOrganism', + displayName: 'Organism', + title: 'Organism', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The taxonomic name of the organism used in the Dataset or from which the starting biological material derives.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 4, + controlledVocabularyValues: [ + 'Arabidopsis thaliana', + 'Bos taurus', + 'Caenorhabditis elegans', + 'Chlamydomonas reinhardtii', + 'Danio rerio (zebrafish)', + 'Dictyostelium discoideum', + 'Drosophila melanogaster', + 'Escherichia coli', + 'Hepatitis C virus', + 'Homo sapiens', + 'Mus musculus', + 'Mycobacterium africanum', + 'Mycobacterium canetti', + 'Mycobacterium tuberculosis', + 'Mycoplasma pneumoniae', + 'Oryza sativa', + 'Plasmodium falciparum', + 'Pneumocystis carinii', + 'Rattus norvegicus', + "Saccharomyces cerevisiae (brewer's yeast)", + 'Schizosaccharomyces pombe', + 'Takifugu rubripes', + 'Xenopus laevis', + 'Zea mays', + 'Other' + ] + }, + studyAssayOtherOrganism: { + name: 'studyAssayOtherOrganism', + displayName: 'Other Organism', + title: 'Other Organism', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Organism, list any other organisms that were used in this Dataset. Terms from the NCBI Taxonomy are recommended.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 5 + }, + studyAssayMeasurementType: { + name: 'studyAssayMeasurementType', + displayName: 'Measurement Type', + title: 'Measurement Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'A term to qualify the endpoint, or what is being measured (e.g. gene expression profiling; protein identification).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 6, + controlledVocabularyValues: [ + 'cell sorting', + 'clinical chemistry analysis', + 'copy number variation profiling', + 'DNA methylation profiling', + 'DNA methylation profiling (Bisulfite-Seq)', + 'DNA methylation profiling (MeDIP-Seq)', + 'drug susceptibility', + 'environmental gene survey', + 'genome sequencing', + 'hematology', + 'histology', + 'Histone Modification (ChIP-Seq)', + 'loss of heterozygosity profiling', + 'metabolite profiling', + 'metagenome sequencing', + 'protein expression profiling', + 'protein identification', + 'protein-DNA binding site identification', + 'protein-protein interaction detection', + 'protein-RNA binding (RIP-Seq)', + 'SNP analysis', + 'targeted sequencing', + 'transcription factor binding (ChIP-Seq)', + 'transcription factor binding site identification', + 'transcription profiling', + 'transcription profiling (Microarray)', + 'transcription profiling (RNA-Seq)', + 'TRAP translational profiling', + 'Other' + ] + }, + studyAssayOtherMeasurmentType: { + name: 'studyAssayOtherMeasurmentType', + displayName: 'Other Measurement Type', + title: 'Other Measurement Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Measurement Type, list any other measurement types that were used. Terms from NCBO Bioportal are recommended.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 7 + }, + studyAssayTechnologyType: { + name: 'studyAssayTechnologyType', + displayName: 'Technology Type', + title: 'Technology Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'A term to identify the technology used to perform the measurement (e.g. DNA microarray; mass spectrometry).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 8, + controlledVocabularyValues: [ + 'culture based drug susceptibility testing, single concentration', + 'culture based drug susceptibility testing, two concentrations', + 'culture based drug susceptibility testing, three or more concentrations (minimium inhibitory concentration measurement)', + 'DNA microarray', + 'flow cytometry', + 'gel electrophoresis', + 'mass spectrometry', + 'NMR spectroscopy', + 'nucleotide sequencing', + 'protein microarray', + 'real time PCR', + 'no technology required', + 'Other' + ] + }, + studyAssayOtherTechnologyType: { + name: 'studyAssayOtherTechnologyType', + displayName: 'Other Technology Type', + title: 'Other Technology Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Technology Type, list any other technology types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9 + }, + studyAssayPlatform: { + name: 'studyAssayPlatform', + displayName: 'Technology Platform', + title: 'Technology Platform', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The manufacturer and name of the technology platform used in the assay (e.g. Bruker AVANCE).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 10, + controlledVocabularyValues: [ + '210-MS GC Ion Trap (Varian)', + '220-MS GC Ion Trap (Varian)', + '225-MS GC Ion Trap (Varian)', + '240-MS GC Ion Trap (Varian)', + '300-MS quadrupole GC/MS (Varian)', + '320-MS LC/MS (Varian)', + '325-MS LC/MS (Varian)', + '320-MS GC/MS (Varian)', + '500-MS LC/MS (Varian)', + '800D (Jeol)', + '910-MS TQ-FT (Varian)', + '920-MS TQ-FT (Varian)', + '3100 Mass Detector (Waters)', + '6110 Quadrupole LC/MS (Agilent)', + '6120 Quadrupole LC/MS (Agilent)', + '6130 Quadrupole LC/MS (Agilent)', + '6140 Quadrupole LC/MS (Agilent)', + '6310 Ion Trap LC/MS (Agilent)', + '6320 Ion Trap LC/MS (Agilent)', + '6330 Ion Trap LC/MS (Agilent)', + '6340 Ion Trap LC/MS (Agilent)', + '6410 Triple Quadrupole LC/MS (Agilent)', + '6430 Triple Quadrupole LC/MS (Agilent)', + '6460 Triple Quadrupole LC/MS (Agilent)', + '6490 Triple Quadrupole LC/MS (Agilent)', + '6530 Q-TOF LC/MS (Agilent)', + '6540 Q-TOF LC/MS (Agilent)', + '6210 TOF LC/MS (Agilent)', + '6220 TOF LC/MS (Agilent)', + '6230 TOF LC/MS (Agilent)', + '7000B Triple Quadrupole GC/MS (Agilent)', + 'AccuTO DART (Jeol)', + 'AccuTOF GC (Jeol)', + 'AccuTOF LC (Jeol)', + 'ACQUITY SQD (Waters)', + 'ACQUITY TQD (Waters)', + 'Agilent', + 'Agilent 5975E GC/MSD (Agilent)', + 'Agilent 5975T LTM GC/MSD (Agilent)', + '5975C Series GC/MSD (Agilent)', + 'Affymetrix', + 'amaZon ETD ESI Ion Trap (Bruker)', + 'amaZon X ESI Ion Trap (Bruker)', + 'apex-ultra hybrid Qq-FTMS (Bruker)', + 'API 2000 (AB Sciex)', + 'API 3200 (AB Sciex)', + 'API 3200 QTRAP (AB Sciex)', + 'API 4000 (AB Sciex)', + 'API 4000 QTRAP (AB Sciex)', + 'API 5000 (AB Sciex)', + 'API 5500 (AB Sciex)', + 'API 5500 QTRAP (AB Sciex)', + 'Applied Biosystems Group (ABI)', + 'AQI Biosciences', + 'Atmospheric Pressure GC (Waters)', + 'autoflex III MALDI-TOF MS (Bruker)', + 'autoflex speed(Bruker)', + 'AutoSpec Premier (Waters)', + 'AXIMA Mega TOF (Shimadzu)', + 'AXIMA Performance MALDI TOF/TOF (Shimadzu)', + 'A-10 Analyzer (Apogee)', + 'A-40-MiniFCM (Apogee)', + 'Bactiflow (Chemunex SA)', + 'Base4innovation', + 'BD BACTEC MGIT 320', + 'BD BACTEC MGIT 960', + 'BD Radiometric BACTEC 460TB', + 'BioNanomatrix', + 'Cell Lab Quanta SC (Becman Coulter)', + 'Clarus 560 D GC/MS (PerkinElmer)', + 'Clarus 560 S GC/MS (PerkinElmer)', + 'Clarus 600 GC/MS (PerkinElmer)', + 'Complete Genomics', + 'Cyan (Dako Cytomation)', + 'CyFlow ML (Partec)', + 'Cyow SL (Partec)', + 'CyFlow SL3 (Partec)', + 'CytoBuoy (Cyto Buoy Inc)', + 'CytoSence (Cyto Buoy Inc)', + 'CytoSub (Cyto Buoy Inc)', + 'Danaher', + 'DFS (Thermo Scientific)', + 'Exactive(Thermo Scientific)', + 'FACS Canto (Becton Dickinson)', + 'FACS Canto2 (Becton Dickinson)', + 'FACS Scan (Becton Dickinson)', + 'FC 500 (Becman Coulter)', + 'GCmate II GC/MS (Jeol)', + 'GCMS-QP2010 Plus (Shimadzu)', + 'GCMS-QP2010S Plus (Shimadzu)', + 'GCT Premier (Waters)', + 'GENEQ', + 'Genome Corp.', + 'GenoVoxx', + 'GnuBio', + 'Guava EasyCyte Mini (Millipore)', + 'Guava EasyCyte Plus (Millipore)', + 'Guava Personal Cell Analysis (Millipore)', + 'Guava Personal Cell Analysis-96 (Millipore)', + 'Helicos BioSciences', + 'Illumina', + 'Indirect proportion method on LJ medium', + 'Indirect proportion method on Middlebrook Agar 7H9', + 'Indirect proportion method on Middlebrook Agar 7H10', + 'Indirect proportion method on Middlebrook Agar 7H11', + 'inFlux Analyzer (Cytopeia)', + 'Intelligent Bio-Systems', + 'ITQ 700 (Thermo Scientific)', + 'ITQ 900 (Thermo Scientific)', + 'ITQ 1100 (Thermo Scientific)', + 'JMS-53000 SpiralTOF (Jeol)', + 'LaserGen', + 'LCMS-2020 (Shimadzu)', + 'LCMS-2010EV (Shimadzu)', + 'LCMS-IT-TOF (Shimadzu)', + 'Li-Cor', + 'Life Tech', + 'LightSpeed Genomics', + 'LCT Premier XE (Waters)', + 'LCQ Deca XP MAX (Thermo Scientific)', + 'LCQ Fleet (Thermo Scientific)', + 'LXQ (Thermo Scientific)', + 'LTQ Classic (Thermo Scientific)', + 'LTQ XL (Thermo Scientific)', + 'LTQ Velos (Thermo Scientific)', + 'LTQ Orbitrap Classic (Thermo Scientific)', + 'LTQ Orbitrap XL (Thermo Scientific)', + 'LTQ Orbitrap Discovery (Thermo Scientific)', + 'LTQ Orbitrap Velos (Thermo Scientific)', + 'Luminex 100 (Luminex)', + 'Luminex 200 (Luminex)', + 'MACS Quant (Miltenyi)', + 'MALDI SYNAPT G2 HDMS (Waters)', + 'MALDI SYNAPT G2 MS (Waters)', + 'MALDI SYNAPT HDMS (Waters)', + 'MALDI SYNAPT MS (Waters)', + 'MALDI micro MX (Waters)', + 'maXis (Bruker)', + 'maXis G4 (Bruker)', + 'microflex LT MALDI-TOF MS (Bruker)', + 'microflex LRF MALDI-TOF MS (Bruker)', + 'microflex III MALDI-TOF MS (Bruker)', + 'micrOTOF II ESI TOF (Bruker)', + 'micrOTOF-Q II ESI-Qq-TOF (Bruker)', + 'microplate Alamar Blue (resazurin) colorimetric method', + 'Mstation (Jeol)', + 'MSQ Plus (Thermo Scientific)', + 'NABsys', + 'Nanophotonics Biosciences', + 'Network Biosystems', + 'Nimblegen', + 'Oxford Nanopore Technologies', + 'Pacific Biosciences', + 'Population Genetics Technologies', + 'Q1000GC UltraQuad (Jeol)', + 'Quattro micro API (Waters)', + 'Quattro micro GC (Waters)', + 'Quattro Premier XE (Waters)', + 'QSTAR (AB Sciex)', + 'Reveo', + 'Roche', + 'Seirad', + 'solariX hybrid Qq-FTMS (Bruker)', + 'Somacount (Bently Instruments)', + 'SomaScope (Bently Instruments)', + 'SYNAPT G2 HDMS (Waters)', + 'SYNAPT G2 MS (Waters)', + 'SYNAPT HDMS (Waters)', + 'SYNAPT MS (Waters)', + 'TripleTOF 5600 (AB Sciex)', + 'TSQ Quantum Ultra (Thermo Scientific)', + 'TSQ Quantum Access (Thermo Scientific)', + 'TSQ Quantum Access MAX (Thermo Scientific)', + 'TSQ Quantum Discovery MAX (Thermo Scientific)', + 'TSQ Quantum GC (Thermo Scientific)', + 'TSQ Quantum XLS (Thermo Scientific)', + 'TSQ Vantage (Thermo Scientific)', + 'ultrafleXtreme MALDI-TOF MS (Bruker)', + 'VisiGen Biotechnologies', + 'Xevo G2 QTOF (Waters)', + 'Xevo QTof MS (Waters)', + 'Xevo TQ MS (Waters)', + 'Xevo TQ-S (Waters)', + 'Other' + ] + }, + studyAssayOtherPlatform: { + name: 'studyAssayOtherPlatform', + displayName: 'Other Technology Platform', + title: 'Other Technology Platform', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Technology Platform, list any other technology platforms that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 11 + }, + studyAssayCellType: { + name: 'studyAssayCellType', + displayName: 'Cell Type', + title: 'Cell Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the cell line from which the source or sample derives.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 12 + } + } + }, + { + id: 6, + name: 'journal', + displayName: 'Journal Metadata', + displayOnCreate: false, + metadataFields: { + journalVolumeIssue: { + name: 'journalVolumeIssue', + displayName: 'Journal', + title: 'Journal', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Indicates the volume, issue and date of a journal, which this Dataset is associated with.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0, + childMetadataFields: { + journalVolume: { + name: 'journalVolume', + displayName: 'Journal Volume', + title: 'Volume', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The journal volume which this Dataset is associated with (e.g., Volume 4).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 1 + }, + journalIssue: { + name: 'journalIssue', + displayName: 'Journal Issue', + title: 'Issue', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The journal issue number which this Dataset is associated with (e.g., Number 2, Autumn).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 2 + }, + journalPubDate: { + name: 'journalPubDate', + displayName: 'Journal Publication Date', + title: 'Publication Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY or YYYY-MM or YYYY-MM-DD', + description: + 'The publication date for this journal volume/issue, which this Dataset is associated with (e.g., 1999).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 3 + } + } + }, + journalVolume: { + name: 'journalVolume', + displayName: 'Journal Volume', + title: 'Volume', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The journal volume which this Dataset is associated with (e.g., Volume 4).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 1 + }, + journalIssue: { + name: 'journalIssue', + displayName: 'Journal Issue', + title: 'Issue', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The journal issue number which this Dataset is associated with (e.g., Number 2, Autumn).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 2 + }, + journalPubDate: { + name: 'journalPubDate', + displayName: 'Journal Publication Date', + title: 'Publication Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY or YYYY-MM or YYYY-MM-DD', + description: + 'The publication date for this journal volume/issue, which this Dataset is associated with (e.g., 1999).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 3 + }, + journalArticleType: { + name: 'journalArticleType', + displayName: 'Type of Article', + title: 'Type of Article', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'Indicates what kind of article this is, for example, a research article, a commentary, a book or product review, a case report, a calendar, etc (based on JATS). ', + multiple: false, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 4, + controlledVocabularyValues: [ + 'abstract', + 'addendum', + 'announcement', + 'article-commentary', + 'book review', + 'books received', + 'brief report', + 'calendar', + 'case report', + 'collection', + 'correction', + 'data paper', + 'discussion', + 'dissertation', + 'editorial', + 'in brief', + 'introduction', + 'letter', + 'meeting report', + 'news', + 'obituary', + 'oration', + 'partial retraction', + 'product review', + 'rapid communication', + 'reply', + 'reprint', + 'research article', + 'retraction', + 'review article', + 'translation', + 'other' + ] + } + } + }, + { + id: 3, + name: 'socialscience', + displayName: 'Social Science and Humanities Metadata', + displayOnCreate: false, + metadataFields: { + unitOfAnalysis: { + name: 'unitOfAnalysis', + displayName: 'Unit of Analysis', + title: 'Unit of Analysis', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + "Basic unit of analysis or observation that this Dataset describes, such as individuals, families/households, groups, institutions/organizations, administrative units, and more. For information about the DDI's controlled vocabulary for this element, please refer to the DDI web page at http://www.ddialliance.org/controlled-vocabularies.", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0 + }, + universe: { + name: 'universe', + displayName: 'Universe', + title: 'Universe', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Description of the population covered by the data in the file; the group of people or other elements that are the object of the study and to which the study results refer. Age, nationality, and residence commonly help to delineate a given universe, but any number of other factors may be used, such as age limits, sex, marital status, race, ethnic group, nationality, income, veteran status, criminal convictions, and more. The universe may consist of elements other than persons, such as housing units, court cases, deaths, countries, and so on. In general, it should be possible to tell from the description of the universe whether a given individual or element is a member of the population under study. Also known as the universe of interest, population of interest, and target population.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 1 + }, + timeMethod: { + name: 'timeMethod', + displayName: 'Time Method', + title: 'Time Method', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The time method or time dimension of the data collection, such as panel, cross-sectional, trend, time- series, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 2 + }, + dataCollector: { + name: 'dataCollector', + displayName: 'Data Collector', + title: 'Data Collector', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'FamilyName, GivenName or Organization', + description: + 'Individual, agency or organization responsible for administering the questionnaire or interview or compiling the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 3 + }, + collectorTraining: { + name: 'collectorTraining', + displayName: 'Collector Training', + title: 'Collector Training', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Type of training provided to the data collector', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 4 + }, + frequencyOfDataCollection: { + name: 'frequencyOfDataCollection', + displayName: 'Frequency', + title: 'Frequency', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If the data collected includes more than one point in time, indicate the frequency with which the data was collected; that is, monthly, quarterly, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 5 + }, + samplingProcedure: { + name: 'samplingProcedure', + displayName: 'Sampling Procedure', + title: 'Sampling Procedure', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Type of sample and sample design used to select the survey respondents to represent the population. May include reference to the target sample size and the sampling fraction.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 6 + }, + targetSampleSize: { + name: 'targetSampleSize', + displayName: 'Target Sample Size', + title: 'Target Sample Size', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Specific information regarding the target sample size, actual sample size, and the formula used to determine this.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 7, + childMetadataFields: { + targetSampleActualSize: { + name: 'targetSampleActualSize', + displayName: 'Target Sample Size Actual', + title: 'Actual', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer...', + description: 'Actual sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 8 + }, + targetSampleSizeFormula: { + name: 'targetSampleSizeFormula', + displayName: 'Target Sample Size Formula', + title: 'Formula', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Formula used to determine target sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9 + } + } + }, + targetSampleActualSize: { + name: 'targetSampleActualSize', + displayName: 'Target Sample Size Actual', + title: 'Actual', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer...', + description: 'Actual sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 8 + }, + targetSampleSizeFormula: { + name: 'targetSampleSizeFormula', + displayName: 'Target Sample Size Formula', + title: 'Formula', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Formula used to determine target sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 9 + }, + deviationsFromSampleDesign: { + name: 'deviationsFromSampleDesign', + displayName: 'Major Deviations for Sample Design', + title: 'Major Deviations for Sample Design', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Show correspondence as well as discrepancies between the sampled units (obtained) and available statistics for the population (age, sex-ratio, marital status, etc.) as a whole.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 10 + }, + collectionMode: { + name: 'collectionMode', + displayName: 'Collection Mode', + title: 'Collection Mode', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Method used to collect the data; instrumentation characteristics (e.g., telephone interview, mail questionnaire, or other).', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 11 + }, + researchInstrument: { + name: 'researchInstrument', + displayName: 'Type of Research Instrument', + title: 'Type of Research Instrument', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Type of data collection instrument used. Structured indicates an instrument in which all respondents are asked the same questions/tests, possibly with precoded answers. If a small portion of such a questionnaire includes open-ended questions, provide appropriate comments. Semi-structured indicates that the research instrument contains mainly open-ended questions. Unstructured indicates that in-depth interviews were conducted.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 12 + }, + dataCollectionSituation: { + name: 'dataCollectionSituation', + displayName: 'Characteristics of Data Collection Situation', + title: 'Characteristics of Data Collection Situation', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Description of noteworthy aspects of the data collection situation. Includes information on factors such as cooperativeness of respondents, duration of interviews, number of call backs, or similar.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 13 + }, + actionsToMinimizeLoss: { + name: 'actionsToMinimizeLoss', + displayName: 'Actions to Minimize Losses', + title: 'Actions to Minimize Losses', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Summary of actions taken to minimize data loss. Include information on actions such as follow-up visits, supervisory checks, historical matching, estimation, and so on.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 14 + }, + controlOperations: { + name: 'controlOperations', + displayName: 'Control Operations', + title: 'Control Operations', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Control OperationsMethods to facilitate data control performed by the primary investigator or by the data archive.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 15 + }, + weighting: { + name: 'weighting', + displayName: 'Weighting', + title: 'Weighting', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'The use of sampling procedures might make it necessary to apply weights to produce accurate statistical results. Describes the criteria for using weights in analysis of a collection. If a weighting formula or coefficient was developed, the formula is provided, its elements are defined, and it is indicated how the formula was applied to the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 16 + }, + cleaningOperations: { + name: 'cleaningOperations', + displayName: 'Cleaning Operations', + title: 'Cleaning Operations', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Methods used to clean the data collection, such as consistency checking, wildcode checking, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 17 + }, + datasetLevelErrorNotes: { + name: 'datasetLevelErrorNotes', + displayName: 'Study Level Error Notes', + title: 'Study Level Error Notes', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Note element used for any information annotating or clarifying the methodology and processing of the study. ', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 18 + }, + responseRate: { + name: 'responseRate', + displayName: 'Response Rate', + title: 'Response Rate', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Percentage of sample members who provided information.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 19 + }, + samplingErrorEstimates: { + name: 'samplingErrorEstimates', + displayName: 'Estimates of Sampling Error', + title: 'Estimates of Sampling Error', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Measure of how precisely one can estimate a population value from a given sample.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 20 + }, + otherDataAppraisal: { + name: 'otherDataAppraisal', + displayName: 'Other Forms of Data Appraisal', + title: 'Other Forms of Data Appraisal', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Other issues pertaining to the data appraisal. Describe issues such as response variance, nonresponse rate and testing for bias, interviewer and response bias, confidence levels, question bias, or similar.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 21 + }, + socialScienceNotes: { + name: 'socialScienceNotes', + displayName: 'Notes', + title: 'Notes', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'General notes about this Dataset.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 22, + childMetadataFields: { + socialScienceNotesType: { + name: 'socialScienceNotesType', + displayName: 'Notes Type', + title: 'Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Type of note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 23 + }, + socialScienceNotesSubject: { + name: 'socialScienceNotesSubject', + displayName: 'Notes Subject', + title: 'Subject', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Note subject.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24 + }, + socialScienceNotesText: { + name: 'socialScienceNotesText', + displayName: 'Notes Text', + title: 'Text', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Text for this note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 25 + } + } + }, + socialScienceNotesType: { + name: 'socialScienceNotesType', + displayName: 'Notes Type', + title: 'Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Type of note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 23 + }, + socialScienceNotesSubject: { + name: 'socialScienceNotesSubject', + displayName: 'Notes Subject', + title: 'Subject', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Note subject.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24 + }, + socialScienceNotesText: { + name: 'socialScienceNotesText', + displayName: 'Notes Text', + title: 'Text', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Text for this note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 25 + } + } + } +] as MetadataBlockInfo2[] diff --git a/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx b/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx new file mode 100644 index 000000000..b27b786bf --- /dev/null +++ b/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx @@ -0,0 +1,56 @@ +import { useEffect, useRef, useState } from 'react' +import { getMetadataBlockInfoByCollectionId } from '../../metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId' +import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' + +/* + ** Notes: + - We will check which blocks to display on the create dataset form. (citation, geospatial, etc...) + - We will use the getDatasetMetadataBlockFields use case to get the fields to render according to the Collection Id / Dataverse Id. +*/ + +export const useDefineDatasetMetadataFormFields = ( + metadataBlockInfoRepository: MetadataBlockInfoRepository +) => { + const ref = useRef(false) + const [fieldsToRender, setFieldsToRender] = useState([]) + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) + + useEffect(() => { + const handleGetDatasetMetadataBlockFields = async () => { + setIsLoading(true) + try { + const metadataBlocksInfo = await getMetadataBlockInfoByCollectionId( + metadataBlockInfoRepository, + 'someCitation', + true + ) + console.log(metadataBlocksInfo) + // setFieldsToRender(fields) + // const { data } = await axios.get<{ status: string; data: MetadataBlockInfo2 }>( + // `http://localhost:8000/api/v1/metadatablocks/${MetadataBlockName.CITATION}` + // ) + //const metadataBlockInfo = data.data + } catch (err) { + console.error(err) + const errorMessage = + err instanceof Error && err.message + ? err.message + : 'Something went wrong getting the datasets' + setError(errorMessage) + } finally { + setIsLoading(false) + } + } + // if (!ref.current) { + void handleGetDatasetMetadataBlockFields() + // ref.current = true + // } + }, []) + + return { + fieldsToRender, + error, + isLoading + } +} From c8a788fcf4acae93961adc4892be94fb17c55aa5 Mon Sep 17 00:00:00 2001 From: German Saracca Date: Thu, 21 Mar 2024 13:38:32 -0300 Subject: [PATCH 02/20] feat(DesignSystem): using Accordion own props and extending AccordionItem html attributes --- .../src/lib/components/accordion/Accordion.tsx | 14 +++----------- .../src/lib/components/accordion/AccordionItem.tsx | 10 ++++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/design-system/src/lib/components/accordion/Accordion.tsx b/packages/design-system/src/lib/components/accordion/Accordion.tsx index b42b65513..11dd38c38 100644 --- a/packages/design-system/src/lib/components/accordion/Accordion.tsx +++ b/packages/design-system/src/lib/components/accordion/Accordion.tsx @@ -1,18 +1,10 @@ -import { ReactNode } from 'react' -import { Accordion as AccordionBS } from 'react-bootstrap' +import { Accordion as AccordionBS, AccordionProps as AccordionPropsBS } from 'react-bootstrap' import { AccordionItem } from './AccordionItem' import { AccordionBody } from './AccordionBody' import { AccordionHeader } from './AccordionHeader' - -interface AccordionProps { - defaultActiveKey?: string[] | string - alwaysOpen?: boolean - children: ReactNode -} - -function Accordion({ defaultActiveKey, children, alwaysOpen = false }: AccordionProps) { +function Accordion({ alwaysOpen = false, children, ...rest }: AccordionPropsBS) { return ( - + {children} ) diff --git a/packages/design-system/src/lib/components/accordion/AccordionItem.tsx b/packages/design-system/src/lib/components/accordion/AccordionItem.tsx index 54ce8c6eb..772e5ce4f 100644 --- a/packages/design-system/src/lib/components/accordion/AccordionItem.tsx +++ b/packages/design-system/src/lib/components/accordion/AccordionItem.tsx @@ -1,11 +1,13 @@ -import { ReactNode } from 'react' +import { ElementType, ReactNode } from 'react' import { Accordion as AccordionBS } from 'react-bootstrap' -interface AccordionItemProps { +export interface AccordionItemProps extends React.HTMLAttributes { eventKey: string children: ReactNode + bsPrefix?: string + as?: ElementType } -export function AccordionItem({ eventKey, children }: AccordionItemProps) { - return {children} +export function AccordionItem({ children, ...rest }: AccordionItemProps) { + return {children} } From 099563e21f69a5787e1e11b322621bc39c0f39b5 Mon Sep 17 00:00:00 2001 From: German Saracca Date: Thu, 21 Mar 2024 18:45:10 -0300 Subject: [PATCH 03/20] feat(DynamicFormFieldsRender): filter blocks and fields --- .../CreateDatasetForm.module.scss | 36 ++++++++ .../create-dataset/CreateDatasetForm.tsx | 35 ++++++-- .../MetadataBlockFields/index.tsx | 3 + ...etadataBlocksInfoByCollectionIdResponse.ts | 74 ++++++++++------- .../useDefineDatasetMetadataFormFields.tsx | 56 ------------- .../useGetMetadataBlocksInfo.tsx | 82 +++++++++++++++++++ 6 files changed, 193 insertions(+), 93 deletions(-) create mode 100644 src/sections/create-dataset/CreateDatasetForm.module.scss create mode 100644 src/sections/create-dataset/MetadataBlockFields/index.tsx delete mode 100644 src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx create mode 100644 src/sections/create-dataset/useGetMetadataBlocksInfo.tsx diff --git a/src/sections/create-dataset/CreateDatasetForm.module.scss b/src/sections/create-dataset/CreateDatasetForm.module.scss new file mode 100644 index 000000000..67a718c85 --- /dev/null +++ b/src/sections/create-dataset/CreateDatasetForm.module.scss @@ -0,0 +1,36 @@ +.header { + margin: 0.5em 0; +} + +.container { + // margin: 0.5rem 0; +} + +.metadataAccordionContainer { + // border: solid 2px blue; + + .customAccordion { + display: flex; + flex-direction: column; + gap: 0.75rem; + } + + .customAccordionItem { + border: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color); + border-radius: var(--bs-accordion-border-radius); + + &:not(:first-of-type) { + border-top: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color); + } + + button { + background-image: linear-gradient(to bottom, var(--bs-gray-100) 0, var(--bs-gray-300) 100%); + border-radius: calc(var(--bs-accordion-border-radius) - var(--bs-accordion-border-width)); + + &[aria-expanded='true'] { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + } + } + } +} diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 5ed8b4c34..2bb700173 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -1,10 +1,9 @@ import { ChangeEvent, FormEvent, MouseEvent, useEffect } from 'react' -import { Alert, Button, Form } from '@iqss/dataverse-design-system' +import { Accordion } from '@iqss/dataverse-design-system' import { useTranslation } from 'react-i18next' import { RequiredFieldText } from '../shared/form/RequiredFieldText/RequiredFieldText' import { SeparationLine } from '../shared/layout/SeparationLine/SeparationLine' import { useCreateDatasetForm, SubmissionStatus } from './useCreateDatasetForm' -import styles from '/src/sections/dataset/Dataset.module.scss' import { useLoading } from '../loading/LoadingContext' import { DatasetRepository } from '../../dataset/domain/repositories/DatasetRepository' import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' @@ -12,8 +11,9 @@ import { useDatasetFormData } from './useDatasetFormData' import { Route } from '../Route.enum' import { useNavigate } from 'react-router-dom' import { useDatasetValidator } from './useDatasetValidator' -import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' -import { useDefineDatasetMetadataFormFields } from './useDefineDatasetMetadataFormFields' +import { useGetMetadataBlocksInfo } from './useGetMetadataBlocksInfo' +// import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' +import styles from './CreateDatasetForm.module.scss' interface CreateDatasetFormProps { repository: DatasetRepository @@ -27,12 +27,16 @@ export function CreateDatasetForm({ const navigate = useNavigate() const { t } = useTranslation('createDataset') const { isLoading, setIsLoading } = useLoading() + const { metadataBlocks, isLoading: isLoadingMetadataBlocksToRender } = useGetMetadataBlocksInfo( + metadataBlockInfoRepository, + 'someCollectionId', // TODO:ME Get collection id from url? + 'create' + ) const { validationErrors, datasetIsValid } = useDatasetValidator() const { formData, updateFormData } = useDatasetFormData(datasetIsValid) const { submissionStatus, submitForm } = useCreateDatasetForm(repository, datasetIsValid) - const { fieldsToRender, isLoading: isLoadingFieldsToRender } = useDefineDatasetMetadataFormFields( - metadataBlockInfoRepository - ) + + console.log({ metadataBlocks, isLoadingMetadataBlocksToRender }) const handleFieldChange = (event: ChangeEvent) => { const { name, checked } = event.target @@ -71,7 +75,20 @@ export function CreateDatasetForm({

{t('datasetForm.status.success')}

)} {submissionStatus === SubmissionStatus.Errored &&

{t('datasetForm.status.failed')}

} -
+ + {metadataBlocks.map((metadataBlock) => ( + + {metadataBlock.displayName} + {`Body content for ${metadataBlock.name}`} + + ))} + + + {/* ) => { handleSubmit(event) }}> @@ -264,7 +281,7 @@ export function CreateDatasetForm({ -
+ */} ) diff --git a/src/sections/create-dataset/MetadataBlockFields/index.tsx b/src/sections/create-dataset/MetadataBlockFields/index.tsx new file mode 100644 index 000000000..3042133bf --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFields/index.tsx @@ -0,0 +1,3 @@ +export const MetadataBlockFields = () => { + return
MetadataBlockFields
+} diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts index 00134fbd9..57e1bdec7 100644 --- a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts +++ b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts @@ -34,7 +34,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ multiple: false, isControlledVocabulary: false, displayFormat: '', - displayOnCreate: true, + displayOnCreate: false, isRequired: false, displayOrder: 1 }, @@ -51,7 +51,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: true, + displayOnCreate: false, displayOrder: 2 }, alternativeURL: { @@ -67,7 +67,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, - displayOnCreate: true, + displayOnCreate: false, displayOrder: 3 }, otherId: { @@ -84,7 +84,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 4, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { otherIdAgency: { name: 'otherIdAgency', @@ -129,7 +129,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 7, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { authorName: { name: 'authorName', @@ -216,7 +216,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 12, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { datasetContactName: { name: 'datasetContactName', @@ -277,7 +277,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 16, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { dsDescriptionValue: { name: 'dsDescriptionValue', @@ -323,7 +323,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 19, - displayOnCreate: true, + displayOnCreate: false, controlledVocabularyValues: [ 'Agricultural Sciences', 'Arts and Humanities', @@ -355,7 +355,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 20, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { keywordValue: { name: 'keywordValue', @@ -416,7 +416,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 24, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { topicClassValue: { name: 'topicClassValue', @@ -477,7 +477,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 28, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { publicationCitation: { name: 'publicationCitation', @@ -572,7 +572,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 33, - displayOnCreate: true + displayOnCreate: false }, language: { name: 'language', @@ -587,7 +587,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 34, - displayOnCreate: true, + displayOnCreate: false, controlledVocabularyValues: [ 'Abkhaz', 'Afar', @@ -791,7 +791,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 35, - displayOnCreate: true, + displayOnCreate: false, childMetadataFields: { producerName: { name: 'producerName', @@ -880,7 +880,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: true, + displayOnCreate: false, displayOrder: 41 }, productionPlace: { @@ -896,7 +896,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: true, + displayOnCreate: false, displayOrder: 42 }, contributor: { @@ -913,6 +913,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 43, + displayOnCreate: false, childMetadataFields: { contributorType: { name: 'contributorType', @@ -977,6 +978,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 46, + displayOnCreate: false, childMetadataFields: { grantNumberAgency: { name: 'grantNumberAgency', @@ -1023,6 +1025,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 49, + displayOnCreate: false, childMetadataFields: { distributorName: { name: 'distributorName', @@ -1111,7 +1114,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 55 + displayOrder: 55, + displayOnCreate: false }, depositor: { name: 'depositor', @@ -1126,7 +1130,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 56 + displayOrder: 56, + displayOnCreate: false }, dateOfDeposit: { name: 'dateOfDeposit', @@ -1140,7 +1145,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 57 + displayOrder: 57, + displayOnCreate: false }, timePeriodCovered: { name: 'timePeriodCovered', @@ -1156,6 +1162,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ';', isRequired: false, displayOrder: 58, + displayOnCreate: false, childMetadataFields: { timePeriodCoveredStart: { name: 'timePeriodCoveredStart', @@ -1200,6 +1207,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ';', isRequired: false, displayOrder: 61, + displayOnCreate: false, childMetadataFields: { dateOfCollectionStart: { name: 'dateOfCollectionStart', @@ -1244,7 +1252,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 64 + displayOrder: 64, + displayOnCreate: false }, series: { name: 'series', @@ -1259,6 +1268,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 65, + displayOnCreate: false, childMetadataFields: { seriesName: { name: 'seriesName', @@ -1304,6 +1314,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ',', isRequired: false, displayOrder: 68, + displayOnCreate: false, childMetadataFields: { softwareName: { name: 'softwareName', @@ -1348,7 +1359,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 71 + displayOrder: 71, + displayOnCreate: false }, relatedDatasets: { name: 'relatedDatasets', @@ -1363,7 +1375,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 72 + displayOrder: 72, + displayOnCreate: false }, otherReferences: { name: 'otherReferences', @@ -1378,7 +1391,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 73 + displayOrder: 73, + displayOnCreate: false }, dataSources: { name: 'dataSources', @@ -1393,7 +1407,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 74 + displayOrder: 74, + displayOnCreate: false }, originOfSources: { name: 'originOfSources', @@ -1408,7 +1423,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 75 + displayOrder: 75, + displayOnCreate: false }, characteristicOfSources: { name: 'characteristicOfSources', @@ -1422,7 +1438,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 76 + displayOrder: 76, + displayOnCreate: false }, accessToSources: { name: 'accessToSources', @@ -1437,7 +1454,8 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOrder: 77 + displayOrder: 77, + displayOnCreate: false } } }, @@ -1445,7 +1463,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 2, name: 'geospatial', displayName: 'Geospatial Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { geographicCoverage: { name: 'geographicCoverage', diff --git a/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx b/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx deleted file mode 100644 index b27b786bf..000000000 --- a/src/sections/create-dataset/useDefineDatasetMetadataFormFields.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { useEffect, useRef, useState } from 'react' -import { getMetadataBlockInfoByCollectionId } from '../../metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId' -import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' - -/* - ** Notes: - - We will check which blocks to display on the create dataset form. (citation, geospatial, etc...) - - We will use the getDatasetMetadataBlockFields use case to get the fields to render according to the Collection Id / Dataverse Id. -*/ - -export const useDefineDatasetMetadataFormFields = ( - metadataBlockInfoRepository: MetadataBlockInfoRepository -) => { - const ref = useRef(false) - const [fieldsToRender, setFieldsToRender] = useState([]) - const [isLoading, setIsLoading] = useState(true) - const [error, setError] = useState(null) - - useEffect(() => { - const handleGetDatasetMetadataBlockFields = async () => { - setIsLoading(true) - try { - const metadataBlocksInfo = await getMetadataBlockInfoByCollectionId( - metadataBlockInfoRepository, - 'someCitation', - true - ) - console.log(metadataBlocksInfo) - // setFieldsToRender(fields) - // const { data } = await axios.get<{ status: string; data: MetadataBlockInfo2 }>( - // `http://localhost:8000/api/v1/metadatablocks/${MetadataBlockName.CITATION}` - // ) - //const metadataBlockInfo = data.data - } catch (err) { - console.error(err) - const errorMessage = - err instanceof Error && err.message - ? err.message - : 'Something went wrong getting the datasets' - setError(errorMessage) - } finally { - setIsLoading(false) - } - } - // if (!ref.current) { - void handleGetDatasetMetadataBlockFields() - // ref.current = true - // } - }, []) - - return { - fieldsToRender, - error, - isLoading - } -} diff --git a/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx new file mode 100644 index 000000000..8f32c2a6a --- /dev/null +++ b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx @@ -0,0 +1,82 @@ +import { useEffect, useState } from 'react' +import { getMetadataBlockInfoByCollectionId } from '../../metadata-block-info/domain/useCases/getMetadataBlockInfoByCollectionId' +import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' +import { MetadataBlockInfo2 } from '../../metadata-block-info/domain/models/MetadataBlockInfo' + +/** + * Hook to get the metadata blocks to show and its info, based on the parent collection id of the dataset + * + * @param metadataBlockInfoRepository The repository to get the metadata block info + * @param collectionId The id of the collection that the dataset belongs to + * @param mode The mode of the form (create or edit), if edit mode, this hook will return only the metadata blocks that have displayOnCreate set to true + */ + +export const useGetMetadataBlocksInfo = ( + metadataBlockInfoRepository: MetadataBlockInfoRepository, + collectionId: string, + mode: 'create' | 'edit' +) => { + const [metadataBlocks, setMetadataBlocks] = useState([]) + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) + + const onCreateMode = mode === 'create' + + // Filter the metadata blocks to show only the ones that have displayOnCreate set to true and its metadata fields that also have displayOnCreate set to true + const filterMetadataBlocksOnCreateMode = (metadataBlocks: MetadataBlockInfo2[]) => { + return metadataBlocks + .filter((metadataBlockInfo) => metadataBlockInfo.displayOnCreate === true) + .map((metadataBlockInfo) => { + const filteredMetadataFields: MetadataBlockInfo2['metadataFields'] = {} + + for (const field in metadataBlockInfo.metadataFields) { + if ( + field in metadataBlockInfo.metadataFields && + metadataBlockInfo.metadataFields[field].displayOnCreate === true + ) { + filteredMetadataFields[field] = metadataBlockInfo.metadataFields[field] + } + } + + return { + ...metadataBlockInfo, + metadataFields: filteredMetadataFields + } + }) + } + + useEffect(() => { + const handleGetDatasetMetadataBlockFields = async () => { + setIsLoading(true) + try { + const metadataBlocksInfo = await getMetadataBlockInfoByCollectionId( + metadataBlockInfoRepository, + collectionId, + onCreateMode + ) + + setMetadataBlocks( + mode === 'create' + ? filterMetadataBlocksOnCreateMode(metadataBlocksInfo) + : metadataBlocksInfo + ) + } catch (err) { + console.error(err) + const errorMessage = + err instanceof Error && err.message + ? err.message + : 'Something went wrong getting the datasets' + setError(errorMessage) + } finally { + setIsLoading(false) + } + } + void handleGetDatasetMetadataBlockFields() + }, []) + + return { + metadataBlocks, + error, + isLoading + } +} From 21846c221f350d993035316c1234e2c0129cabff Mon Sep 17 00:00:00 2001 From: German Saracca Date: Fri, 22 Mar 2024 09:29:33 -0300 Subject: [PATCH 04/20] feat(DynamicFormFieldsRender): remove custom styles from accordion and extend accordion html attributs and props --- .../components/accordion/AccordionBody.tsx | 10 +++++--- .../components/accordion/AccordionHeader.tsx | 11 +++++--- .../CreateDatasetForm.module.scss | 25 ------------------- .../create-dataset/CreateDatasetForm.tsx | 7 ++---- 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/packages/design-system/src/lib/components/accordion/AccordionBody.tsx b/packages/design-system/src/lib/components/accordion/AccordionBody.tsx index 09cbe7ce5..5f437e51f 100644 --- a/packages/design-system/src/lib/components/accordion/AccordionBody.tsx +++ b/packages/design-system/src/lib/components/accordion/AccordionBody.tsx @@ -1,10 +1,12 @@ -import { ReactNode } from 'react' +import { ElementType, ReactNode } from 'react' import { Accordion as AccordionBS } from 'react-bootstrap' -interface AccordionBodyProps { +interface AccordionBodyProps extends React.HTMLAttributes { children: ReactNode + bsPrefix?: string + as?: ElementType } -export function AccordionBody({ children }: AccordionBodyProps) { - return {children} +export function AccordionBody({ children, ...rest }: AccordionBodyProps) { + return {children} } diff --git a/packages/design-system/src/lib/components/accordion/AccordionHeader.tsx b/packages/design-system/src/lib/components/accordion/AccordionHeader.tsx index 521ad0697..a06c10bae 100644 --- a/packages/design-system/src/lib/components/accordion/AccordionHeader.tsx +++ b/packages/design-system/src/lib/components/accordion/AccordionHeader.tsx @@ -1,10 +1,13 @@ -import { ReactNode } from 'react' +import { ElementType, ReactNode } from 'react' import { Accordion as AccordionBS } from 'react-bootstrap' -interface AccordionHeaderProps { +interface AccordionHeaderProps extends React.HTMLAttributes { children: ReactNode + onClick?: () => void + bsPrefix?: string + as?: ElementType } -export function AccordionHeader({ children }: AccordionHeaderProps) { - return {children} +export function AccordionHeader({ children, ...rest }: AccordionHeaderProps) { + return {children} } diff --git a/src/sections/create-dataset/CreateDatasetForm.module.scss b/src/sections/create-dataset/CreateDatasetForm.module.scss index 67a718c85..764526dd3 100644 --- a/src/sections/create-dataset/CreateDatasetForm.module.scss +++ b/src/sections/create-dataset/CreateDatasetForm.module.scss @@ -8,29 +8,4 @@ .metadataAccordionContainer { // border: solid 2px blue; - - .customAccordion { - display: flex; - flex-direction: column; - gap: 0.75rem; - } - - .customAccordionItem { - border: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color); - border-radius: var(--bs-accordion-border-radius); - - &:not(:first-of-type) { - border-top: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color); - } - - button { - background-image: linear-gradient(to bottom, var(--bs-gray-100) 0, var(--bs-gray-300) 100%); - border-radius: calc(var(--bs-accordion-border-radius) - var(--bs-accordion-border-width)); - - &[aria-expanded='true'] { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - } - } - } } diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 2bb700173..3b108e72a 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -76,12 +76,9 @@ export function CreateDatasetForm({ )} {submissionStatus === SubmissionStatus.Errored &&

{t('datasetForm.status.failed')}

}
- + {metadataBlocks.map((metadataBlock) => ( - + {metadataBlock.displayName} {`Body content for ${metadataBlock.name}`} From 68efb2a16f1d223d4eef6ce8fbbfdc7720953a44 Mon Sep 17 00:00:00 2001 From: German Saracca Date: Fri, 22 Mar 2024 17:00:01 -0300 Subject: [PATCH 05/20] feat(DynamicFormFieldsRender): detecting different fields --- .../CreateDatasetForm.module.scss | 4 - .../create-dataset/CreateDatasetForm.tsx | 38 +++--- .../MetadataBlockFields/index.tsx | 3 - .../MetadataFormField/index.tsx | 117 ++++++++++++++++++ .../MetadataBlockFormFields/index.tsx | 18 +++ ...etadataBlocksInfoByCollectionIdResponse.ts | 10 +- .../useGetMetadataBlocksInfo.tsx | 16 ++- 7 files changed, 170 insertions(+), 36 deletions(-) delete mode 100644 src/sections/create-dataset/MetadataBlockFields/index.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/index.tsx diff --git a/src/sections/create-dataset/CreateDatasetForm.module.scss b/src/sections/create-dataset/CreateDatasetForm.module.scss index 764526dd3..75bef91de 100644 --- a/src/sections/create-dataset/CreateDatasetForm.module.scss +++ b/src/sections/create-dataset/CreateDatasetForm.module.scss @@ -5,7 +5,3 @@ .container { // margin: 0.5rem 0; } - -.metadataAccordionContainer { - // border: solid 2px blue; -} diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 3b108e72a..77b6bfd95 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -1,5 +1,5 @@ import { ChangeEvent, FormEvent, MouseEvent, useEffect } from 'react' -import { Accordion } from '@iqss/dataverse-design-system' +import { Form, Accordion } from '@iqss/dataverse-design-system' import { useTranslation } from 'react-i18next' import { RequiredFieldText } from '../shared/form/RequiredFieldText/RequiredFieldText' import { SeparationLine } from '../shared/layout/SeparationLine/SeparationLine' @@ -14,6 +14,7 @@ import { useDatasetValidator } from './useDatasetValidator' import { useGetMetadataBlocksInfo } from './useGetMetadataBlocksInfo' // import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' import styles from './CreateDatasetForm.module.scss' +import { MetadataBlockFormFields } from './MetadataBlockFormFields' interface CreateDatasetFormProps { repository: DatasetRepository @@ -27,17 +28,15 @@ export function CreateDatasetForm({ const navigate = useNavigate() const { t } = useTranslation('createDataset') const { isLoading, setIsLoading } = useLoading() - const { metadataBlocks, isLoading: isLoadingMetadataBlocksToRender } = useGetMetadataBlocksInfo( + const { metadataBlocks, isLoading: isLoadingMetadataBlocksToRender } = useGetMetadataBlocksInfo({ metadataBlockInfoRepository, - 'someCollectionId', // TODO:ME Get collection id from url? - 'create' - ) + collectionId: 'someCollectionId', // TODO:ME Get collection id from url? + mode: 'create' + }) const { validationErrors, datasetIsValid } = useDatasetValidator() const { formData, updateFormData } = useDatasetFormData(datasetIsValid) const { submissionStatus, submitForm } = useCreateDatasetForm(repository, datasetIsValid) - console.log({ metadataBlocks, isLoadingMetadataBlocksToRender }) - const handleFieldChange = (event: ChangeEvent) => { const { name, checked } = event.target const value = event.target.type === 'checkbox' && !checked ? '' : event.target.value @@ -75,20 +74,23 @@ export function CreateDatasetForm({

{t('datasetForm.status.success')}

)} {submissionStatus === SubmissionStatus.Errored &&

{t('datasetForm.status.failed')}

} -
- - {metadataBlocks.map((metadataBlock) => ( - +
) => { + handleSubmit(event) + }}> + {/* METADATA BLOCKS */} + + {metadataBlocks.map((metadataBlock, index) => ( + {metadataBlock.displayName} - {`Body content for ${metadataBlock.name}`} + + + ))} -
- {/* ) => { - handleSubmit(event) - }}> + + {/* {t('datasetForm.fields.title.label')} @@ -278,7 +280,7 @@ export function CreateDatasetForm({ - */} + */}
) diff --git a/src/sections/create-dataset/MetadataBlockFields/index.tsx b/src/sections/create-dataset/MetadataBlockFields/index.tsx deleted file mode 100644 index 3042133bf..000000000 --- a/src/sections/create-dataset/MetadataBlockFields/index.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export const MetadataBlockFields = () => { - return
MetadataBlockFields
-} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx new file mode 100644 index 000000000..f80cd4799 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -0,0 +1,117 @@ +import { Form } from '@iqss/dataverse-design-system' +import { + MetadataField2, + TypeClassMetadataField, + TypeMetadataField +} from '../../../../metadata-block-info/domain/models/MetadataBlockInfo' + +export enum TypeMetadataFieldxx { + Date = 'DATE', + Email = 'EMAIL', + Float = 'FLOAT', + Int = 'INT', + None = 'NONE', + Text = 'TEXT', + Textbox = 'TEXTBOX', + URL = 'URL' +} + +export enum TypeClassMetadataFieldxx { + Compound = 'compound', + ControlledVocabulary = 'controlledVocabulary', + Primitive = 'primitive' +} + +interface Props { + metadataFieldInfo: MetadataField2 +} + +export const MetadataFormField = ({ metadataFieldInfo }: Props) => { + console.log(metadataFieldInfo) + const { + name, + type, + multiple, + typeClass, + isRequired, + displayName, + description, + childMetadataFields, + controlledVocabularyValues + } = metadataFieldInfo + + const isSafeCompound = + typeClass === TypeClassMetadataField.Compound && + childMetadataFields !== undefined && + Object.keys(childMetadataFields).length > 0 + + const isSafeControlledVocabulary = + typeClass === TypeClassMetadataField.ControlledVocabulary && + controlledVocabularyValues !== undefined && + controlledVocabularyValues.length > 0 + + const isSafePrimitive = typeClass === TypeClassMetadataField.Primitive + + if (isSafePrimitive) { + return ( +

+ {`name: ${name} `} + ---isSafePrimitive--- {`type: ${type} typeClass: ${typeClass}`} +

+ ) + } + + if (isSafeCompound) { + return ( +

+ {`name: ${name} `} + ---isSafeCompound--- {`type: ${type} typeClass: ${typeClass}`} +

    + {Object.entries(childMetadataFields).map( + ([childMetadataFieldKey, childMetadataFieldInfo]) => { + return ( +
  • + +
  • + ) + } + )} +
+

+ ) + } + + if (isSafeControlledVocabulary) { + return ( +

+ {`name: ${name} `} + ---isSafeControlledVocabulary--- {`type: ${type} typeClass: ${typeClass}`} +

    + {controlledVocabularyValues.map((controlledVocabularyValue, index) => { + return
  • {controlledVocabularyValue}
  • + })} +
+

+ ) + } + + return

Not implemented

+} + +// return ( +// +// +// {metadataFieldInfo.displayName} +// +// +// +// {/* {t('datasetForm.fields.title.feedback')} */} +// +// +// ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/index.tsx new file mode 100644 index 000000000..7e4d3b898 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/index.tsx @@ -0,0 +1,18 @@ +import { MetadataBlockInfo2 } from '../../../metadata-block-info/domain/models/MetadataBlockInfo' +import { MetadataFormField } from './MetadataFormField' + +interface Props { + metadataBlock: MetadataBlockInfo2 +} + +export const MetadataBlockFormFields = ({ metadataBlock }: Props) => { + const { metadataFields, name: _name } = metadataBlock + + return ( + <> + {Object.entries(metadataFields).map(([metadataFieldKey, metadataFieldInfo]) => { + return + })} + + ) +} diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts index 57e1bdec7..2c49412d4 100644 --- a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts +++ b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts @@ -34,7 +34,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ multiple: false, isControlledVocabulary: false, displayFormat: '', - displayOnCreate: false, + displayOnCreate: true, isRequired: false, displayOrder: 1 }, @@ -67,7 +67,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, - displayOnCreate: false, + displayOnCreate: true, displayOrder: 3 }, otherId: { @@ -129,7 +129,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 7, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { authorName: { name: 'authorName', @@ -323,7 +323,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 19, - displayOnCreate: false, + displayOnCreate: true, controlledVocabularyValues: [ 'Agricultural Sciences', 'Arts and Humanities', @@ -1463,7 +1463,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 2, name: 'geospatial', displayName: 'Geospatial Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { geographicCoverage: { name: 'geographicCoverage', diff --git a/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx index 8f32c2a6a..d8584334b 100644 --- a/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx +++ b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx @@ -3,6 +3,11 @@ import { getMetadataBlockInfoByCollectionId } from '../../metadata-block-info/do import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' import { MetadataBlockInfo2 } from '../../metadata-block-info/domain/models/MetadataBlockInfo' +interface Props { + metadataBlockInfoRepository: MetadataBlockInfoRepository + collectionId: string + mode: 'create' | 'edit' +} /** * Hook to get the metadata blocks to show and its info, based on the parent collection id of the dataset * @@ -10,12 +15,11 @@ import { MetadataBlockInfo2 } from '../../metadata-block-info/domain/models/Meta * @param collectionId The id of the collection that the dataset belongs to * @param mode The mode of the form (create or edit), if edit mode, this hook will return only the metadata blocks that have displayOnCreate set to true */ - -export const useGetMetadataBlocksInfo = ( - metadataBlockInfoRepository: MetadataBlockInfoRepository, - collectionId: string, - mode: 'create' | 'edit' -) => { +export const useGetMetadataBlocksInfo = ({ + metadataBlockInfoRepository, + collectionId, + mode +}: Props) => { const [metadataBlocks, setMetadataBlocks] = useState([]) const [isLoading, setIsLoading] = useState(true) const [error, setError] = useState(null) From 01f7815690d6aae536faf0fcf8189b6258d6333c Mon Sep 17 00:00:00 2001 From: German Saracca Date: Mon, 25 Mar 2024 17:06:46 -0300 Subject: [PATCH 06/20] feat(DynamicFormFieldsRender): Different fields and wrapper --- .../MetadataFormField/Fields/DateField.tsx | 28 +++ .../MetadataFormField/Fields/EmailField.tsx | 28 +++ .../MetadataFormField/Fields/FloatField.tsx | 28 +++ .../MetadataFormField/Fields/IntField.tsx | 28 +++ .../MetadataFormField/Fields/TextBoxField.tsx | 27 +++ .../MetadataFormField/Fields/TextField.tsx | 28 +++ .../MetadataFormField/Fields/UrlField.tsx | 28 +++ .../MetadataFormField/Fields/Vocabulary.tsx | 37 +++ .../MetadataFormField/Fields/index.ts | 8 + .../MetadataFormField/index.module.scss | 20 ++ .../MetadataFormField/index.tsx | 227 ++++++++++++------ 11 files changed, 418 insertions(+), 69 deletions(-) create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx new file mode 100644 index 000000000..1f758befd --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} +//TODO:ME Date component?? Add validation for dates? +export const DateField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx new file mode 100644 index 000000000..595ac8949 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} +// TODO:ME Add validation for emails +export const EmailField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx new file mode 100644 index 000000000..ac368502b --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} +//TODO:ME Add validation for floating numbers? +export const FloatField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx new file mode 100644 index 000000000..5a14a9f51 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} +//TODO:ME Add validation for integers? +export const IntField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx new file mode 100644 index 000000000..3dfd1ecec --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx @@ -0,0 +1,27 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} + +export const TextBoxField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx new file mode 100644 index 000000000..5f5c597d5 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} + +export const TextField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx new file mode 100644 index 000000000..1a4c7f76a --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx @@ -0,0 +1,28 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean +} +//TODO:ME Add validation for urls? +export const UrlField = ({ + name, + onChange, + isInvalid, + disabled, + isInFieldGroup = false +}: Props) => { + return ( + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx new file mode 100644 index 000000000..9b98e5c71 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -0,0 +1,37 @@ +import { Form } from '@iqss/dataverse-design-system' + +interface Props { + name: string + options: string[] + onChange: (event: React.ChangeEvent) => void + isInvalid: boolean + disabled: boolean + isInFieldGroup?: boolean + // allowMultiple?: boolean +} +// TODO: Implement a multiple select with autocomplete like in JSF version +export const Vocabulary = ({ + name, + options, + onChange, + isInvalid, + disabled, + // allowMultiple, + isInFieldGroup = false +}: Props) => { + return ( + + + {options.map((option) => ( + + ))} + + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts new file mode 100644 index 000000000..a6cfeac86 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts @@ -0,0 +1,8 @@ +export * from './DateField' +export * from './EmailField' +export * from './FloatField' +export * from './IntField' +export * from './TextBoxField' +export * from './TextField' +export * from './UrlField' +export * from './Vocabulary' diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss new file mode 100644 index 000000000..b02ee165b --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss @@ -0,0 +1,20 @@ +.multiple-fields-grid { + display: grid; + grid-template-columns: 1fr; + + @media screen and (min-width: 768px) { + grid-template-columns: 1fr 1fr; + column-gap: 1rem; + } +} + +.checkbox-list-grid { + display: flex; + flex-wrap: wrap; + gap: 1rem; + border: solid 1px var(--bs-gray-400); + padding: 1rem; + max-height: 260px; + overflow-y: auto; + border-radius: var(--bs-border-radius-lg); +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index f80cd4799..3c2475e49 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -1,36 +1,35 @@ -import { Form } from '@iqss/dataverse-design-system' +import { Col, Form } from '@iqss/dataverse-design-system' import { MetadataField2, - TypeClassMetadataField, - TypeMetadataField + TypeClassMetadataFieldOptions, + TypeMetadataFieldOptions } from '../../../../metadata-block-info/domain/models/MetadataBlockInfo' - -export enum TypeMetadataFieldxx { - Date = 'DATE', - Email = 'EMAIL', - Float = 'FLOAT', - Int = 'INT', - None = 'NONE', - Text = 'TEXT', - Textbox = 'TEXTBOX', - URL = 'URL' -} - -export enum TypeClassMetadataFieldxx { - Compound = 'compound', - ControlledVocabulary = 'controlledVocabulary', - Primitive = 'primitive' -} +import { + DateField, + EmailField, + FloatField, + IntField, + TextBoxField, + TextField, + UrlField, + Vocabulary +} from './Fields' +import styles from './index.module.scss' interface Props { metadataFieldInfo: MetadataField2 + withinMultipleFieldsGroup?: boolean } -export const MetadataFormField = ({ metadataFieldInfo }: Props) => { +export const MetadataFormField = ({ + metadataFieldInfo, + withinMultipleFieldsGroup = false +}: Props) => { console.log(metadataFieldInfo) const { name, type, + title, multiple, typeClass, isRequired, @@ -41,77 +40,167 @@ export const MetadataFormField = ({ metadataFieldInfo }: Props) => { } = metadataFieldInfo const isSafeCompound = - typeClass === TypeClassMetadataField.Compound && + typeClass === TypeClassMetadataFieldOptions.Compound && childMetadataFields !== undefined && Object.keys(childMetadataFields).length > 0 const isSafeControlledVocabulary = - typeClass === TypeClassMetadataField.ControlledVocabulary && + typeClass === TypeClassMetadataFieldOptions.ControlledVocabulary && controlledVocabularyValues !== undefined && controlledVocabularyValues.length > 0 - const isSafePrimitive = typeClass === TypeClassMetadataField.Primitive - - if (isSafePrimitive) { - return ( -

- {`name: ${name} `} - ---isSafePrimitive--- {`type: ${type} typeClass: ${typeClass}`} -

- ) - } + const isSafePrimitive = typeClass === TypeClassMetadataFieldOptions.Primitive if (isSafeCompound) { return ( -

- {`name: ${name} `} - ---isSafeCompound--- {`type: ${type} typeClass: ${typeClass}`} -

    + +
    {Object.entries(childMetadataFields).map( ([childMetadataFieldKey, childMetadataFieldInfo]) => { return ( -
  • - -
  • + ) } )} -
-

+ + + ) + } + + if (isSafePrimitive) { + return ( + + {title} + <> + {type === TypeMetadataFieldOptions.Text && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.Textbox && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.URL && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.Email && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.Int && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.Float && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + {type === TypeMetadataFieldOptions.Date && ( + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + /> + )} + + + Automatically get error from the validation library (Field is required, Field should have + bla blah, etc.) + + ) } if (isSafeControlledVocabulary) { + if (multiple) { + return ( + +
+ {controlledVocabularyValues.map((value) => { + return ( + console.log(e)} + key={value} + /> + ) + })} +
+
+ ) + } return ( -

- {`name: ${name} `} - ---isSafeControlledVocabulary--- {`type: ${type} typeClass: ${typeClass}`} -

    - {controlledVocabularyValues.map((controlledVocabularyValue, index) => { - return
  • {controlledVocabularyValue}
  • - })} -
-

+ + {title} + console.log(e)} + disabled={false} + isInvalid={false} + isInFieldGroup={withinMultipleFieldsGroup} + options={controlledVocabularyValues} + /> + + Automatically get error from the validation library (Field is required, Field should have + bla blah, etc.) + + ) } return

Not implemented

} - -// return ( -// -// -// {metadataFieldInfo.displayName} -// -// -// -// {/* {t('datasetForm.fields.title.feedback')} */} -// -// -// ) From 8dee13c27aafe13165370f618d851955143309bc Mon Sep 17 00:00:00 2001 From: German Saracca Date: Mon, 25 Mar 2024 17:07:09 -0300 Subject: [PATCH 07/20] feat(DynamicFormFieldsRender): Update models and mock --- .../domain/models/MetadataBlockInfo.ts | 103 ++- ...etadataBlocksInfoByCollectionIdResponse.ts | 745 ++++-------------- 2 files changed, 222 insertions(+), 626 deletions(-) diff --git a/src/metadata-block-info/domain/models/MetadataBlockInfo.ts b/src/metadata-block-info/domain/models/MetadataBlockInfo.ts index 80229a9aa..49c030f01 100644 --- a/src/metadata-block-info/domain/models/MetadataBlockInfo.ts +++ b/src/metadata-block-info/domain/models/MetadataBlockInfo.ts @@ -19,7 +19,7 @@ export interface MetadataBlockInfo2 { name: string displayName: string metadataFields: Record - displayOnCreate?: boolean // If true, the block will be displayed on the create dataset form + displayOnCreate: boolean // If true, the block will be displayed on the create dataset form } export interface MetadataField2 { @@ -37,37 +37,78 @@ export interface MetadataField2 { displayOrder: number controlledVocabularyValues?: string[] childMetadataFields?: Record - displayOnCreate?: boolean // If true, the field will be displayed on the create metadata block + displayOnCreate: boolean // If true, the field will be displayed on the create metadata block } -export enum TypeMetadataField { - Date = 'DATE', - Email = 'EMAIL', - Float = 'FLOAT', - Int = 'INT', - None = 'NONE', - Text = 'TEXT', - Textbox = 'TEXTBOX', - URL = 'URL' -} +export const TypeMetadataFieldOptions = { + Date: 'DATE', + Email: 'EMAIL', + Float: 'FLOAT', + Int: 'INT', + None: 'NONE', + Text: 'TEXT', + Textbox: 'TEXTBOX', + URL: 'URL' +} as const -export enum TypeClassMetadataField { - Compound = 'compound', - ControlledVocabulary = 'controlledVocabulary', - Primitive = 'primitive' -} +export type TypeMetadataField = + (typeof TypeMetadataFieldOptions)[keyof typeof TypeMetadataFieldOptions] -export enum WatermarkMetadataField { - Empty = '', - EnterAFloatingPointNumber = 'Enter a floating-point number.', - EnterAnInteger = 'Enter an integer.', - FamilyNameGivenNameOrOrganization = 'FamilyName, GivenName or Organization', - HTTPS = 'https://', - NameEmailXyz = 'name@email.xyz', - OrganizationXYZ = 'Organization XYZ', - The1FamilyNameGivenNameOr2Organization = '1) FamilyName, GivenName or 2) Organization', - The1FamilyNameGivenNameOr2OrganizationXYZ = '1) Family Name, Given Name or 2) Organization XYZ', - WatermarkEnterAnInteger = 'Enter an integer...', - YYYYOrYYYYMMOrYYYYMMDD = 'YYYY or YYYY-MM or YYYY-MM-DD', - YyyyMmDD = 'YYYY-MM-DD' -} +// export enum TypeMetadataField { +// Date = 'DATE', +// Email = 'EMAIL', +// Float = 'FLOAT', +// Int = 'INT', +// None = 'NONE', +// Text = 'TEXT', +// Textbox = 'TEXTBOX', +// URL = 'URL' +// } + +export const TypeClassMetadataFieldOptions = { + Compound: 'compound', + ControlledVocabulary: 'controlledVocabulary', + Primitive: 'primitive' +} as const + +export type TypeClassMetadataField = + (typeof TypeClassMetadataFieldOptions)[keyof typeof TypeClassMetadataFieldOptions] + +// export enum TypeClassMetadataField { +// Compound = 'compound', +// ControlledVocabulary = 'controlledVocabulary', +// Primitive = 'primitive' +// } + +export const WatermarkMetadataFieldOptions = { + Empty: '', + EnterAFloatingPointNumber: 'Enter a floating-point number.', + EnterAnInteger: 'Enter an integer.', + FamilyNameGivenNameOrOrganization: 'FamilyName, GivenName or Organization', + HTTPS: 'https://', + NameEmailXyz: 'name@email.xyz', + OrganizationXYZ: 'Organization XYZ', + The1FamilyNameGivenNameOr2Organization: '1) FamilyName, GivenName or 2) Organization', + The1FamilyNameGivenNameOr2OrganizationXYZ: '1) Family Name, Given Name or 2) Organization XYZ', + WatermarkEnterAnInteger: 'Enter an integer...', + YYYYOrYYYYMMOrYYYYMMDD: 'YYYY or YYYY-MM or YYYY-MM-DD', + YyyyMmDD: 'YYYY-MM-DD' +} as const + +export type WatermarkMetadataField = + (typeof WatermarkMetadataFieldOptions)[keyof typeof WatermarkMetadataFieldOptions] + +// export enum WatermarkMetadataField { +// Empty = '', +// EnterAFloatingPointNumber = 'Enter a floating-point number.', +// EnterAnInteger = 'Enter an integer.', +// FamilyNameGivenNameOrOrganization = 'FamilyName, GivenName or Organization', +// HTTPS = 'https://', +// NameEmailXyz = 'name@email.xyz', +// OrganizationXYZ = 'Organization XYZ', +// The1FamilyNameGivenNameOr2Organization = '1) FamilyName, GivenName or 2) Organization', +// The1FamilyNameGivenNameOr2OrganizationXYZ = '1) Family Name, Given Name or 2) Organization XYZ', +// WatermarkEnterAnInteger = 'Enter an integer...', +// YYYYOrYYYYMMOrYYYYMMDD = 'YYYY or YYYY-MM or YYYY-MM-DD', +// YyyyMmDD = 'YYYY-MM-DD' +// } diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts index 2c49412d4..8adfd762a 100644 --- a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts +++ b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts @@ -1,6 +1,6 @@ import { MetadataBlockInfo2 } from '../../../metadata-block-info/domain/models/MetadataBlockInfo' -export const metadataBlocksInfoByCollectionIdResponse = [ +export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ { id: 1, name: 'citation', @@ -51,7 +51,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: false, + displayOnCreate: true, displayOrder: 2 }, alternativeURL: { @@ -84,7 +84,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 4, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { otherIdAgency: { name: 'otherIdAgency', @@ -98,6 +98,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 5 }, otherIdValue: { @@ -112,6 +113,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 6 } } @@ -144,6 +146,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: true, + displayOnCreate: true, displayOrder: 8 }, authorAffiliation: { @@ -159,6 +162,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 9 }, authorIdentifierScheme: { @@ -174,6 +178,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: true, displayFormat: '- #VALUE:', isRequired: false, + displayOnCreate: true, displayOrder: 10, controlledVocabularyValues: [ 'ORCID', @@ -198,6 +203,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 11 } } @@ -216,7 +222,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 12, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { datasetContactName: { name: 'datasetContactName', @@ -231,6 +237,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 13 }, datasetContactAffiliation: { @@ -246,6 +253,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 14 }, datasetContactEmail: { @@ -260,6 +268,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#EMAIL', isRequired: true, + displayOnCreate: true, displayOrder: 15 } } @@ -277,7 +286,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: true, displayOrder: 16, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { dsDescriptionValue: { name: 'dsDescriptionValue', @@ -291,6 +300,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: true, + displayOnCreate: true, displayOrder: 17 }, dsDescriptionDate: { @@ -306,6 +316,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 18 } } @@ -355,7 +366,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 20, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { keywordValue: { name: 'keywordValue', @@ -369,6 +380,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 21 }, keywordVocabulary: { @@ -383,6 +395,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 22 }, keywordVocabularyURI: { @@ -398,6 +411,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 23 } } @@ -416,7 +430,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 24, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { topicClassValue: { name: 'topicClassValue', @@ -430,6 +444,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 25 }, topicClassVocab: { @@ -444,6 +459,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 26 }, topicClassVocabURI: { @@ -459,6 +475,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 27 } } @@ -477,7 +494,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 28, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { publicationCitation: { name: 'publicationCitation', @@ -491,6 +508,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 29 }, publicationIDType: { @@ -506,6 +524,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '#VALUE: ', isRequired: false, displayOrder: 30, + displayOnCreate: true, controlledVocabularyValues: [ 'ark', 'arXiv', @@ -540,6 +559,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 31 }, publicationURL: { @@ -555,6 +575,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 32 } } @@ -572,7 +593,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 33, - displayOnCreate: false + displayOnCreate: true }, language: { name: 'language', @@ -587,7 +608,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 34, - displayOnCreate: false, + displayOnCreate: true, controlledVocabularyValues: [ 'Abkhaz', 'Afar', @@ -791,7 +812,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 35, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { producerName: { name: 'producerName', @@ -806,6 +827,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: true, + displayOnCreate: true, displayOrder: 36 }, producerAffiliation: { @@ -821,6 +843,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 37 }, producerAbbreviation: { @@ -835,6 +858,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 38 }, producerURL: { @@ -849,6 +873,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 39 }, producerLogoURL: { @@ -863,6 +888,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '
', isRequired: false, + displayOnCreate: true, displayOrder: 40 } } @@ -880,7 +906,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: false, + displayOnCreate: true, displayOrder: 41 }, productionPlace: { @@ -896,7 +922,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, - displayOnCreate: false, + displayOnCreate: true, displayOrder: 42 }, contributor: { @@ -913,7 +939,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 43, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { contributorType: { name: 'contributorType', @@ -928,6 +954,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '#VALUE ', isRequired: false, displayOrder: 44, + displayOnCreate: true, controlledVocabularyValues: [ 'Data Collector', 'Data Curator', @@ -961,6 +988,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 45 } } @@ -978,7 +1006,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 46, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { grantNumberAgency: { name: 'grantNumberAgency', @@ -992,6 +1020,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 47 }, grantNumberValue: { @@ -1007,6 +1036,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 48 } } @@ -1025,7 +1055,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 49, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { distributorName: { name: 'distributorName', @@ -1040,6 +1070,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 50 }, distributorAffiliation: { @@ -1055,6 +1086,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 51 }, distributorAbbreviation: { @@ -1069,6 +1101,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '(#VALUE)', isRequired: false, + displayOnCreate: true, displayOrder: 52 }, distributorURL: { @@ -1083,6 +1116,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 53 }, distributorLogoURL: { @@ -1098,6 +1132,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '
', isRequired: false, + displayOnCreate: true, displayOrder: 54 } } @@ -1162,7 +1197,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ';', isRequired: false, displayOrder: 58, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { timePeriodCoveredStart: { name: 'timePeriodCoveredStart', @@ -1176,6 +1211,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#NAME: #VALUE ', isRequired: false, + displayOnCreate: true, displayOrder: 59 }, timePeriodCoveredEnd: { @@ -1190,6 +1226,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#NAME: #VALUE ', isRequired: false, + displayOnCreate: true, displayOrder: 60 } } @@ -1207,7 +1244,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ';', isRequired: false, displayOrder: 61, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { dateOfCollectionStart: { name: 'dateOfCollectionStart', @@ -1221,6 +1258,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#NAME: #VALUE ', isRequired: false, + displayOnCreate: true, displayOrder: 62 }, dateOfCollectionEnd: { @@ -1235,6 +1273,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#NAME: #VALUE ', isRequired: false, + displayOnCreate: true, displayOrder: 63 } } @@ -1268,7 +1307,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ':', isRequired: false, displayOrder: 65, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { seriesName: { name: 'seriesName', @@ -1282,6 +1321,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 66 }, seriesInformation: { @@ -1297,6 +1337,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 67 } } @@ -1314,7 +1355,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: ',', isRequired: false, displayOrder: 68, - displayOnCreate: false, + displayOnCreate: true, childMetadataFields: { softwareName: { name: 'softwareName', @@ -1328,6 +1369,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 69 }, softwareVersion: { @@ -1342,6 +1384,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#NAME: #VALUE', isRequired: false, + displayOnCreate: true, displayOrder: 70 } } @@ -1463,7 +1506,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 2, name: 'geospatial', displayName: 'Geospatial Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { geographicCoverage: { name: 'geographicCoverage', @@ -1479,6 +1522,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 0, + displayOnCreate: true, childMetadataFields: { country: { name: 'country', @@ -1493,6 +1537,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '#VALUE, ', isRequired: false, displayOrder: 1, + displayOnCreate: true, controlledVocabularyValues: [ 'Afghanistan', 'Albania', @@ -1758,6 +1803,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE, ', isRequired: false, + displayOnCreate: true, displayOrder: 2 }, city: { @@ -1773,6 +1819,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE, ', isRequired: false, + displayOnCreate: true, displayOrder: 3 }, otherGeographicCoverage: { @@ -1787,319 +1834,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '#VALUE, ', isRequired: false, + displayOnCreate: true, displayOrder: 4 } } }, - country: { - name: 'country', - displayName: 'Geographic Coverage Country / Nation', - title: 'Country / Nation', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'The country or nation that the Dataset is about.', - multiple: false, - isControlledVocabulary: true, - displayFormat: '#VALUE, ', - isRequired: false, - displayOrder: 1, - controlledVocabularyValues: [ - 'Afghanistan', - 'Albania', - 'Algeria', - 'American Samoa', - 'Andorra', - 'Angola', - 'Anguilla', - 'Antarctica', - 'Antigua and Barbuda', - 'Argentina', - 'Armenia', - 'Aruba', - 'Australia', - 'Austria', - 'Azerbaijan', - 'Bahamas', - 'Bahrain', - 'Bangladesh', - 'Barbados', - 'Belarus', - 'Belgium', - 'Belize', - 'Benin', - 'Bermuda', - 'Bhutan', - 'Bolivia, Plurinational State of', - 'Bonaire, Sint Eustatius and Saba', - 'Bosnia and Herzegovina', - 'Botswana', - 'Bouvet Island', - 'Brazil', - 'British Indian Ocean Territory', - 'Brunei Darussalam', - 'Bulgaria', - 'Burkina Faso', - 'Burundi', - 'Cambodia', - 'Cameroon', - 'Canada', - 'Cape Verde', - 'Cayman Islands', - 'Central African Republic', - 'Chad', - 'Chile', - 'China', - 'Christmas Island', - 'Cocos (Keeling) Islands', - 'Colombia', - 'Comoros', - 'Congo', - 'Congo, the Democratic Republic of the', - 'Cook Islands', - 'Costa Rica', - 'Croatia', - 'Cuba', - 'Curaçao', - 'Cyprus', - 'Czech Republic', - "Côte d'Ivoire", - 'Denmark', - 'Djibouti', - 'Dominica', - 'Dominican Republic', - 'Ecuador', - 'Egypt', - 'El Salvador', - 'Equatorial Guinea', - 'Eritrea', - 'Estonia', - 'Ethiopia', - 'Falkland Islands (Malvinas)', - 'Faroe Islands', - 'Fiji', - 'Finland', - 'France', - 'French Guiana', - 'French Polynesia', - 'French Southern Territories', - 'Gabon', - 'Gambia', - 'Georgia', - 'Germany', - 'Ghana', - 'Gibraltar', - 'Greece', - 'Greenland', - 'Grenada', - 'Guadeloupe', - 'Guam', - 'Guatemala', - 'Guernsey', - 'Guinea', - 'Guinea-Bissau', - 'Guyana', - 'Haiti', - 'Heard Island and Mcdonald Islands', - 'Holy See (Vatican City State)', - 'Honduras', - 'Hong Kong', - 'Hungary', - 'Iceland', - 'India', - 'Indonesia', - 'Iran, Islamic Republic of', - 'Iraq', - 'Ireland', - 'Isle of Man', - 'Israel', - 'Italy', - 'Jamaica', - 'Japan', - 'Jersey', - 'Jordan', - 'Kazakhstan', - 'Kenya', - 'Kiribati', - "Korea, Democratic People's Republic of", - 'Korea, Republic of', - 'Kuwait', - 'Kyrgyzstan', - "Lao People's Democratic Republic", - 'Latvia', - 'Lebanon', - 'Lesotho', - 'Liberia', - 'Libya', - 'Liechtenstein', - 'Lithuania', - 'Luxembourg', - 'Macao', - 'Macedonia, the Former Yugoslav Republic of', - 'Madagascar', - 'Malawi', - 'Malaysia', - 'Maldives', - 'Mali', - 'Malta', - 'Marshall Islands', - 'Martinique', - 'Mauritania', - 'Mauritius', - 'Mayotte', - 'Mexico', - 'Micronesia, Federated States of', - 'Moldova, Republic of', - 'Monaco', - 'Mongolia', - 'Montenegro', - 'Montserrat', - 'Morocco', - 'Mozambique', - 'Myanmar', - 'Namibia', - 'Nauru', - 'Nepal', - 'Netherlands', - 'New Caledonia', - 'New Zealand', - 'Nicaragua', - 'Niger', - 'Nigeria', - 'Niue', - 'Norfolk Island', - 'Northern Mariana Islands', - 'Norway', - 'Oman', - 'Pakistan', - 'Palau', - 'Palestine, State of', - 'Panama', - 'Papua New Guinea', - 'Paraguay', - 'Peru', - 'Philippines', - 'Pitcairn', - 'Poland', - 'Portugal', - 'Puerto Rico', - 'Qatar', - 'Romania', - 'Russian Federation', - 'Rwanda', - 'Réunion', - 'Saint Barthélemy', - 'Saint Helena, Ascension and Tristan da Cunha', - 'Saint Kitts and Nevis', - 'Saint Lucia', - 'Saint Martin (French part)', - 'Saint Pierre and Miquelon', - 'Saint Vincent and the Grenadines', - 'Samoa', - 'San Marino', - 'Sao Tome and Principe', - 'Saudi Arabia', - 'Senegal', - 'Serbia', - 'Seychelles', - 'Sierra Leone', - 'Singapore', - 'Sint Maarten (Dutch part)', - 'Slovakia', - 'Slovenia', - 'Solomon Islands', - 'Somalia', - 'South Africa', - 'South Georgia and the South Sandwich Islands', - 'South Sudan', - 'Spain', - 'Sri Lanka', - 'Sudan', - 'Suriname', - 'Svalbard and Jan Mayen', - 'Swaziland', - 'Sweden', - 'Switzerland', - 'Syrian Arab Republic', - 'Taiwan, Province of China', - 'Tajikistan', - 'Tanzania, United Republic of', - 'Thailand', - 'Timor-Leste', - 'Togo', - 'Tokelau', - 'Tonga', - 'Trinidad and Tobago', - 'Tunisia', - 'Turkey', - 'Turkmenistan', - 'Turks and Caicos Islands', - 'Tuvalu', - 'Uganda', - 'Ukraine', - 'United Arab Emirates', - 'United Kingdom', - 'United States', - 'United States Minor Outlying Islands', - 'Uruguay', - 'Uzbekistan', - 'Vanuatu', - 'Venezuela, Bolivarian Republic of', - 'Viet Nam', - 'Virgin Islands, British', - 'Virgin Islands, U.S.', - 'Wallis and Futuna', - 'Western Sahara', - 'Yemen', - 'Zambia', - 'Zimbabwe', - 'Åland Islands' - ] - }, - state: { - name: 'state', - displayName: 'Geographic Coverage State / Province', - title: 'State / Province', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOrder: 2 - }, - city: { - name: 'city', - displayName: 'Geographic Coverage City', - title: 'City', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOrder: 3 - }, - otherGeographicCoverage: { - name: 'otherGeographicCoverage', - displayName: 'Geographic Coverage Other', - title: 'Other', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Other information on the geographic coverage of the data.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOrder: 4 - }, geographicUnit: { name: 'geographicUnit', displayName: 'Geographic Unit', @@ -2113,6 +1852,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 5 }, geographicBoundingBox: { @@ -2128,6 +1868,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 6, childMetadataFields: { westLongitude: { @@ -2143,6 +1884,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 7 }, eastLongitude: { @@ -2158,6 +1900,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 8 }, northLatitude: { @@ -2173,6 +1916,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 9 }, southLatitude: { @@ -2188,69 +1932,10 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 10 } } - }, - westLongitude: { - name: 'westLongitude', - displayName: 'Geographic Bounding Box Westernmost (Left) Longitude', - title: 'Westernmost (Left) Longitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 7 - }, - eastLongitude: { - name: 'eastLongitude', - displayName: 'Geographic Bounding Box Easternmost (Right) Longitude', - title: 'Easternmost (Right) Longitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 8 - }, - northLatitude: { - name: 'northLatitude', - displayName: 'Geographic Bounding Box Northernmost (Top) Latitude', - title: 'Northernmost (Top) Latitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 9 - }, - southLatitude: { - name: 'southLatitude', - displayName: 'Geographic Bounding Box Southernmost (Bottom) Latitude', - title: 'Southernmost (Bottom) Latitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 10 } } }, @@ -2258,7 +1943,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 4, name: 'astrophysics', displayName: 'Astronomy and Astrophysics Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { astroType: { name: 'astroType', @@ -2273,6 +1958,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 0, + displayOnCreate: true, controlledVocabularyValues: [ 'Image', 'Mosaic', @@ -2312,6 +1998,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 1 }, astroInstrument: { @@ -2326,6 +2013,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 2 }, astroObject: { @@ -2341,6 +2029,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 3 }, 'resolution.Spatial': { @@ -2356,6 +2045,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 4 }, 'resolution.Spectral': { @@ -2371,6 +2061,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 5 }, 'resolution.Temporal': { @@ -2386,6 +2077,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 6 }, 'coverage.Spectral.Bandpass': { @@ -2400,6 +2092,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 7 }, 'coverage.Spectral.CentralWavelength': { @@ -2414,6 +2107,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 8 }, 'coverage.Spectral.Wavelength': { @@ -2428,6 +2122,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 9, childMetadataFields: { 'coverage.Spectral.MinimumWavelength': { @@ -2442,6 +2137,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 10 }, 'coverage.Spectral.MaximumWavelength': { @@ -2456,38 +2152,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 11 } } }, - 'coverage.Spectral.MinimumWavelength': { - name: 'coverage.Spectral.MinimumWavelength', - displayName: 'Wavelength Range Minimum (m)', - title: 'Minimum (m)', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The minimum wavelength of the spectral bandpass, in meters.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 10 - }, - 'coverage.Spectral.MaximumWavelength': { - name: 'coverage.Spectral.MaximumWavelength', - displayName: 'Wavelength Range Maximum (m)', - title: 'Maximum (m)', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The maximum wavelength of the spectral bandpass, in meters.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 11 - }, 'coverage.Temporal': { name: 'coverage.Temporal', displayName: 'Dataset Date Range', @@ -2500,6 +2169,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 12, childMetadataFields: { 'coverage.Temporal.StartTime': { @@ -2514,6 +2184,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 13 }, 'coverage.Temporal.StopTime': { @@ -2528,38 +2199,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 14 } } }, - 'coverage.Temporal.StartTime': { - name: 'coverage.Temporal.StartTime', - displayName: 'Dataset Date Range Start', - title: 'Start', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'Dataset Start Date', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 13 - }, - 'coverage.Temporal.StopTime': { - name: 'coverage.Temporal.StopTime', - displayName: 'Dataset Date Range End', - title: 'End', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'Dataset End Date', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 14 - }, 'coverage.Spatial': { name: 'coverage.Spatial', displayName: 'Sky Coverage', @@ -2572,6 +2216,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 15 }, 'coverage.Depth': { @@ -2586,6 +2231,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 16 }, 'coverage.ObjectDensity': { @@ -2601,6 +2247,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 17 }, 'coverage.ObjectCount': { @@ -2615,6 +2262,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 18 }, 'coverage.SkyFraction': { @@ -2630,6 +2278,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 19 }, 'coverage.Polarization': { @@ -2644,6 +2293,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 20 }, redshiftType: { @@ -2659,6 +2309,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 21 }, 'resolution.Redshift': { @@ -2674,6 +2325,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 22 }, 'coverage.RedshiftValue': { @@ -2689,6 +2341,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 23, childMetadataFields: { 'coverage.Redshift.MinimumValue': { @@ -2704,6 +2357,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 24 }, 'coverage.Redshift.MaximumValue': { @@ -2719,39 +2373,10 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 25 } } - }, - 'coverage.Redshift.MinimumValue': { - name: 'coverage.Redshift.MinimumValue', - displayName: 'Redshift Value Minimum', - title: 'Minimum', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The minimum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 24 - }, - 'coverage.Redshift.MaximumValue': { - name: 'coverage.Redshift.MaximumValue', - displayName: 'Redshift Value Maximum', - title: 'Maximum', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The maximum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 25 } } }, @@ -2759,7 +2384,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 5, name: 'biomedical', displayName: 'Life Sciences Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { studyDesignType: { name: 'studyDesignType', @@ -2774,6 +2399,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 0, + displayOnCreate: true, controlledVocabularyValues: [ 'Case Control', 'Cross Sectional', @@ -2800,6 +2426,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 1 }, studyFactorType: { @@ -2814,6 +2441,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: true, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 2, controlledVocabularyValues: [ 'Age', @@ -2851,6 +2479,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 3 }, studyAssayOrganism: { @@ -2867,6 +2496,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 4, + displayOnCreate: true, controlledVocabularyValues: [ 'Arabidopsis thaliana', 'Bos taurus', @@ -2908,6 +2538,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 5 }, studyAssayMeasurementType: { @@ -2924,6 +2555,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 6, + displayOnCreate: true, controlledVocabularyValues: [ 'cell sorting', 'clinical chemistry analysis', @@ -2969,6 +2601,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 7 }, studyAssayTechnologyType: { @@ -2985,6 +2618,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 8, + displayOnCreate: true, controlledVocabularyValues: [ 'culture based drug susceptibility testing, single concentration', 'culture based drug susceptibility testing, two concentrations', @@ -3014,6 +2648,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 9 }, studyAssayPlatform: { @@ -3029,6 +2664,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: true, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 10, controlledVocabularyValues: [ '210-MS GC Ion Trap (Varian)', @@ -3230,6 +2866,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 11 }, studyAssayCellType: { @@ -3244,6 +2881,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 12 } } @@ -3252,7 +2890,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 6, name: 'journal', displayName: 'Journal Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { journalVolumeIssue: { name: 'journalVolumeIssue', @@ -3268,6 +2906,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 0, + displayOnCreate: true, childMetadataFields: { journalVolume: { name: 'journalVolume', @@ -3282,6 +2921,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 1 }, journalIssue: { @@ -3297,6 +2937,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 2 }, journalPubDate: { @@ -3312,54 +2953,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 3 } } }, - journalVolume: { - name: 'journalVolume', - displayName: 'Journal Volume', - title: 'Volume', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The journal volume which this Dataset is associated with (e.g., Volume 4).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 1 - }, - journalIssue: { - name: 'journalIssue', - displayName: 'Journal Issue', - title: 'Issue', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The journal issue number which this Dataset is associated with (e.g., Number 2, Autumn).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 2 - }, - journalPubDate: { - name: 'journalPubDate', - displayName: 'Journal Publication Date', - title: 'Publication Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY or YYYY-MM or YYYY-MM-DD', - description: - 'The publication date for this journal volume/issue, which this Dataset is associated with (e.g., 1999).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 3 - }, journalArticleType: { name: 'journalArticleType', displayName: 'Type of Article', @@ -3374,6 +2972,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ displayFormat: '', isRequired: false, displayOrder: 4, + displayOnCreate: true, controlledVocabularyValues: [ 'abstract', 'addendum', @@ -3415,7 +3014,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ id: 3, name: 'socialscience', displayName: 'Social Science and Humanities Metadata', - displayOnCreate: false, + displayOnCreate: true, metadataFields: { unitOfAnalysis: { name: 'unitOfAnalysis', @@ -3430,6 +3029,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 0 }, universe: { @@ -3445,6 +3045,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 1 }, timeMethod: { @@ -3460,6 +3061,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 2 }, dataCollector: { @@ -3475,6 +3077,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 3 }, collectorTraining: { @@ -3489,6 +3092,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 4 }, frequencyOfDataCollection: { @@ -3504,6 +3108,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 5 }, samplingProcedure: { @@ -3519,6 +3124,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 6 }, targetSampleSize: { @@ -3534,6 +3140,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 7, childMetadataFields: { targetSampleActualSize: { @@ -3548,6 +3155,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 8 }, targetSampleSizeFormula: { @@ -3562,38 +3170,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 9 } } }, - targetSampleActualSize: { - name: 'targetSampleActualSize', - displayName: 'Target Sample Size Actual', - title: 'Actual', - type: 'INT', - typeClass: 'primitive', - watermark: 'Enter an integer...', - description: 'Actual sample size.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 8 - }, - targetSampleSizeFormula: { - name: 'targetSampleSizeFormula', - displayName: 'Target Sample Size Formula', - title: 'Formula', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Formula used to determine target sample size.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 9 - }, deviationsFromSampleDesign: { name: 'deviationsFromSampleDesign', displayName: 'Major Deviations for Sample Design', @@ -3607,6 +3188,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 10 }, collectionMode: { @@ -3622,6 +3204,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 11 }, researchInstrument: { @@ -3637,6 +3220,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 12 }, dataCollectionSituation: { @@ -3652,6 +3236,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 13 }, actionsToMinimizeLoss: { @@ -3667,6 +3252,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 14 }, controlOperations: { @@ -3682,6 +3268,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 15 }, weighting: { @@ -3697,6 +3284,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 16 }, cleaningOperations: { @@ -3712,6 +3300,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 17 }, datasetLevelErrorNotes: { @@ -3727,6 +3316,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 18 }, responseRate: { @@ -3741,6 +3331,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 19 }, samplingErrorEstimates: { @@ -3756,6 +3347,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 20 }, otherDataAppraisal: { @@ -3771,6 +3363,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 21 }, socialScienceNotes: { @@ -3785,6 +3378,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 22, childMetadataFields: { socialScienceNotesType: { @@ -3799,6 +3393,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 23 }, socialScienceNotesSubject: { @@ -3813,6 +3408,7 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 24 }, socialScienceNotesText: { @@ -3827,52 +3423,11 @@ export const metadataBlocksInfoByCollectionIdResponse = [ isControlledVocabulary: false, displayFormat: '', isRequired: false, + displayOnCreate: true, displayOrder: 25 } } - }, - socialScienceNotesType: { - name: 'socialScienceNotesType', - displayName: 'Notes Type', - title: 'Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Type of note.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 23 - }, - socialScienceNotesSubject: { - name: 'socialScienceNotesSubject', - displayName: 'Notes Subject', - title: 'Subject', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Note subject.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 24 - }, - socialScienceNotesText: { - name: 'socialScienceNotesText', - displayName: 'Notes Text', - title: 'Text', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'Text for this note.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 25 } } } -] as MetadataBlockInfo2[] +] From 89da8e2e9d1736797bb7ccf2871077634003d75d Mon Sep 17 00:00:00 2001 From: German Saracca Date: Mon, 25 Mar 2024 17:08:20 -0300 Subject: [PATCH 08/20] feat(DynamicFormFieldsRender): Refactor to avoid for now multiple actions buttons space --- .../FormGroupWithMultipleFields.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/design-system/src/lib/components/form/form-group-multiple-fields/FormGroupWithMultipleFields.tsx b/packages/design-system/src/lib/components/form/form-group-multiple-fields/FormGroupWithMultipleFields.tsx index ddb0425fb..0a45261d4 100644 --- a/packages/design-system/src/lib/components/form/form-group-multiple-fields/FormGroupWithMultipleFields.tsx +++ b/packages/design-system/src/lib/components/form/form-group-multiple-fields/FormGroupWithMultipleFields.tsx @@ -36,20 +36,21 @@ export function FormGroupWithMultipleFields({ const isFirstField = index == 0 return ( - + {isFirstField && } </Col> - <Col sm={6}>{field}</Col> - <Col sm={3}> - {withDynamicFields && ( + <Col sm={withDynamicFields ? 6 : 9}>{field}</Col> + + {withDynamicFields && ( + <Col sm={3}> <DynamicFieldsButtons originalField={isFirstField} onAddButtonClick={() => addField(field)} onRemoveButtonClick={() => removeField(index)} /> - )} - </Col> + </Col> + )} </Row> ) })} From 9b46e19d973361c67af0cb94e7e2f51693da536d Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Tue, 26 Mar 2024 08:58:22 -0300 Subject: [PATCH 09/20] feat: change styles for checbox group --- .../form-checkbox-group/FormCheckboxGroup.module.scss | 8 ++++---- .../form/form-checkbox-group/FormCheckboxGroup.tsx | 2 +- .../MetadataFormField/index.module.scss | 4 ++-- .../MetadataBlockFormFields/MetadataFormField/index.tsx | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.module.scss b/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.module.scss index d8700a3ab..4c8ba85d7 100644 --- a/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.module.scss +++ b/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.module.scss @@ -1,7 +1,7 @@ -@import "src/lib/assets/styles/design-tokens/typography.module"; +@import 'src/lib/assets/styles/design-tokens/typography.module'; .title { - padding-top: calc(0.375rem + 1px); - padding-bottom: calc(0.375rem + 1px); + display: inline-block; + margin-bottom: 0.5rem; font-weight: $dv-font-weight-bold; -} \ No newline at end of file +} diff --git a/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.tsx b/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.tsx index 063626c24..4b5d655c4 100644 --- a/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.tsx +++ b/packages/design-system/src/lib/components/form/form-checkbox-group/FormCheckboxGroup.tsx @@ -23,7 +23,7 @@ export function FormCheckboxGroup({ }: PropsWithChildren<FormCheckboxGroupProps>) { const validationClass = isInvalid ? 'is-invalid' : isValid ? 'is-valid' : '' return ( - <Row> + <Row className="mb-3"> <Col sm={3}> <span className={styles.title}> {title} {required && <RequiredInputSymbol />}{' '} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss index b02ee165b..08ec09a88 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.module.scss @@ -12,9 +12,9 @@ display: flex; flex-wrap: wrap; gap: 1rem; - border: solid 1px var(--bs-gray-400); - padding: 1rem; max-height: 260px; + padding: 1rem; overflow-y: auto; + border: solid 1px var(--bs-gray-400); border-radius: var(--bs-border-radius-lg); } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index 3c2475e49..3c3e81942 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -25,7 +25,6 @@ export const MetadataFormField = ({ metadataFieldInfo, withinMultipleFieldsGroup = false }: Props) => { - console.log(metadataFieldInfo) const { name, type, @@ -33,7 +32,6 @@ export const MetadataFormField = ({ multiple, typeClass, isRequired, - displayName, description, childMetadataFields, controlledVocabularyValues From 74de357874a88888d32c05fe37d83faa0593b93b Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Tue, 26 Mar 2024 11:19:04 -0300 Subject: [PATCH 10/20] feat: add names to form fields --- .../create-dataset/CreateDatasetForm.tsx | 202 ++---------------- .../MetadataFormField/Fields/Vocabulary.tsx | 4 +- .../MetadataFormField/index.tsx | 20 +- ...etadataBlocksInfoByCollectionIdResponse.ts | 10 +- 4 files changed, 30 insertions(+), 206 deletions(-) diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 77b6bfd95..33338ff9f 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -1,5 +1,6 @@ import { ChangeEvent, FormEvent, MouseEvent, useEffect } from 'react' -import { Form, Accordion } from '@iqss/dataverse-design-system' +import { Form, Accordion, Alert, Button } from '@iqss/dataverse-design-system' +import { useNavigate } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { RequiredFieldText } from '../shared/form/RequiredFieldText/RequiredFieldText' import { SeparationLine } from '../shared/layout/SeparationLine/SeparationLine' @@ -9,13 +10,11 @@ import { DatasetRepository } from '../../dataset/domain/repositories/DatasetRepo import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' import { useDatasetFormData } from './useDatasetFormData' import { Route } from '../Route.enum' -import { useNavigate } from 'react-router-dom' import { useDatasetValidator } from './useDatasetValidator' import { useGetMetadataBlocksInfo } from './useGetMetadataBlocksInfo' // import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' -import styles from './CreateDatasetForm.module.scss' import { MetadataBlockFormFields } from './MetadataBlockFormFields' - +import styles from './CreateDatasetForm.module.scss' interface CreateDatasetFormProps { repository: DatasetRepository metadataBlockInfoRepository: MetadataBlockInfoRepository @@ -41,13 +40,16 @@ export function CreateDatasetForm({ const { name, checked } = event.target const value = event.target.type === 'checkbox' && !checked ? '' : event.target.value - updateFormData(name, value) + // updateFormData(name, value) } const handleSubmit = (event: FormEvent<HTMLFormElement>) => { event.preventDefault() + const values = new FormData(event.currentTarget) + const formData = Object.fromEntries(values) + console.log(formData) - submitForm(formData) + // submitForm(formData) } const handleCancel = (event: MouseEvent<HTMLButtonElement>) => { @@ -89,198 +91,20 @@ export function CreateDatasetForm({ </Accordion.Item> ))} </Accordion> - </Form> - {/* - <Form.Group controlId="dataset-title" required> - <Form.Group.Label message={t('datasetForm.fields.title.tooltip')}> - {t('datasetForm.fields.title.label')} - </Form.Group.Label> - <Form.Group.Input - disabled={submissionStatus === SubmissionStatus.IsSubmitting} - type="text" - name="metadataBlocks.0.fields.title" - onChange={handleFieldChange} - isInvalid={!!validationErrors.metadataBlocks[0].fields.title} - /> - <Form.Group.Feedback type="invalid"> - {t('datasetForm.fields.title.feedback')} - </Form.Group.Feedback> - </Form.Group> - <Form.Group controlId="author-name" required> - <Form.Group.Label message={t('datasetForm.fields.authorName.tooltip')}> - {t('datasetForm.fields.authorName.label')} - </Form.Group.Label> - <Form.Group.Input - disabled={submissionStatus === SubmissionStatus.IsSubmitting} - type="text" - name="metadataBlocks.0.fields.author.0.authorName" - onChange={handleFieldChange} - isInvalid={ - !!(validationErrors.metadataBlocks[0].fields.author as DatasetMetadataSubField[])[0] - .authorName - } - /> - <Form.Group.Feedback type="invalid"> - {t('datasetForm.fields.authorName.feedback')} - </Form.Group.Feedback> - </Form.Group> - <Form.Group controlId="contact-email" required> - <Form.Group.Label message={t('datasetForm.fields.datasetContactEmail.tooltip')}> - {t('datasetForm.fields.datasetContactEmail.label')} - </Form.Group.Label> - <Form.Group.Input - disabled={submissionStatus === SubmissionStatus.IsSubmitting} - type="email" - name="metadataBlocks.0.fields.datasetContact.0.datasetContactEmail" - onChange={handleFieldChange} - isInvalid={ - !!( - validationErrors.metadataBlocks[0].fields - .datasetContact as DatasetMetadataSubField[] - )[0].datasetContactEmail - } - /> - <Form.Group.Feedback type="invalid"> - {t('datasetForm.fields.datasetContactEmail.feedback')} - </Form.Group.Feedback> - </Form.Group> - <Form.Group controlId="description-text" required> - <Form.Group.Label message={t('datasetForm.fields.dsDescriptionValue.tooltip')}> - {t('datasetForm.fields.dsDescriptionValue.label')} - </Form.Group.Label> - <Form.Group.TextArea - disabled={submissionStatus === SubmissionStatus.IsSubmitting} - name="metadataBlocks.0.fields.dsDescription.0.dsDescriptionValue" - onChange={handleFieldChange} - isInvalid={ - !!( - validationErrors.metadataBlocks[0].fields - .dsDescription as DatasetMetadataSubField[] - )[0].dsDescriptionValue - } - /> - <Form.Group.Feedback type="invalid"> - {t('datasetForm.fields.dsDescriptionValue.feedback')} - </Form.Group.Feedback> - </Form.Group> - <Form.CheckboxGroup - title={t('datasetForm.fields.subject.label')} - required - message={t('datasetForm.fields.subject.tooltip')} - isInvalid={!!(validationErrors.metadataBlocks[0].fields.subject as string[])[0]}> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.0" - label="Agricultural Sciences" - id="subject-agricultural-sciences" - value="Agricultural Sciences" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.1" - label="Arts and Humanities" - id="subject-arts-and-humanities" - value="Arts and Humanities" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.2" - label="Astronomy and Astrophysics" - id="subject-astronomy-and-astrophysics" - value="Astronomy and Astrophysics" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.3" - label="Business and Management" - id="subject-business-and-management" - value="Business and Management" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.4" - label="Chemistry" - id="subject-chemistry" - value="Chemistry" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.5" - label="Computer and Information Science" - id="subject-computer-and-information-science" - value="Computer and Information Science" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.6" - label="Earth and Environmental Sciences" - id="subject-earth-and-environmental-sciences" - value="Earth and Environmental Sciences" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.7" - label="Engineering" - id="subject-engineering" - value="Engineering" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.8" - label="Law" - id="subject-law" - value="Law" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.9" - label="Mathematical Sciences" - id="subject-mathematical-sciences" - value="Mathematical Sciences" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.10" - label="Medicine, Health and Life Sciences" - id="subject-medicine-health-and-life-sciences" - value="Medicine, Health and Life Sciences" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.11" - label="Physics" - id="subject-physics" - value="Physics" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.12" - label="Social Sciences" - id="subject-social-sciences" - value="Social Sciences" - onChange={handleFieldChange} - /> - <Form.Group.Checkbox - name="metadataBlocks.0.fields.subject.13" - label="Other" - id="subject-other" - value="Other" - onChange={handleFieldChange} - /> - <Form.Group.Feedback type="invalid" withinMultipleFieldsGroup> - {t('datasetForm.fields.subject.feedback')} - </Form.Group.Feedback> - </Form.CheckboxGroup> <SeparationLine /> <Alert variant={'info'} customHeading={t('metadataTip.title')} dismissible={false}> {t('metadataTip.content')} </Alert> - <Button type="submit" disabled={submissionStatus === SubmissionStatus.IsSubmitting}> + <Button + type="submit" + // disabled={submissionStatus === SubmissionStatus.IsSubmitting} + > {t('saveButton')} </Button> <Button withSpacing variant="secondary" type="button" onClick={handleCancel}> {t('cancelButton')} </Button> - */} + </Form> </div> </article> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx index 9b98e5c71..f0d00dbda 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -7,7 +7,7 @@ interface Props { isInvalid: boolean disabled: boolean isInFieldGroup?: boolean - // allowMultiple?: boolean + // allowMultiple?: boolean } // TODO: Implement a multiple select with autocomplete like in JSF version export const Vocabulary = ({ @@ -16,7 +16,7 @@ export const Vocabulary = ({ onChange, isInvalid, disabled, - // allowMultiple, + // allowMultiple, isInFieldGroup = false }: Props) => { return ( diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index 3c3e81942..f30c3fc93 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -83,7 +83,7 @@ export const MetadataFormField = ({ <> {type === TypeMetadataFieldOptions.Text && ( <TextField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -92,7 +92,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.Textbox && ( <TextBoxField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -101,7 +101,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.URL && ( <UrlField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -110,7 +110,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.Email && ( <EmailField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -119,7 +119,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.Int && ( <IntField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -128,7 +128,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.Float && ( <FloatField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -137,7 +137,7 @@ export const MetadataFormField = ({ )} {type === TypeMetadataFieldOptions.Date && ( <DateField - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} @@ -165,9 +165,9 @@ export const MetadataFormField = ({ {controlledVocabularyValues.map((value) => { return ( <Form.Group.Checkbox - name="someNameForThisCheckbox" + name={name} label={value} - id={`${title}-checkbox-${value}`} + id={`${name}-checkbox-${value}`} value={value} onChange={(e) => console.log(e)} key={value} @@ -185,7 +185,7 @@ export const MetadataFormField = ({ as={withinMultipleFieldsGroup ? Col : undefined}> <Form.Group.Label message={description}>{title}</Form.Group.Label> <Vocabulary - name="someName" + name={name} onChange={(e) => console.log(e)} disabled={false} isInvalid={false} diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts index 8adfd762a..6e5b73637 100644 --- a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts +++ b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts @@ -1506,7 +1506,7 @@ export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ id: 2, name: 'geospatial', displayName: 'Geospatial Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { geographicCoverage: { name: 'geographicCoverage', @@ -1943,7 +1943,7 @@ export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ id: 4, name: 'astrophysics', displayName: 'Astronomy and Astrophysics Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { astroType: { name: 'astroType', @@ -2384,7 +2384,7 @@ export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ id: 5, name: 'biomedical', displayName: 'Life Sciences Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { studyDesignType: { name: 'studyDesignType', @@ -2890,7 +2890,7 @@ export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ id: 6, name: 'journal', displayName: 'Journal Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { journalVolumeIssue: { name: 'journalVolumeIssue', @@ -3014,7 +3014,7 @@ export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ id: 3, name: 'socialscience', displayName: 'Social Science and Humanities Metadata', - displayOnCreate: true, + displayOnCreate: false, metadataFields: { unitOfAnalysis: { name: 'unitOfAnalysis', From 5cfb2347d38e7891696883b1071f00d86d3b5655 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Tue, 26 Mar 2024 12:46:01 -0300 Subject: [PATCH 11/20] feat(DynamicFormFieldsRender): Add metadta block form fields skeleton --- .../create-dataset/CreateDatasetForm.tsx | 26 ++++++---- .../create-dataset/MetadataBlocksSkeleton.tsx | 47 +++++++++++++++++++ 2 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 src/sections/create-dataset/MetadataBlocksSkeleton.tsx diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 33338ff9f..7aa4b09d7 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -14,7 +14,9 @@ import { useDatasetValidator } from './useDatasetValidator' import { useGetMetadataBlocksInfo } from './useGetMetadataBlocksInfo' // import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' import { MetadataBlockFormFields } from './MetadataBlockFormFields' +import { MetadataBlocksSkeleton } from './MetadataBlocksSkeleton' import styles from './CreateDatasetForm.module.scss' + interface CreateDatasetFormProps { repository: DatasetRepository metadataBlockInfoRepository: MetadataBlockInfoRepository @@ -81,16 +83,20 @@ export function CreateDatasetForm({ handleSubmit(event) }}> {/* METADATA BLOCKS */} - <Accordion defaultActiveKey="0"> - {metadataBlocks.map((metadataBlock, index) => ( - <Accordion.Item eventKey={index.toString()} key={metadataBlock.id}> - <Accordion.Header>{metadataBlock.displayName}</Accordion.Header> - <Accordion.Body> - <MetadataBlockFormFields metadataBlock={metadataBlock} /> - </Accordion.Body> - </Accordion.Item> - ))} - </Accordion> + {isLoadingMetadataBlocksToRender && <MetadataBlocksSkeleton />} + {!isLoadingMetadataBlocksToRender && metadataBlocks.length > 0 && ( + <Accordion defaultActiveKey="0"> + {metadataBlocks.map((metadataBlock, index) => ( + <Accordion.Item eventKey={index.toString()} key={metadataBlock.id}> + <Accordion.Header>{metadataBlock.displayName}</Accordion.Header> + <Accordion.Body> + <MetadataBlockFormFields metadataBlock={metadataBlock} /> + </Accordion.Body> + </Accordion.Item> + ))} + </Accordion> + )} + <SeparationLine /> <Alert variant={'info'} customHeading={t('metadataTip.title')} dismissible={false}> {t('metadataTip.content')} diff --git a/src/sections/create-dataset/MetadataBlocksSkeleton.tsx b/src/sections/create-dataset/MetadataBlocksSkeleton.tsx new file mode 100644 index 000000000..845839380 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlocksSkeleton.tsx @@ -0,0 +1,47 @@ +import { Accordion, Col, Row } from '@iqss/dataverse-design-system' +import Skeleton, { SkeletonTheme } from 'react-loading-skeleton' + +export const MetadataBlocksSkeleton = () => { + return ( + <Accordion defaultActiveKey="0"> + <SkeletonTheme> + <Accordion.Item eventKey="0"> + <Accordion.Header> + <Skeleton width="120px" /> + </Accordion.Header> + <Accordion.Body> + {Array.from({ length: 4 }).map((_, index) => ( + <Row style={{ marginBottom: '1rem' }} key={index}> + <Col sm={3}> + <Skeleton width="120px" /> + </Col> + <Col sm={9}> + <Skeleton height="40px" /> + </Col> + </Row> + ))} + {Array.from({ length: 3 }).map((_, index) => ( + <Row style={{ marginBottom: '1rem' }} key={index}> + <Col sm={3}> + <Skeleton width="120px" /> + </Col> + <Col sm={9}> + <Row> + <Col> + <Skeleton width="120px" /> + <Skeleton height="40px" /> + </Col> + <Col> + <Skeleton width="120px" /> + <Skeleton height="40px" /> + </Col> + </Row> + </Col> + </Row> + ))} + </Accordion.Body> + </Accordion.Item> + </SkeletonTheme> + </Accordion> + ) +} From e2b3160c50a4cbaad9923f79a58748955232e576 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Wed, 27 Mar 2024 10:33:11 -0300 Subject: [PATCH 12/20] feat(design system): Clone through fragments recursively --- .../components/form/form-group/FormGroup.tsx | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/design-system/src/lib/components/form/form-group/FormGroup.tsx b/packages/design-system/src/lib/components/form/form-group/FormGroup.tsx index 1420c0ce8..f26432afa 100644 --- a/packages/design-system/src/lib/components/form/form-group/FormGroup.tsx +++ b/packages/design-system/src/lib/components/form/form-group/FormGroup.tsx @@ -25,12 +25,7 @@ function FormGroup({ children, ...props }: PropsWithChildren<FormGroupProps>) { - const childrenWithRequiredProp = React.Children.map(children as JSX.Element, (child) => { - return React.cloneElement(child, { - required: required, - withinMultipleFieldsGroup: as === Col - }) - }) + const childrenWithRequiredProp = cloneThroughFragments(children, required, as) return ( <FormBS.Group @@ -42,6 +37,29 @@ function FormGroup({ </FormBS.Group> ) } +function cloneThroughFragments( + children: React.ReactNode, + required?: boolean, + as?: typeof Col | typeof Row +): React.ReactNode { + return React.Children.map(children, (child) => { + if (React.isValidElement(child)) { + if (child.type === React.Fragment) { + const hasChildren = (props: unknown): props is { children: React.ReactNode } => + typeof props === 'object' && Object.hasOwnProperty.call(props, 'children') + + if (hasChildren(child.props)) { + return cloneThroughFragments(child.props.children, required, as) + } + } + return React.cloneElement(child as React.ReactElement, { + required: required, + withinMultipleFieldsGroup: as === Col + }) + } + return child + }) +} FormGroup.Label = FormLabel FormGroup.Input = FormInput From 206a913bfa580f9219c882dbacac50146ff0c433 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Wed, 27 Mar 2024 10:42:55 -0300 Subject: [PATCH 13/20] feat: Allow form fields to inherit props like required and withinMultiple.. --- .../MetadataFormField/Fields/DateField.tsx | 11 ++--------- .../MetadataFormField/Fields/EmailField.tsx | 11 ++--------- .../MetadataFormField/Fields/FloatField.tsx | 11 ++--------- .../MetadataFormField/Fields/IntField.tsx | 11 ++--------- .../MetadataFormField/Fields/TextBoxField.tsx | 11 ++--------- .../MetadataFormField/Fields/TextField.tsx | 12 +++--------- .../MetadataFormField/Fields/UrlField.tsx | 11 ++--------- .../MetadataFormField/Fields/Vocabulary.tsx | 5 ++--- .../MetadataFormField/index.tsx | 8 +------- 9 files changed, 18 insertions(+), 73 deletions(-) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx index 1f758befd..a5c06799a 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } //TODO:ME Date component?? Add validation for dates? -export const DateField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const DateField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,7 @@ export const DateField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx index 595ac8949..90d7d9e0d 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } // TODO:ME Add validation for emails -export const EmailField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const EmailField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,7 @@ export const EmailField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx index ac368502b..489d62ef6 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } //TODO:ME Add validation for floating numbers? -export const FloatField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const FloatField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,7 @@ export const FloatField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx index 5a14a9f51..bc2b2921a 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } //TODO:ME Add validation for integers? -export const IntField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const IntField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,7 @@ export const IntField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx index 3dfd1ecec..38fc1df93 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx @@ -5,23 +5,16 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } -export const TextBoxField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const TextBoxField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.TextArea name={name} disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx index 5f5c597d5..2f83124e2 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } -export const TextField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const TextField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,8 @@ export const TextField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + data-pepe="pepe" + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx index 1a4c7f76a..5502f4b90 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx @@ -5,16 +5,9 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean } //TODO:ME Add validation for urls? -export const UrlField = ({ - name, - onChange, - isInvalid, - disabled, - isInFieldGroup = false -}: Props) => { +export const UrlField = ({ name, onChange, isInvalid, disabled, ...props }: Props) => { return ( <Form.Group.Input type="text" @@ -22,7 +15,7 @@ export const UrlField = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup} + {...props} /> ) } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx index f0d00dbda..3139e6bc2 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -6,7 +6,6 @@ interface Props { onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void isInvalid: boolean disabled: boolean - isInFieldGroup?: boolean // allowMultiple?: boolean } // TODO: Implement a multiple select with autocomplete like in JSF version @@ -17,7 +16,7 @@ export const Vocabulary = ({ isInvalid, disabled, // allowMultiple, - isInFieldGroup = false + ...props }: Props) => { return ( <Form.Group.Select @@ -25,7 +24,7 @@ export const Vocabulary = ({ disabled={disabled} onChange={onChange} isInvalid={isInvalid} - withinMultipleFieldsGroup={isInFieldGroup}> + {...props}> <option value="">Select</option> {options.map((option) => ( <option key={option} value={option}> diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index f30c3fc93..e3f4188d8 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -87,7 +87,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.Textbox && ( @@ -96,7 +95,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.URL && ( @@ -105,7 +103,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.Email && ( @@ -114,7 +111,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.Int && ( @@ -123,7 +119,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.Float && ( @@ -132,7 +127,6 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} {type === TypeMetadataFieldOptions.Date && ( @@ -141,10 +135,10 @@ export const MetadataFormField = ({ onChange={(e) => console.log(e)} disabled={false} isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} /> )} </> + <Form.Group.Feedback type="invalid"> Automatically get error from the validation library (Field is required, Field should have bla blah, etc.) From 787264bf95fb5409bb4535894f78856832c2b902 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Wed, 27 Mar 2024 17:29:11 -0300 Subject: [PATCH 14/20] test(Dynamic Fields): Add component test for dynamic fields --- .../create-dataset/CreateDatasetForm.tsx | 7 +- .../MetadataFormField/Fields/DateField.tsx | 3 +- .../MetadataFormField/Fields/EmailField.tsx | 3 +- .../MetadataFormField/Fields/FloatField.tsx | 3 +- .../MetadataFormField/Fields/IntField.tsx | 3 +- .../MetadataFormField/Fields/TextBoxField.tsx | 2 +- .../MetadataFormField/Fields/TextField.tsx | 3 +- .../MetadataFormField/Fields/UrlField.tsx | 3 +- .../MetadataFormField/Fields/Vocabulary.tsx | 2 +- .../MetadataFormField/index.tsx | 108 ++-- .../create-dataset/CreateDatasetForm.spec.tsx | 318 +++++++---- .../domain/models/MetadataBlockInfoMother.ts | 538 +++++++++++++++++- 12 files changed, 822 insertions(+), 171 deletions(-) diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 7aa4b09d7..7c00b20c1 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -85,7 +85,7 @@ export function CreateDatasetForm({ {/* METADATA BLOCKS */} {isLoadingMetadataBlocksToRender && <MetadataBlocksSkeleton />} {!isLoadingMetadataBlocksToRender && metadataBlocks.length > 0 && ( - <Accordion defaultActiveKey="0"> + <Accordion defaultActiveKey="0" data-testid="metadatablocks-accordion"> {metadataBlocks.map((metadataBlock, index) => ( <Accordion.Item eventKey={index.toString()} key={metadataBlock.id}> <Accordion.Header>{metadataBlock.displayName}</Accordion.Header> @@ -101,10 +101,7 @@ export function CreateDatasetForm({ <Alert variant={'info'} customHeading={t('metadataTip.title')} dismissible={false}> {t('metadataTip.content')} </Alert> - <Button - type="submit" - // disabled={submissionStatus === SubmissionStatus.IsSubmitting} - > + <Button type="submit" disabled={submissionStatus === SubmissionStatus.IsSubmitting}> {t('saveButton')} </Button> <Button withSpacing variant="secondary" type="button" onClick={handleCancel}> diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx index a5c06799a..51042017d 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,6 +15,7 @@ export const DateField = ({ name, onChange, isInvalid, disabled, ...props }: Pro disabled={disabled} onChange={onChange} isInvalid={isInvalid} + data-testid="date-field" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx index 90d7d9e0d..760f22a3b 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,6 +15,7 @@ export const EmailField = ({ name, onChange, isInvalid, disabled, ...props }: Pr disabled={disabled} onChange={onChange} isInvalid={isInvalid} + data-testid="email-field" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx index 489d62ef6..226eda81f 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,6 +15,7 @@ export const FloatField = ({ name, onChange, isInvalid, disabled, ...props }: Pr disabled={disabled} onChange={onChange} isInvalid={isInvalid} + data-testid="float-field" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx index bc2b2921a..86c92c62a 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,6 +15,7 @@ export const IntField = ({ name, onChange, isInvalid, disabled, ...props }: Prop disabled={disabled} onChange={onChange} isInvalid={isInvalid} + data-testid="int-field" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx index 38fc1df93..a617754fa 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx index 2f83124e2..9c44c5c83 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,7 +15,6 @@ export const TextField = ({ name, onChange, isInvalid, disabled, ...props }: Pro disabled={disabled} onChange={onChange} isInvalid={isInvalid} - data-pepe="pepe" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx index 5502f4b90..9ba378d33 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } @@ -15,6 +15,7 @@ export const UrlField = ({ name, onChange, isInvalid, disabled, ...props }: Prop disabled={disabled} onChange={onChange} isInvalid={isInvalid} + data-testid="url-field" {...props} /> ) diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx index 3139e6bc2..923f0d6a5 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -3,7 +3,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string options: string[] - onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void + onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void isInvalid: boolean disabled: boolean // allowMultiple?: boolean diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index e3f4188d8..6cc4e9cb2 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -73,7 +73,52 @@ export const MetadataFormField = ({ ) } + if (isSafeControlledVocabulary) { + if (multiple) { + return ( + <Form.CheckboxGroup + title={title} + message={description} + required={isRequired} + isInvalid={false}> + <div className={styles['checkbox-list-grid']}> + {controlledVocabularyValues.map((value) => ( + <Form.Group.Checkbox + name={name} + label={value} + id={`${name}-checkbox-${value}`} + value={value} + // onChange={(e) => console.log(e)} + key={value} + /> + ))} + </div> + </Form.CheckboxGroup> + ) + } + return ( + <Form.Group + controlId={name} + required={isRequired} + as={withinMultipleFieldsGroup ? Col : undefined}> + <Form.Group.Label message={description}>{title}</Form.Group.Label> + <Vocabulary + name={name} + // onChange={(e) => console.log(e)} + disabled={false} + isInvalid={false} + options={controlledVocabularyValues} + /> + <Form.Group.Feedback type="invalid"> + Automatically get error from the validation library (Field is required, Field should have + bla blah, etc.) + </Form.Group.Feedback> + </Form.Group> + ) + } + if (isSafePrimitive) { + // Default to a primitive always return ( <Form.Group controlId={name} @@ -84,7 +129,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Text && ( <TextField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -92,7 +137,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Textbox && ( <TextBoxField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -100,7 +145,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.URL && ( <UrlField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -108,7 +153,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Email && ( <EmailField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -116,7 +161,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Int && ( <IntField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -124,7 +169,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Float && ( <FloatField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -132,7 +177,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Date && ( <DateField name={name} - onChange={(e) => console.log(e)} + // onChange={(e) => console.log(e)} disabled={false} isInvalid={false} /> @@ -147,52 +192,5 @@ export const MetadataFormField = ({ ) } - if (isSafeControlledVocabulary) { - if (multiple) { - return ( - <Form.CheckboxGroup - title={title} - message={description} - required={isRequired} - isInvalid={false}> - <div className={styles['checkbox-list-grid']}> - {controlledVocabularyValues.map((value) => { - return ( - <Form.Group.Checkbox - name={name} - label={value} - id={`${name}-checkbox-${value}`} - value={value} - onChange={(e) => console.log(e)} - key={value} - /> - ) - })} - </div> - </Form.CheckboxGroup> - ) - } - return ( - <Form.Group - controlId={name} - required={isRequired} - as={withinMultipleFieldsGroup ? Col : undefined}> - <Form.Group.Label message={description}>{title}</Form.Group.Label> - <Vocabulary - name={name} - onChange={(e) => console.log(e)} - disabled={false} - isInvalid={false} - isInFieldGroup={withinMultipleFieldsGroup} - options={controlledVocabularyValues} - /> - <Form.Group.Feedback type="invalid"> - Automatically get error from the validation library (Field is required, Field should have - bla blah, etc.) - </Form.Group.Feedback> - </Form.Group> - ) - } - - return <p>Not implemented</p> + return null } diff --git a/tests/component/create-dataset/CreateDatasetForm.spec.tsx b/tests/component/create-dataset/CreateDatasetForm.spec.tsx index b585dae60..cd39ae36e 100644 --- a/tests/component/create-dataset/CreateDatasetForm.spec.tsx +++ b/tests/component/create-dataset/CreateDatasetForm.spec.tsx @@ -1,151 +1,267 @@ import { CreateDatasetForm } from '../../../src/sections/create-dataset/CreateDatasetForm' import { DatasetRepository } from '../../../src/dataset/domain/repositories/DatasetRepository' +import { MetadataBlockInfoRepository } from '../../../src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository' +import { MetadataBlockInfoMother } from '../metadata-block-info/domain/models/MetadataBlockInfoMother' const datasetRepository: DatasetRepository = {} as DatasetRepository +const metadataBlockInfoRepository: MetadataBlockInfoRepository = {} as MetadataBlockInfoRepository + +const collectionMetadataBlocksInfo = MetadataBlockInfoMother.getByCollectionIdResponse() + describe('Create Dataset', () => { beforeEach(() => { datasetRepository.create = cy.stub().resolves({ persistentId: 'persistentId' }) + metadataBlockInfoRepository.getByColecctionId = cy.stub().resolves(collectionMetadataBlocksInfo) }) - it('renders the Create Dataset page and its contents', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + it('renders the Create Dataset page and its metadata blocks sections', () => { + cy.customMount( + <CreateDatasetForm + repository={datasetRepository} + metadataBlockInfoRepository={metadataBlockInfoRepository} + /> + ) cy.findByText(/Create Dataset/i).should('exist') - cy.findByLabelText(/Title/i).should('exist').should('have.attr', 'required', 'required') - cy.findByText('Title').children('div').trigger('mouseover') - cy.findByText('The main title of the Dataset').should('exist') - - cy.findByLabelText(/Author Name/i) - .should('exist') - .should('have.attr', 'required', 'required') - cy.findByText('Author Name').children('div').trigger('mouseover') - cy.findByText( - "The name of the author, such as the person's name or the name of an organization" - ).should('exist') - - cy.findByLabelText(/Point of Contact E-mail/i) - .should('exist') - .should('have.attr', 'required', 'required') - cy.findByText('Point of Contact E-mail').children('div').trigger('mouseover', { force: true }) - cy.findByText("The point of contact's e-mail address").should('exist') - - cy.findByLabelText(/Description Text/i) - .should('exist') - .should('have.attr', 'required', 'required') - cy.findByText('Description Text').children('div').trigger('mouseover') - cy.findByText('A summary describing the purpose, nature and scope of the Dataset').should( - 'exist' - ) + cy.findByTestId('metadatablocks-accordion').should('exist') + cy.findByTestId('metadatablocks-accordion').children().should('have.length', 2) - cy.findByText('Subject').should('exist') - cy.findByText('Subject').children('div').trigger('mouseover') - cy.findByText('The area of study relevant to the Dataset').should('exist') + cy.get('[data-testid="metadatablocks-accordion"] > :nth-child(1)').within((_$accordionItem) => { + cy.findByText(/Citation Metadata/i).should('exist') + }) - cy.findByText(/Save Dataset/i).should('exist') - - cy.findByText(/Cancel/i).should('exist') + cy.get('[data-testid="metadatablocks-accordion"] > :nth-child(2)').within((_$accordionItem) => { + cy.findByText(/Geospatial Metadata/i).should('exist') + }) }) - it('shows an error message when the title is not provided', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) - - cy.findByText(/Save Dataset/i).click() + it('renders the Citation Meatadata Form Fields correctly', () => { + cy.customMount( + <CreateDatasetForm + repository={datasetRepository} + metadataBlockInfoRepository={metadataBlockInfoRepository} + /> + ) + // Check the first accordion item content + cy.get('[data-testid="metadatablocks-accordion"] > :nth-child(1)').within((_$accordionItem) => { + cy.findByText(/Citation Metadata/i).should('exist') + + // Title field - required + cy.findByText('Title').should('exist') + cy.findByLabelText(/Title/).should('exist').should('have.attr', 'required', 'required') + cy.findByText(/Title/).children('div').trigger('mouseover') + cy.document().its('body').findByText('The main title of the Dataset').should('exist') + + // Subtitle field - not required + cy.findByText('Subtitle').should('exist') + cy.findByLabelText(/Subtitle/) + .should('exist') + .should('not.have.attr', 'required') + cy.findByText(/Subtitle/) + .children('div') + .trigger('mouseover') + cy.document() + .its('body') + .findByText( + 'A secondary title that amplifies or states certain limitations on the main title' + ) + .should('exist') + + // Author field - compound + cy.findByText('Author').should('exist') + + // Check properties inside the Author compound + cy.findByText('Author') + .closest('.row') + .within(() => { + // Author Name property + cy.findByLabelText(/Name/).should('exist') + // Author identifier - Vocabulary + cy.findByLabelText(/Identifier Type/).should('exist') + cy.findByLabelText(/Identifier Type/).should('have.prop', 'tagName', 'SELECT') + cy.findByLabelText(/Identifier Type/) + .children('option') + .should('have.length', 9) + }) + + // Notes field - TEXTBOX + cy.findByText('Notes').should('exist') + cy.findByLabelText(/Notes/).should('exist') + cy.findByLabelText(/Notes/).should('have.prop', 'tagName', 'TEXTAREA') + + // Producer URL field - URL + cy.findByText('Producer URL').should('exist') + cy.findByLabelText(/Producer URL/).should('exist') + cy.findByTestId('url-field').should('exist') + + // E-mail field - EMAIL + cy.findByText('E-mail').should('exist') + cy.findByLabelText(/E-mail/).should('exist') + cy.findByTestId('email-field').should('exist') + + // Description Date field - DATE + cy.findByText('Description Date').should('exist') + cy.findByLabelText(/Description Date/).should('exist') + cy.findByTestId('date-field').should('exist') + + // Float Something field - FLOAT + cy.findByText('Float Something').should('exist') + cy.findByLabelText(/Float Something/).should('exist') + cy.findByTestId('float-field').should('exist') + + // Integer Something field - INT + cy.findByText('Integer Something').should('exist') + cy.findByLabelText(/Integer Something/).should('exist') + cy.findByTestId('int-field').should('exist') + + // TODO:ME: Check the multiple select (checbox being rendered when voacabullary multiple) + }) - cy.findByText('Title is required.').should('exist') + cy.findByText(/Save Dataset/i).should('exist') - cy.findByText('Error: Submission failed.').should('exist') + cy.findByText(/Cancel/i).should('exist') }) - it('shows an error message when the author name is not provided', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // it.skip('shows an error message when the title is not provided', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - cy.findByText(/Save Dataset/i).click() + // cy.findByText(/Save Dataset/i).click() - cy.findByText('Author name is required.').should('exist') + // cy.findByText('Title is required.').should('exist') - cy.findByText('Error: Submission failed.').should('exist') - }) + // cy.findByText('Error: Submission failed.').should('exist') + // }) - it('shows an error message when the point of contact email is not provided', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // it.skip('shows an error message when the author name is not provided', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - cy.findByText(/Save Dataset/i).click() + // cy.findByText(/Save Dataset/i).click() - cy.findByText('Point of Contact E-mail is required.').should('exist') + // cy.findByText('Author name is required.').should('exist') - cy.findByText('Error: Submission failed.').should('exist') - }) + // cy.findByText('Error: Submission failed.').should('exist') + // }) - it('shows an error message when the point of contact email is not a valid email', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // it.skip('shows an error message when the point of contact email is not provided', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - cy.findByLabelText(/Point of Contact E-mail/i) - .type('email') - .and('have.value', 'email') + // cy.findByText(/Save Dataset/i).click() - cy.findByText(/Save Dataset/i).click() + // cy.findByText('Point of Contact E-mail is required.').should('exist') - cy.findByText('Point of Contact E-mail is required.').should('exist') + // cy.findByText('Error: Submission failed.').should('exist') + // }) - cy.findByText('Error: Submission failed.').should('exist') - }) + // it.skip('shows an error message when the point of contact email is not a valid email', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - it('shows an error message when the description text is not provided', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // cy.findByLabelText(/Point of Contact E-mail/i) + // .type('email') + // .and('have.value', 'email') - cy.findByText(/Save Dataset/i).click() + // cy.findByText(/Save Dataset/i).click() - cy.findByText('Description Text is required.').should('exist') + // cy.findByText('Point of Contact E-mail is required.').should('exist') - cy.findByText('Error: Submission failed.').should('exist') - }) + // cy.findByText('Error: Submission failed.').should('exist') + // }) - it('shows an error message when the subject is not provided', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // it.skip('shows an error message when the description text is not provided', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - cy.findByText(/Save Dataset/i).click() + // cy.findByText(/Save Dataset/i).click() - cy.findByText('Subject is required.').should('exist') + // cy.findByText('Description Text is required.').should('exist') - cy.findByText('Error: Submission failed.').should('exist') - }) + // cy.findByText('Error: Submission failed.').should('exist') + // }) - it('can submit a valid form', () => { - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // it.skip('shows an error message when the subject is not provided', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) - cy.findByLabelText(/Title/i).type('Test Dataset Title').and('have.value', 'Test Dataset Title') + // cy.findByText(/Save Dataset/i).click() - cy.findByLabelText(/Author Name/i) - .type('Test author name') - .and('have.value', 'Test author name') + // cy.findByText('Subject is required.').should('exist') - cy.findByLabelText(/Point of Contact E-mail/i) - .type('email@test.com') - .and('have.value', 'email@test.com') + // cy.findByText('Error: Submission failed.').should('exist') + // }) - cy.findByLabelText(/Description Text/i) - .type('Test description text') - .and('have.value', 'Test description text') + // it.skip('can submit a valid form', () => { + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) + + // cy.findByLabelText(/Title/i).type('Test Dataset Title').and('have.value', 'Test Dataset Title') - cy.findByLabelText(/Arts and Humanities/i) - .check() - .should('be.checked') + // cy.findByLabelText(/Author Name/i) + // .type('Test author name') + // .and('have.value', 'Test author name') - cy.findByText(/Save Dataset/i).click() - cy.findByText('Form submitted successfully!') - }) + // cy.findByLabelText(/Point of Contact E-mail/i) + // .type('email@test.com') + // .and('have.value', 'email@test.com') - it('shows an error message when the submission fails', () => { - datasetRepository.create = cy.stub().rejects() - cy.customMount(<CreateDatasetForm repository={datasetRepository} />) + // cy.findByLabelText(/Description Text/i) + // .type('Test description text') + // .and('have.value', 'Test description text') + + // cy.findByLabelText(/Arts and Humanities/i) + // .check() + // .should('be.checked') - cy.findByLabelText(/Title/i).type('Test Dataset Title') - cy.findByLabelText(/Author Name/i).type('Test author name') - cy.findByLabelText(/Point of Contact E-mail/i).type('email@test.com') - cy.findByLabelText(/Description Text/i).type('Test description text') - cy.findByLabelText(/Arts and Humanities/i).check() + // cy.findByText(/Save Dataset/i).click() + // cy.findByText('Form submitted successfully!') + // }) - cy.findByText(/Save Dataset/i).click() - cy.findByText('Error: Submission failed.').should('exist') - }) + // it.skip('shows an error message when the submission fails', () => { + // datasetRepository.create = cy.stub().rejects() + // cy.customMount( + // <CreateDatasetForm + // repository={datasetRepository} + // metadataBlockInfoRepository={metadataBlockInfoRepository} + // /> + // ) + + // cy.findByLabelText(/Title/i).type('Test Dataset Title') + // cy.findByLabelText(/Author Name/i).type('Test author name') + // cy.findByLabelText(/Point of Contact E-mail/i).type('email@test.com') + // cy.findByLabelText(/Description Text/i).type('Test description text') + // cy.findByLabelText(/Arts and Humanities/i).check() + + // cy.findByText(/Save Dataset/i).click() + // cy.findByText('Error: Submission failed.').should('exist') + // }) }) diff --git a/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts b/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts index c31293d05..4b6c2b8a6 100644 --- a/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts +++ b/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts @@ -1,4 +1,7 @@ -import { MetadataBlockInfo } from '../../../../../src/metadata-block-info/domain/models/MetadataBlockInfo' +import { + MetadataBlockInfo, + MetadataBlockInfo2 +} from '../../../../../src/metadata-block-info/domain/models/MetadataBlockInfo' import { MetadataBlockName } from '../../../../../src/dataset/domain/models/Dataset' export class MetadataBlockInfoMother { @@ -29,4 +32,537 @@ export class MetadataBlockInfoMother { ...props } } + + static getByCollectionIdResponse(): MetadataBlockInfo2[] { + return [ + { + id: 1, + displayName: 'Citation Metadatata', + name: MetadataBlockName.CITATION, + displayOnCreate: true, + metadataFields: { + title: { + name: 'title', + displayName: 'Title', + title: 'Title', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The main title of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOnCreate: true, + displayOrder: 0 + }, + subtitle: { + name: 'subtitle', + displayName: 'Subtitle', + title: 'Subtitle', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'A secondary title that amplifies or states certain limitations on the main title', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + displayOnCreate: true, + isRequired: false, + displayOrder: 1 + }, + author: { + name: 'author', + displayName: 'Author', + title: 'Author', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'The entity, e.g. a person or organization, that created the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 7, + displayOnCreate: true, + childMetadataFields: { + authorName: { + name: 'authorName', + displayName: 'Author Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) Family Name, Given Name or 2) Organization XYZ', + description: + "The name of the author, such as the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOnCreate: true, + displayOrder: 8 + }, + authorIdentifierScheme: { + name: 'authorIdentifierScheme', + displayName: 'Author Identifier Type', + title: 'Identifier Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The type of identifier that uniquely identifies the author (e.g. ORCID, ISNI)', + multiple: false, + isControlledVocabulary: true, + displayFormat: '- #VALUE:', + isRequired: false, + displayOnCreate: true, + displayOrder: 10, + controlledVocabularyValues: [ + 'ORCID', + 'ISNI', + 'LCNA', + 'VIAF', + 'GND', + 'DAI', + 'ResearcherID', + 'ScopusID' + ] + } + } + }, + notesText: { + name: 'notesText', + displayName: 'Notes', + title: 'Notes', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Additional information about the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 33, + displayOnCreate: true + }, + producerURL: { + name: 'producerURL', + displayName: 'Producer URL', + title: 'Producer URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the producer's website", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 39 + }, + datasetContactEmail: { + name: 'datasetContactEmail', + displayName: 'Point of Contact E-mail', + title: 'E-mail', + type: 'EMAIL', + typeClass: 'primitive', + watermark: 'name@email.xyz', + description: "The point of contact's email address", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#EMAIL', + isRequired: true, + displayOnCreate: true, + displayOrder: 15 + }, + dsDescriptionDate: { + name: 'dsDescriptionDate', + displayName: 'Description Date', + title: 'Description Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 18 + }, + floatSomething: { + name: 'floatSomething', + displayName: 'Float Something', + title: 'Float Something', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The central wavelength of the spectral bandpass, in meters.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 8 + }, + integerSomething: { + name: 'integerSomething', + displayName: 'Integer Something', + title: 'Integer Something', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer.', + description: 'The total number of objects, catalog entries, etc., in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 18 + } + } + }, + { + id: 2, + displayName: 'Geospatial Metadata', + name: MetadataBlockName.GEOSPATIAL, + displayOnCreate: true, + metadataFields: { + geographicCoverage: { + name: 'geographicCoverage', + displayName: 'Geographic Coverage', + title: 'Geographic Coverage', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Information on the geographic coverage of the data. Includes the total geographic scope of the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0, + displayOnCreate: true, + childMetadataFields: { + country: { + name: 'country', + displayName: 'Geographic Coverage Country / Nation', + title: 'Country / Nation', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The country or nation that the Dataset is about.', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 1, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'American Samoa', + 'Andorra', + 'Angola', + 'Anguilla', + 'Antarctica', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Aruba', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bermuda', + 'Bhutan', + 'Bolivia, Plurinational State of', + 'Bonaire, Sint Eustatius and Saba', + 'Bosnia and Herzegovina', + 'Botswana', + 'Bouvet Island', + 'Brazil', + 'British Indian Ocean Territory', + 'Brunei Darussalam', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Cayman Islands', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Christmas Island', + 'Cocos (Keeling) Islands', + 'Colombia', + 'Comoros', + 'Congo', + 'Congo, the Democratic Republic of the', + 'Cook Islands', + 'Costa Rica', + 'Croatia', + 'Cuba', + 'Curaçao', + 'Cyprus', + 'Czech Republic', + "Côte d'Ivoire", + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Falkland Islands (Malvinas)', + 'Faroe Islands', + 'Fiji', + 'Finland', + 'France', + 'French Guiana', + 'French Polynesia', + 'French Southern Territories', + 'Gabon', + 'Gambia', + 'Georgia', + 'Germany', + 'Ghana', + 'Gibraltar', + 'Greece', + 'Greenland', + 'Grenada', + 'Guadeloupe', + 'Guam', + 'Guatemala', + 'Guernsey', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Heard Island and Mcdonald Islands', + 'Holy See (Vatican City State)', + 'Honduras', + 'Hong Kong', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran, Islamic Republic of', + 'Iraq', + 'Ireland', + 'Isle of Man', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jersey', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + "Korea, Democratic People's Republic of", + 'Korea, Republic of', + 'Kuwait', + 'Kyrgyzstan', + "Lao People's Democratic Republic", + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macao', + 'Macedonia, the Former Yugoslav Republic of', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Martinique', + 'Mauritania', + 'Mauritius', + 'Mayotte', + 'Mexico', + 'Micronesia, Federated States of', + 'Moldova, Republic of', + 'Monaco', + 'Mongolia', + 'Montenegro', + 'Montserrat', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Caledonia', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Niue', + 'Norfolk Island', + 'Northern Mariana Islands', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Palestine, State of', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Pitcairn', + 'Poland', + 'Portugal', + 'Puerto Rico', + 'Qatar', + 'Romania', + 'Russian Federation', + 'Rwanda', + 'Réunion', + 'Saint Barthélemy', + 'Saint Helena, Ascension and Tristan da Cunha', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Martin (French part)', + 'Saint Pierre and Miquelon', + 'Saint Vincent and the Grenadines', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Sint Maarten (Dutch part)', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'South Georgia and the South Sandwich Islands', + 'South Sudan', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Svalbard and Jan Mayen', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syrian Arab Republic', + 'Taiwan, Province of China', + 'Tajikistan', + 'Tanzania, United Republic of', + 'Thailand', + 'Timor-Leste', + 'Togo', + 'Tokelau', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Turks and Caicos Islands', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'United States Minor Outlying Islands', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Venezuela, Bolivarian Republic of', + 'Viet Nam', + 'Virgin Islands, British', + 'Virgin Islands, U.S.', + 'Wallis and Futuna', + 'Western Sahara', + 'Yemen', + 'Zambia', + 'Zimbabwe', + 'Åland Islands' + ] + }, + state: { + name: 'state', + displayName: 'Geographic Coverage State / Province', + title: 'State / Province', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + city: { + name: 'city', + displayName: 'Geographic Coverage City', + title: 'City', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + otherGeographicCoverage: { + name: 'otherGeographicCoverage', + displayName: 'Geographic Coverage Other', + title: 'Other', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Other information on the geographic coverage of the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 4 + } + } + } + } + } + ] + } } From 9b491d4e99ac614a9c77f6d57e167c846567ce33 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 16:08:24 -0300 Subject: [PATCH 15/20] test(Dynamic Fields): Refactor Fields --- .../MetadataFormField/Fields/DateField.tsx | 2 +- .../MetadataFormField/Fields/EmailField.tsx | 2 +- .../MetadataFormField/Fields/FloatField.tsx | 2 +- .../MetadataFormField/Fields/IntField.tsx | 2 +- .../MetadataFormField/Fields/TextBoxField.tsx | 2 +- .../MetadataFormField/Fields/TextField.tsx | 2 +- .../MetadataFormField/Fields/UrlField.tsx | 2 +- .../MetadataFormField/Fields/Vocabulary.tsx | 8 ++-- .../Fields/VocabularyMultiple.tsx | 46 +++++++++++++++++++ .../MetadataBlockFormFields/index.tsx | 12 ++++- 10 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/VocabularyMultiple.tsx diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx index 51042017d..2699386aa 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/DateField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx index 760f22a3b..86137dd7a 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/EmailField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx index 226eda81f..979e79086 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/FloatField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx index 86c92c62a..5bfcc9a41 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/IntField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx index a617754fa..41616a441 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextBoxField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx index 9c44c5c83..e64db15e0 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/TextField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx index 9ba378d33..dccc5f956 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/UrlField.tsx @@ -2,7 +2,7 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string - onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void isInvalid: boolean disabled: boolean } diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx index 923f0d6a5..b6ffc10c0 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -3,19 +3,17 @@ import { Form } from '@iqss/dataverse-design-system' interface Props { name: string options: string[] - onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void + onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void isInvalid: boolean disabled: boolean - // allowMultiple?: boolean } // TODO: Implement a multiple select with autocomplete like in JSF version export const Vocabulary = ({ name, options, onChange, - isInvalid, + isInvalid: _isInvalid, //TODO:ME: Why isInvalid complaining? disabled, - // allowMultiple, ...props }: Props) => { return ( @@ -23,7 +21,7 @@ export const Vocabulary = ({ name={name} disabled={disabled} onChange={onChange} - isInvalid={isInvalid} + // isInvalid={isInvalid} {...props}> <option value="">Select</option> {options.map((option) => ( diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/VocabularyMultiple.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/VocabularyMultiple.tsx new file mode 100644 index 000000000..2398067c6 --- /dev/null +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/VocabularyMultiple.tsx @@ -0,0 +1,46 @@ +import { Form } from '@iqss/dataverse-design-system' +import styles from '../index.module.scss' + +interface Props { + title: string + name: string + description: string + options: string[] + onChange: (event: React.ChangeEvent<HTMLInputElement>) => void + isRequired: boolean + isInvalid: boolean + disabled: boolean +} + +export const VocabularyMultiple = ({ + title, + name, + description, + options, + onChange, + isRequired, + isInvalid, + disabled +}: Props) => { + return ( + <Form.CheckboxGroup + title={title} + message={description} + required={isRequired} + isInvalid={isInvalid}> + <div className={styles['checkbox-list-grid']} data-testid="vocabulary-multiple"> + {options.map((value) => ( + <Form.Group.Checkbox + name={name} + label={value} + id={`${name}-checkbox-${value}`} + value={value} + onChange={onChange} + disabled={disabled} + key={value} + /> + ))} + </div> + </Form.CheckboxGroup> + ) +} diff --git a/src/sections/create-dataset/MetadataBlockFormFields/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/index.tsx index 7e4d3b898..5f207d897 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/index.tsx @@ -1,17 +1,25 @@ +import { ChangeEvent } from 'react' import { MetadataBlockInfo2 } from '../../../metadata-block-info/domain/models/MetadataBlockInfo' import { MetadataFormField } from './MetadataFormField' interface Props { metadataBlock: MetadataBlockInfo2 + onChangeField: <T extends HTMLElement>(event: ChangeEvent<T>) => void } -export const MetadataBlockFormFields = ({ metadataBlock }: Props) => { +export const MetadataBlockFormFields = ({ metadataBlock, onChangeField }: Props) => { const { metadataFields, name: _name } = metadataBlock return ( <> {Object.entries(metadataFields).map(([metadataFieldKey, metadataFieldInfo]) => { - return <MetadataFormField key={metadataFieldKey} metadataFieldInfo={metadataFieldInfo} /> + return ( + <MetadataFormField + key={metadataFieldKey} + metadataFieldInfo={metadataFieldInfo} + onChangeField={onChangeField} + /> + ) })} </> ) From aa05e09be9b4330a78dcb4b6a913bc00c284eb45 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 16:10:36 -0300 Subject: [PATCH 16/20] test(Dynamic Fields): Multiple refactor to use mocked data response --- .../MetadataBlockInfoJSDataverseRepository.ts | 4 +- .../create-dataset/CreateDatasetFactory.tsx | 6 +- .../create-dataset/CreateDatasetForm.tsx | 63 +- .../MetadataFormField/Fields/index.ts | 1 + .../MetadataFormField/index.tsx | 56 +- .../create-dataset/MetadataBlocksSkeleton.tsx | 2 +- ...etadataBlocksInfoByCollectionIdResponse.ts | 3433 ---------------- .../useGetMetadataBlocksInfo.tsx | 2 +- .../domain/models/MetadataBlockInfoMother.ts | 3469 +++++++++++++++++ 9 files changed, 3542 insertions(+), 3494 deletions(-) delete mode 100644 src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts diff --git a/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts b/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts index 9b8327af1..1186f8019 100644 --- a/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts +++ b/src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository.ts @@ -6,7 +6,7 @@ import { ReadError } from '@iqss/dataverse-client-javascript' import { JSMetadataBlockInfoMapper } from '../mappers/JSMetadataBlockInfoMapper' -import { metadataBlocksInfoByCollectionIdResponse } from '../../../sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse' +import { MetadataBlockInfoMother } from '../../../../tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother' export class MetadataBlockInfoJSDataverseRepository implements MetadataBlockInfoRepository { getByName(name: string): Promise<MetadataBlockInfo | undefined> { @@ -23,7 +23,7 @@ export class MetadataBlockInfoJSDataverseRepository implements MetadataBlockInfo getByColecctionId(_collectionId: string, _create: boolean): Promise<MetadataBlockInfo2[]> { return new Promise((resolve) => { setTimeout(() => { - resolve(metadataBlocksInfoByCollectionIdResponse) + resolve(MetadataBlockInfoMother.getByCollectionIdFullResponse()) }, 1_000) }) } diff --git a/src/sections/create-dataset/CreateDatasetFactory.tsx b/src/sections/create-dataset/CreateDatasetFactory.tsx index 52b1e8e07..38de93d0a 100644 --- a/src/sections/create-dataset/CreateDatasetFactory.tsx +++ b/src/sections/create-dataset/CreateDatasetFactory.tsx @@ -2,16 +2,18 @@ import { CreateDatasetForm } from './CreateDatasetForm' import { ReactElement } from 'react' import { DatasetJSDataverseRepository } from '../../dataset/infrastructure/repositories/DatasetJSDataverseRepository' import { MetadataBlockInfoJSDataverseRepository } from '../../metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository' +import { MetadataBlockInfoMockRepository } from '../../stories/create-dataset/MetadataBlockInfoMockRepository' const repository = new DatasetJSDataverseRepository() -const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository() +const _metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository() +const metadataBlockInfoMockRepository = new MetadataBlockInfoMockRepository() export class CreateDatasetFactory { static create(): ReactElement { return ( <CreateDatasetForm repository={repository} - metadataBlockInfoRepository={metadataBlockInfoRepository} + metadataBlockInfoRepository={metadataBlockInfoMockRepository} /> ) } diff --git a/src/sections/create-dataset/CreateDatasetForm.tsx b/src/sections/create-dataset/CreateDatasetForm.tsx index 7c00b20c1..cbce31ef4 100644 --- a/src/sections/create-dataset/CreateDatasetForm.tsx +++ b/src/sections/create-dataset/CreateDatasetForm.tsx @@ -4,13 +4,13 @@ import { useNavigate } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { RequiredFieldText } from '../shared/form/RequiredFieldText/RequiredFieldText' import { SeparationLine } from '../shared/layout/SeparationLine/SeparationLine' -import { useCreateDatasetForm, SubmissionStatus } from './useCreateDatasetForm' +// import { useCreateDatasetForm, SubmissionStatus } from './useCreateDatasetForm' import { useLoading } from '../loading/LoadingContext' import { DatasetRepository } from '../../dataset/domain/repositories/DatasetRepository' import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' -import { useDatasetFormData } from './useDatasetFormData' +// import { useDatasetFormData } from './useDatasetFormData' import { Route } from '../Route.enum' -import { useDatasetValidator } from './useDatasetValidator' +// import { useDatasetValidator } from './useDatasetValidator' import { useGetMetadataBlocksInfo } from './useGetMetadataBlocksInfo' // import { DatasetMetadataSubField } from '../../dataset/domain/models/Dataset' import { MetadataBlockFormFields } from './MetadataBlockFormFields' @@ -23,35 +23,40 @@ interface CreateDatasetFormProps { } export function CreateDatasetForm({ - repository, + repository: _repository, metadataBlockInfoRepository }: CreateDatasetFormProps) { const navigate = useNavigate() const { t } = useTranslation('createDataset') const { isLoading, setIsLoading } = useLoading() - const { metadataBlocks, isLoading: isLoadingMetadataBlocksToRender } = useGetMetadataBlocksInfo({ + const { + metadataBlocks, + isLoading: isLoadingMetadataBlocksToRender, + error: errorLoadingMetadataBlocksToRender + } = useGetMetadataBlocksInfo({ metadataBlockInfoRepository, collectionId: 'someCollectionId', // TODO:ME Get collection id from url? mode: 'create' }) - const { validationErrors, datasetIsValid } = useDatasetValidator() - const { formData, updateFormData } = useDatasetFormData(datasetIsValid) - const { submissionStatus, submitForm } = useCreateDatasetForm(repository, datasetIsValid) + const isErrorLoadingMetadataBlocksToRender = Boolean(errorLoadingMetadataBlocksToRender) + // const { validationErrors, datasetIsValid } = useDatasetValidator() + // const { formData, updateFormData } = useDatasetFormData(datasetIsValid) + // const { submissionStatus, submitForm } = useCreateDatasetForm(repository, datasetIsValid) - const handleFieldChange = (event: ChangeEvent<HTMLInputElement>) => { - const { name, checked } = event.target - const value = event.target.type === 'checkbox' && !checked ? '' : event.target.value + const handleFieldChange = <T extends HTMLElement>(event: ChangeEvent<T>) => { + // Cast event.target to HTMLInputElement or HTMLSelectElement or HTMLTextAreaElement + const target = event.target as unknown as + | HTMLInputElement + | HTMLSelectElement + | HTMLTextAreaElement + const { name: _name, type } = target + const _value = type === 'checkbox' && 'checked' in target && !target.checked ? '' : target.value // updateFormData(name, value) } const handleSubmit = (event: FormEvent<HTMLFormElement>) => { event.preventDefault() - const values = new FormData(event.currentTarget) - const formData = Object.fromEntries(values) - console.log(formData) - - // submitForm(formData) } const handleCancel = (event: MouseEvent<HTMLButtonElement>) => { @@ -69,19 +74,22 @@ export function CreateDatasetForm({ <h1>{t('pageTitle')}</h1> </header> <SeparationLine /> + <div className={styles.container}> <RequiredFieldText /> - {submissionStatus === SubmissionStatus.IsSubmitting && ( + {isErrorLoadingMetadataBlocksToRender && ( + <Alert variant="danger" dismissible={false}> + {errorLoadingMetadataBlocksToRender} + </Alert> + )} + {/* {submissionStatus === SubmissionStatus.IsSubmitting && ( <p>{t('datasetForm.status.submitting')}</p> )} {submissionStatus === SubmissionStatus.SubmitComplete && ( <p>{t('datasetForm.status.success')}</p> )} - {submissionStatus === SubmissionStatus.Errored && <p>{t('datasetForm.status.failed')}</p>} - <Form - onSubmit={(event: FormEvent<HTMLFormElement>) => { - handleSubmit(event) - }}> + {submissionStatus === SubmissionStatus.Errored && <p>{t('datasetForm.status.failed')}</p>} */} + <Form onSubmit={handleSubmit}> {/* METADATA BLOCKS */} {isLoadingMetadataBlocksToRender && <MetadataBlocksSkeleton />} {!isLoadingMetadataBlocksToRender && metadataBlocks.length > 0 && ( @@ -90,7 +98,10 @@ export function CreateDatasetForm({ <Accordion.Item eventKey={index.toString()} key={metadataBlock.id}> <Accordion.Header>{metadataBlock.displayName}</Accordion.Header> <Accordion.Body> - <MetadataBlockFormFields metadataBlock={metadataBlock} /> + <MetadataBlockFormFields + metadataBlock={metadataBlock} + onChangeField={handleFieldChange} + /> </Accordion.Body> </Accordion.Item> ))} @@ -101,7 +112,11 @@ export function CreateDatasetForm({ <Alert variant={'info'} customHeading={t('metadataTip.title')} dismissible={false}> {t('metadataTip.content')} </Alert> - <Button type="submit" disabled={submissionStatus === SubmissionStatus.IsSubmitting}> + <Button + type="submit" + disabled={isErrorLoadingMetadataBlocksToRender || isLoadingMetadataBlocksToRender} + // disabled={submissionStatus === SubmissionStatus.IsSubmitting} + > {t('saveButton')} </Button> <Button withSpacing variant="secondary" type="button" onClick={handleCancel}> diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts index a6cfeac86..0b523ff78 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/Fields/index.ts @@ -6,3 +6,4 @@ export * from './TextBoxField' export * from './TextField' export * from './UrlField' export * from './Vocabulary' +export * from './VocabularyMultiple' diff --git a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx index 6cc4e9cb2..8137d36a8 100644 --- a/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx +++ b/src/sections/create-dataset/MetadataBlockFormFields/MetadataFormField/index.tsx @@ -1,4 +1,5 @@ -import { Col, Form } from '@iqss/dataverse-design-system' +import { ChangeEvent } from 'react' +import { Col, Form, Row } from '@iqss/dataverse-design-system' import { MetadataField2, TypeClassMetadataFieldOptions, @@ -12,17 +13,20 @@ import { TextBoxField, TextField, UrlField, - Vocabulary + Vocabulary, + VocabularyMultiple } from './Fields' import styles from './index.module.scss' interface Props { metadataFieldInfo: MetadataField2 + onChangeField: <T extends HTMLElement>(event: ChangeEvent<T>) => void withinMultipleFieldsGroup?: boolean } export const MetadataFormField = ({ metadataFieldInfo, + onChangeField, withinMultipleFieldsGroup = false }: Props) => { const { @@ -62,6 +66,7 @@ export const MetadataFormField = ({ return ( <MetadataFormField metadataFieldInfo={childMetadataFieldInfo} + onChangeField={onChangeField} withinMultipleFieldsGroup key={childMetadataFieldKey} /> @@ -76,35 +81,24 @@ export const MetadataFormField = ({ if (isSafeControlledVocabulary) { if (multiple) { return ( - <Form.CheckboxGroup + <VocabularyMultiple title={title} - message={description} - required={isRequired} - isInvalid={false}> - <div className={styles['checkbox-list-grid']}> - {controlledVocabularyValues.map((value) => ( - <Form.Group.Checkbox - name={name} - label={value} - id={`${name}-checkbox-${value}`} - value={value} - // onChange={(e) => console.log(e)} - key={value} - /> - ))} - </div> - </Form.CheckboxGroup> + name={name} + description={description} + options={controlledVocabularyValues} + onChange={onChangeField<HTMLInputElement>} + isRequired={isRequired} + isInvalid={false} + disabled={false} + /> ) } return ( - <Form.Group - controlId={name} - required={isRequired} - as={withinMultipleFieldsGroup ? Col : undefined}> + <Form.Group controlId={name} required={isRequired} as={withinMultipleFieldsGroup ? Col : Row}> <Form.Group.Label message={description}>{title}</Form.Group.Label> <Vocabulary name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLSelectElement>} disabled={false} isInvalid={false} options={controlledVocabularyValues} @@ -129,7 +123,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Text && ( <TextField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> @@ -137,7 +131,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Textbox && ( <TextBoxField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLTextAreaElement>} disabled={false} isInvalid={false} /> @@ -145,7 +139,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.URL && ( <UrlField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> @@ -153,7 +147,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Email && ( <EmailField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> @@ -161,7 +155,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Int && ( <IntField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> @@ -169,7 +163,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Float && ( <FloatField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> @@ -177,7 +171,7 @@ export const MetadataFormField = ({ {type === TypeMetadataFieldOptions.Date && ( <DateField name={name} - // onChange={(e) => console.log(e)} + onChange={onChangeField<HTMLInputElement>} disabled={false} isInvalid={false} /> diff --git a/src/sections/create-dataset/MetadataBlocksSkeleton.tsx b/src/sections/create-dataset/MetadataBlocksSkeleton.tsx index 845839380..1af24b440 100644 --- a/src/sections/create-dataset/MetadataBlocksSkeleton.tsx +++ b/src/sections/create-dataset/MetadataBlocksSkeleton.tsx @@ -3,7 +3,7 @@ import Skeleton, { SkeletonTheme } from 'react-loading-skeleton' export const MetadataBlocksSkeleton = () => { return ( - <Accordion defaultActiveKey="0"> + <Accordion defaultActiveKey="0" data-testid="metadata-blocks-skeleton"> <SkeletonTheme> <Accordion.Item eventKey="0"> <Accordion.Header> diff --git a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts b/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts deleted file mode 100644 index 6e5b73637..000000000 --- a/src/sections/create-dataset/mocks/metadataBlocksInfoByCollectionIdResponse.ts +++ /dev/null @@ -1,3433 +0,0 @@ -import { MetadataBlockInfo2 } from '../../../metadata-block-info/domain/models/MetadataBlockInfo' - -export const metadataBlocksInfoByCollectionIdResponse: MetadataBlockInfo2[] = [ - { - id: 1, - name: 'citation', - displayName: 'Citation Metadata', - displayOnCreate: true, - metadataFields: { - title: { - name: 'title', - displayName: 'Title', - title: 'Title', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The main title of the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: true, - displayOnCreate: true, - displayOrder: 0 - }, - subtitle: { - name: 'subtitle', - displayName: 'Subtitle', - title: 'Subtitle', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'A secondary title that amplifies or states certain limitations on the main title', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - displayOnCreate: true, - isRequired: false, - displayOrder: 1 - }, - alternativeTitle: { - name: 'alternativeTitle', - displayName: 'Alternative Title', - title: 'Alternative Title', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Either 1) a title commonly used to refer to the Dataset or 2) an abbreviation of the main title', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 2 - }, - alternativeURL: { - name: 'alternativeURL', - displayName: 'Alternative URL', - title: 'Alternative URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: - 'Another URL where one can view or access the data in the Dataset, e.g. a project or personal webpage', - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - }, - otherId: { - name: 'otherId', - displayName: 'Other Identifier', - title: 'Other Identifier', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - "Another unique identifier for the Dataset (e.g. producer's or another repository's identifier)", - multiple: true, - isControlledVocabulary: false, - displayFormat: ':', - isRequired: false, - displayOrder: 4, - displayOnCreate: true, - childMetadataFields: { - otherIdAgency: { - name: 'otherIdAgency', - displayName: 'Other Identifier Agency', - title: 'Agency', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The name of the agency that generated the other identifier', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 5 - }, - otherIdValue: { - name: 'otherIdValue', - displayName: 'Other Identifier Identifier', - title: 'Identifier', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Another identifier uniquely identifies the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 6 - } - } - }, - author: { - name: 'author', - displayName: 'Author', - title: 'Author', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'The entity, e.g. a person or organization, that created the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: true, - displayOrder: 7, - displayOnCreate: true, - childMetadataFields: { - authorName: { - name: 'authorName', - displayName: 'Author Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) Family Name, Given Name or 2) Organization XYZ', - description: - "The name of the author, such as the person's name or the name of an organization", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: true, - displayOnCreate: true, - displayOrder: 8 - }, - authorAffiliation: { - name: 'authorAffiliation', - displayName: 'Author Affiliation', - title: 'Affiliation', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'Organization XYZ', - description: - "The name of the entity affiliated with the author, e.g. an organization's name", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 9 - }, - authorIdentifierScheme: { - name: 'authorIdentifierScheme', - displayName: 'Author Identifier Type', - title: 'Identifier Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'The type of identifier that uniquely identifies the author (e.g. ORCID, ISNI)', - multiple: false, - isControlledVocabulary: true, - displayFormat: '- #VALUE:', - isRequired: false, - displayOnCreate: true, - displayOrder: 10, - controlledVocabularyValues: [ - 'ORCID', - 'ISNI', - 'LCNA', - 'VIAF', - 'GND', - 'DAI', - 'ResearcherID', - 'ScopusID' - ] - }, - authorIdentifier: { - name: 'authorIdentifier', - displayName: 'Author Identifier', - title: 'Identifier', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Uniquely identifies the author when paired with an identifier type', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 11 - } - } - }, - datasetContact: { - name: 'datasetContact', - displayName: 'Point of Contact', - title: 'Point of Contact', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The entity, e.g. a person or organization, that users of the Dataset can contact with questions', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: true, - displayOrder: 12, - displayOnCreate: true, - childMetadataFields: { - datasetContactName: { - name: 'datasetContactName', - displayName: 'Point of Contact Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) FamilyName, GivenName or 2) Organization', - description: - "The name of the point of contact, e.g. the person's name or the name of an organization", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 13 - }, - datasetContactAffiliation: { - name: 'datasetContactAffiliation', - displayName: 'Point of Contact Affiliation', - title: 'Affiliation', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'Organization XYZ', - description: - "The name of the entity affiliated with the point of contact, e.g. an organization's name", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 14 - }, - datasetContactEmail: { - name: 'datasetContactEmail', - displayName: 'Point of Contact E-mail', - title: 'E-mail', - type: 'EMAIL', - typeClass: 'primitive', - watermark: 'name@email.xyz', - description: "The point of contact's email address", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#EMAIL', - isRequired: true, - displayOnCreate: true, - displayOrder: 15 - } - } - }, - dsDescription: { - name: 'dsDescription', - displayName: 'Description', - title: 'Description', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'A summary describing the purpose, nature, and scope of the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: true, - displayOrder: 16, - displayOnCreate: true, - childMetadataFields: { - dsDescriptionValue: { - name: 'dsDescriptionValue', - displayName: 'Description Text', - title: 'Text', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'A summary describing the purpose, nature, and scope of the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: true, - displayOnCreate: true, - displayOrder: 17 - }, - dsDescriptionDate: { - name: 'dsDescriptionDate', - displayName: 'Description Date', - title: 'Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: - 'The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions', - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 18 - } - } - }, - subject: { - name: 'subject', - displayName: 'Subject', - title: 'Subject', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'The area of study relevant to the Dataset', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: true, - displayOrder: 19, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Agricultural Sciences', - 'Arts and Humanities', - 'Astronomy and Astrophysics', - 'Business and Management', - 'Chemistry', - 'Computer and Information Science', - 'Earth and Environmental Sciences', - 'Engineering', - 'Law', - 'Mathematical Sciences', - 'Medicine, Health and Life Sciences', - 'Physics', - 'Social Sciences', - 'Other' - ] - }, - keyword: { - name: 'keyword', - displayName: 'Keyword', - title: 'Keyword', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 20, - displayOnCreate: true, - childMetadataFields: { - keywordValue: { - name: 'keywordValue', - displayName: 'Keyword Term', - title: 'Term', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'A key term that describes important aspects of the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 21 - }, - keywordVocabulary: { - name: 'keywordVocabulary', - displayName: 'Keyword Controlled Vocabulary Name', - title: 'Controlled Vocabulary Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 22 - }, - keywordVocabularyURI: { - name: 'keywordVocabularyURI', - displayName: 'Keyword Controlled Vocabulary URL', - title: 'Controlled Vocabulary URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: - "The URL where one can access information about the term's controlled vocabulary", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 23 - } - } - }, - topicClassification: { - name: 'topicClassification', - displayName: 'Topic Classification', - title: 'Topic Classification', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 24, - displayOnCreate: true, - childMetadataFields: { - topicClassValue: { - name: 'topicClassValue', - displayName: 'Topic Classification Term', - title: 'Term', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'A topic or subject term', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 25 - }, - topicClassVocab: { - name: 'topicClassVocab', - displayName: 'Topic Classification Controlled Vocabulary Name', - title: 'Controlled Vocabulary Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 26 - }, - topicClassVocabURI: { - name: 'topicClassVocabURI', - displayName: 'Topic Classification Controlled Vocabulary URL', - title: 'Controlled Vocabulary URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: - "The URL where one can access information about the term's controlled vocabulary", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 27 - } - } - }, - publication: { - name: 'publication', - displayName: 'Related Publication', - title: 'Related Publication', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The article or report that uses the data in the Dataset. The full list of related publications will be displayed on the metadata tab', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 28, - displayOnCreate: true, - childMetadataFields: { - publicationCitation: { - name: 'publicationCitation', - displayName: 'Related Publication Citation', - title: 'Citation', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'The full bibliographic citation for the related publication', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 29 - }, - publicationIDType: { - name: 'publicationIDType', - displayName: 'Related Publication Identifier Type', - title: 'Identifier Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'The type of identifier that uniquely identifies a related publication', - multiple: false, - isControlledVocabulary: true, - displayFormat: '#VALUE: ', - isRequired: false, - displayOrder: 30, - displayOnCreate: true, - controlledVocabularyValues: [ - 'ark', - 'arXiv', - 'bibcode', - 'cstr', - 'doi', - 'ean13', - 'eissn', - 'handle', - 'isbn', - 'issn', - 'istc', - 'lissn', - 'lsid', - 'pmid', - 'purl', - 'upc', - 'url', - 'urn', - 'DASH-NRS' - ] - }, - publicationIDNumber: { - name: 'publicationIDNumber', - displayName: 'Related Publication Identifier', - title: 'Identifier', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The identifier for a related publication', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 31 - }, - publicationURL: { - name: 'publicationURL', - displayName: 'Related Publication URL', - title: 'URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: - 'The URL form of the identifier entered in the Identifier field, e.g. the DOI URL if a DOI was entered in the Identifier field. Used to display what was entered in the ID Type and ID Number fields as a link. If what was entered in the Identifier field has no URL form, the URL of the publication webpage is used, e.g. a journal article webpage', - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 32 - } - } - }, - notesText: { - name: 'notesText', - displayName: 'Notes', - title: 'Notes', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'Additional information about the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 33, - displayOnCreate: true - }, - language: { - name: 'language', - displayName: 'Language', - title: 'Language', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: "A language that the Dataset's files is written in", - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 34, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Abkhaz', - 'Afar', - 'Afrikaans', - 'Akan', - 'Albanian', - 'Amharic', - 'Arabic', - 'Aragonese', - 'Armenian', - 'Assamese', - 'Avaric', - 'Avestan', - 'Aymara', - 'Azerbaijani', - 'Bambara', - 'Bashkir', - 'Basque', - 'Belarusian', - 'Bengali, Bangla', - 'Bihari', - 'Bislama', - 'Bosnian', - 'Breton', - 'Bulgarian', - 'Burmese', - 'Catalan,Valencian', - 'Chamorro', - 'Chechen', - 'Chichewa, Chewa, Nyanja', - 'Chinese', - 'Chuvash', - 'Cornish', - 'Corsican', - 'Cree', - 'Croatian', - 'Czech', - 'Danish', - 'Divehi, Dhivehi, Maldivian', - 'Dutch', - 'Dzongkha', - 'English', - 'Esperanto', - 'Estonian', - 'Ewe', - 'Faroese', - 'Fijian', - 'Finnish', - 'French', - 'Fula, Fulah, Pulaar, Pular', - 'Galician', - 'Georgian', - 'German', - 'Greek (modern)', - 'Guaraní', - 'Gujarati', - 'Haitian, Haitian Creole', - 'Hausa', - 'Hebrew (modern)', - 'Herero', - 'Hindi', - 'Hiri Motu', - 'Hungarian', - 'Interlingua', - 'Indonesian', - 'Interlingue', - 'Irish', - 'Igbo', - 'Inupiaq', - 'Ido', - 'Icelandic', - 'Italian', - 'Inuktitut', - 'Japanese', - 'Javanese', - 'Kalaallisut, Greenlandic', - 'Kannada', - 'Kanuri', - 'Kashmiri', - 'Kazakh', - 'Khmer', - 'Kikuyu, Gikuyu', - 'Kinyarwanda', - 'Kyrgyz', - 'Komi', - 'Kongo', - 'Korean', - 'Kurdish', - 'Kwanyama, Kuanyama', - 'Latin', - 'Luxembourgish, Letzeburgesch', - 'Ganda', - 'Limburgish, Limburgan, Limburger', - 'Lingala', - 'Lao', - 'Lithuanian', - 'Luba-Katanga', - 'Latvian', - 'Manx', - 'Macedonian', - 'Malagasy', - 'Malay', - 'Malayalam', - 'Maltese', - 'Māori', - 'Marathi (Marāṭhī)', - 'Marshallese', - 'Mixtepec Mixtec', - 'Mongolian', - 'Nauru', - 'Navajo, Navaho', - 'Northern Ndebele', - 'Nepali', - 'Ndonga', - 'Norwegian Bokmål', - 'Norwegian Nynorsk', - 'Norwegian', - 'Nuosu', - 'Southern Ndebele', - 'Occitan', - 'Ojibwe, Ojibwa', - 'Old Church Slavonic,Church Slavonic,Old Bulgarian', - 'Oromo', - 'Oriya', - 'Ossetian, Ossetic', - 'Panjabi, Punjabi', - 'Pāli', - 'Persian (Farsi)', - 'Polish', - 'Pashto, Pushto', - 'Portuguese', - 'Quechua', - 'Romansh', - 'Kirundi', - 'Romanian', - 'Russian', - 'Sanskrit (Saṁskṛta)', - 'Sardinian', - 'Sindhi', - 'Northern Sami', - 'Samoan', - 'Sango', - 'Serbian', - 'Scottish Gaelic, Gaelic', - 'Shona', - 'Sinhala, Sinhalese', - 'Slovak', - 'Slovene', - 'Somali', - 'Southern Sotho', - 'Spanish, Castilian', - 'Sundanese', - 'Swahili', - 'Swati', - 'Swedish', - 'Tamil', - 'Telugu', - 'Tajik', - 'Thai', - 'Tigrinya', - 'Tibetan Standard, Tibetan, Central', - 'Turkmen', - 'Tagalog', - 'Tswana', - 'Tonga (Tonga Islands)', - 'Turkish', - 'Tsonga', - 'Tatar', - 'Twi', - 'Tahitian', - 'Uyghur, Uighur', - 'Ukrainian', - 'Urdu', - 'Uzbek', - 'Venda', - 'Vietnamese', - 'Volapük', - 'Walloon', - 'Welsh', - 'Wolof', - 'Western Frisian', - 'Xhosa', - 'Yiddish', - 'Yoruba', - 'Zhuang, Chuang', - 'Zulu', - 'Not applicable' - ] - }, - producer: { - name: 'producer', - displayName: 'Producer', - title: 'Producer', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The entity, such a person or organization, managing the finances or other administrative processes involved in the creation of the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 35, - displayOnCreate: true, - childMetadataFields: { - producerName: { - name: 'producerName', - displayName: 'Producer Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) FamilyName, GivenName or 2) Organization', - description: - "The name of the entity, e.g. the person's name or the name of an organization", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: true, - displayOnCreate: true, - displayOrder: 36 - }, - producerAffiliation: { - name: 'producerAffiliation', - displayName: 'Producer Affiliation', - title: 'Affiliation', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'Organization XYZ', - description: - "The name of the entity affiliated with the producer, e.g. an organization's name", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 37 - }, - producerAbbreviation: { - name: 'producerAbbreviation', - displayName: 'Producer Abbreviated Name', - title: 'Abbreviated Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: "The producer's abbreviated name (e.g. IQSS, ICPSR)", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 38 - }, - producerURL: { - name: 'producerURL', - displayName: 'Producer URL', - title: 'URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: "The URL of the producer's website", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 39 - }, - producerLogoURL: { - name: 'producerLogoURL', - displayName: 'Producer Logo URL', - title: 'Logo URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: "The URL of the producer's logo", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<img src="#VALUE" alt="#NAME" class="metadata-logo"/><br/>', - isRequired: false, - displayOnCreate: true, - displayOrder: 40 - } - } - }, - productionDate: { - name: 'productionDate', - displayName: 'Production Date', - title: 'Production Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: - 'The date when the data were produced (not distributed, published, or archived)', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 41 - }, - productionPlace: { - name: 'productionPlace', - displayName: 'Production Location', - title: 'Production Location', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The location where the data and any related materials were produced or collected', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 42 - }, - contributor: { - name: 'contributor', - displayName: 'Contributor', - title: 'Contributor', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: ':', - isRequired: false, - displayOrder: 43, - displayOnCreate: true, - childMetadataFields: { - contributorType: { - name: 'contributorType', - displayName: 'Contributor Type', - title: 'Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'Indicates the type of contribution made to the dataset', - multiple: false, - isControlledVocabulary: true, - displayFormat: '#VALUE ', - isRequired: false, - displayOrder: 44, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Data Collector', - 'Data Curator', - 'Data Manager', - 'Editor', - 'Funder', - 'Hosting Institution', - 'Project Leader', - 'Project Manager', - 'Project Member', - 'Related Person', - 'Researcher', - 'Research Group', - 'Rights Holder', - 'Sponsor', - 'Supervisor', - 'Work Package Leader', - 'Other' - ] - }, - contributorName: { - name: 'contributorName', - displayName: 'Contributor Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) FamilyName, GivenName or 2) Organization', - description: - "The name of the contributor, e.g. the person's name or the name of an organization", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 45 - } - } - }, - grantNumber: { - name: 'grantNumber', - displayName: 'Funding Information', - title: 'Funding Information', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: "Information about the Dataset's financial support", - multiple: true, - isControlledVocabulary: false, - displayFormat: ':', - isRequired: false, - displayOrder: 46, - displayOnCreate: true, - childMetadataFields: { - grantNumberAgency: { - name: 'grantNumberAgency', - displayName: 'Funding Information Agency', - title: 'Agency', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'Organization XYZ', - description: 'The agency that provided financial support for the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 47 - }, - grantNumberValue: { - name: 'grantNumberValue', - displayName: 'Funding Information Identifier', - title: 'Identifier', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The grant identifier or contract identifier of the agency that provided financial support for the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 48 - } - } - }, - distributor: { - name: 'distributor', - displayName: 'Distributor', - title: 'Distributor', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The entity, such as a person or organization, designated to generate copies of the Dataset, including any editions or revisions', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 49, - displayOnCreate: true, - childMetadataFields: { - distributorName: { - name: 'distributorName', - displayName: 'Distributor Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) FamilyName, GivenName or 2) Organization', - description: - "The name of the entity, e.g. the person's name or the name of an organization", - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 50 - }, - distributorAffiliation: { - name: 'distributorAffiliation', - displayName: 'Distributor Affiliation', - title: 'Affiliation', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'Organization XYZ', - description: - "The name of the entity affiliated with the distributor, e.g. an organization's name", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 51 - }, - distributorAbbreviation: { - name: 'distributorAbbreviation', - displayName: 'Distributor Abbreviated Name', - title: 'Abbreviated Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: "The distributor's abbreviated name (e.g. IQSS, ICPSR)", - multiple: false, - isControlledVocabulary: false, - displayFormat: '(#VALUE)', - isRequired: false, - displayOnCreate: true, - displayOrder: 52 - }, - distributorURL: { - name: 'distributorURL', - displayName: 'Distributor URL', - title: 'URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: "The URL of the distributor's webpage", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', - isRequired: false, - displayOnCreate: true, - displayOrder: 53 - }, - distributorLogoURL: { - name: 'distributorLogoURL', - displayName: 'Distributor Logo URL', - title: 'Logo URL', - type: 'URL', - typeClass: 'primitive', - watermark: 'https://', - description: - "The URL of the distributor's logo image, used to show the image on the Dataset's page", - multiple: false, - isControlledVocabulary: false, - displayFormat: '<img src="#VALUE" alt="#NAME" class="metadata-logo"/><br/>', - isRequired: false, - displayOnCreate: true, - displayOrder: 54 - } - } - }, - distributionDate: { - name: 'distributionDate', - displayName: 'Distribution Date', - title: 'Distribution Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The date when the Dataset was made available for distribution/presentation', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 55, - displayOnCreate: false - }, - depositor: { - name: 'depositor', - displayName: 'Depositor', - title: 'Depositor', - type: 'TEXT', - typeClass: 'primitive', - watermark: '1) FamilyName, GivenName or 2) Organization', - description: - 'The entity, such as a person or organization, that deposited the Dataset in the repository', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 56, - displayOnCreate: false - }, - dateOfDeposit: { - name: 'dateOfDeposit', - displayName: 'Deposit Date', - title: 'Deposit Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The date when the Dataset was deposited into the repository', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 57, - displayOnCreate: false - }, - timePeriodCovered: { - name: 'timePeriodCovered', - displayName: 'Time Period', - title: 'Time Period', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'The time period that the data refer to. Also known as span. This is the time period covered by the data, not the dates of coding, collecting data, or making documents machine-readable', - multiple: true, - isControlledVocabulary: false, - displayFormat: ';', - isRequired: false, - displayOrder: 58, - displayOnCreate: true, - childMetadataFields: { - timePeriodCoveredStart: { - name: 'timePeriodCoveredStart', - displayName: 'Time Period Start Date', - title: 'Start Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The start date of the time period that the data refer to', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#NAME: #VALUE ', - isRequired: false, - displayOnCreate: true, - displayOrder: 59 - }, - timePeriodCoveredEnd: { - name: 'timePeriodCoveredEnd', - displayName: 'Time Period End Date', - title: 'End Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The end date of the time period that the data refer to', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#NAME: #VALUE ', - isRequired: false, - displayOnCreate: true, - displayOrder: 60 - } - } - }, - dateOfCollection: { - name: 'dateOfCollection', - displayName: 'Date of Collection', - title: 'Date of Collection', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'The dates when the data were collected or generated', - multiple: true, - isControlledVocabulary: false, - displayFormat: ';', - isRequired: false, - displayOrder: 61, - displayOnCreate: true, - childMetadataFields: { - dateOfCollectionStart: { - name: 'dateOfCollectionStart', - displayName: 'Date of Collection Start Date', - title: 'Start Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The date when the data collection started', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#NAME: #VALUE ', - isRequired: false, - displayOnCreate: true, - displayOrder: 62 - }, - dateOfCollectionEnd: { - name: 'dateOfCollectionEnd', - displayName: 'Date of Collection End Date', - title: 'End Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'The date when the data collection ended', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#NAME: #VALUE ', - isRequired: false, - displayOnCreate: true, - displayOrder: 63 - } - } - }, - kindOfData: { - name: 'kindOfData', - displayName: 'Data Type', - title: 'Data Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The type of data included in the files (e.g. survey data, clinical data, or machine-readable text)', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 64, - displayOnCreate: false - }, - series: { - name: 'series', - displayName: 'Series', - title: 'Series', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'Information about the dataset series to which the Dataset belong', - multiple: true, - isControlledVocabulary: false, - displayFormat: ':', - isRequired: false, - displayOrder: 65, - displayOnCreate: true, - childMetadataFields: { - seriesName: { - name: 'seriesName', - displayName: 'Series Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The name of the dataset series', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 66 - }, - seriesInformation: { - name: 'seriesInformation', - displayName: 'Series Information', - title: 'Information', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Can include 1) a history of the series and 2) a summary of features that apply to the series', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 67 - } - } - }, - software: { - name: 'software', - displayName: 'Software', - title: 'Software', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'Information about the software used to generate the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: ',', - isRequired: false, - displayOrder: 68, - displayOnCreate: true, - childMetadataFields: { - softwareName: { - name: 'softwareName', - displayName: 'Software Name', - title: 'Name', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The name of software used to generate the Dataset', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 69 - }, - softwareVersion: { - name: 'softwareVersion', - displayName: 'Software Version', - title: 'Version', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The version of the software used to generate the Dataset, e.g. 4.11', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#NAME: #VALUE', - isRequired: false, - displayOnCreate: true, - displayOrder: 70 - } - } - }, - relatedMaterial: { - name: 'relatedMaterial', - displayName: 'Related Material', - title: 'Related Material', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Information, such as a persistent ID or citation, about the material related to the Dataset, such as appendices or sampling information available outside of the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 71, - displayOnCreate: false - }, - relatedDatasets: { - name: 'relatedDatasets', - displayName: 'Related Dataset', - title: 'Related Dataset', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - "Information, such as a persistent ID or citation, about a related dataset, such as previous research on the Dataset's subject", - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 72, - displayOnCreate: false - }, - otherReferences: { - name: 'otherReferences', - displayName: 'Other Reference', - title: 'Other Reference', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Information, such as a persistent ID or citation, about another type of resource that provides background or supporting material to the Dataset', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 73, - displayOnCreate: false - }, - dataSources: { - name: 'dataSources', - displayName: 'Data Source', - title: 'Data Source', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Information, such as a persistent ID or citation, about sources of the Dataset (e.g. a book, article, serial, or machine-readable data file)', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 74, - displayOnCreate: false - }, - originOfSources: { - name: 'originOfSources', - displayName: 'Origin of Historical Sources', - title: 'Origin of Historical Sources', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'For historical sources, the origin and any rules followed in establishing them as sources', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 75, - displayOnCreate: false - }, - characteristicOfSources: { - name: 'characteristicOfSources', - displayName: 'Characteristic of Sources', - title: 'Characteristic of Sources', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'Characteristics not already noted elsewhere', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 76, - displayOnCreate: false - }, - accessToSources: { - name: 'accessToSources', - displayName: 'Documentation and Access to Sources', - title: 'Documentation and Access to Sources', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - '1) Methods or procedures for accessing data sources and 2) any special permissions needed for access', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 77, - displayOnCreate: false - } - } - }, - { - id: 2, - name: 'geospatial', - displayName: 'Geospatial Metadata', - displayOnCreate: false, - metadataFields: { - geographicCoverage: { - name: 'geographicCoverage', - displayName: 'Geographic Coverage', - title: 'Geographic Coverage', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'Information on the geographic coverage of the data. Includes the total geographic scope of the data.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 0, - displayOnCreate: true, - childMetadataFields: { - country: { - name: 'country', - displayName: 'Geographic Coverage Country / Nation', - title: 'Country / Nation', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'The country or nation that the Dataset is about.', - multiple: false, - isControlledVocabulary: true, - displayFormat: '#VALUE, ', - isRequired: false, - displayOrder: 1, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Afghanistan', - 'Albania', - 'Algeria', - 'American Samoa', - 'Andorra', - 'Angola', - 'Anguilla', - 'Antarctica', - 'Antigua and Barbuda', - 'Argentina', - 'Armenia', - 'Aruba', - 'Australia', - 'Austria', - 'Azerbaijan', - 'Bahamas', - 'Bahrain', - 'Bangladesh', - 'Barbados', - 'Belarus', - 'Belgium', - 'Belize', - 'Benin', - 'Bermuda', - 'Bhutan', - 'Bolivia, Plurinational State of', - 'Bonaire, Sint Eustatius and Saba', - 'Bosnia and Herzegovina', - 'Botswana', - 'Bouvet Island', - 'Brazil', - 'British Indian Ocean Territory', - 'Brunei Darussalam', - 'Bulgaria', - 'Burkina Faso', - 'Burundi', - 'Cambodia', - 'Cameroon', - 'Canada', - 'Cape Verde', - 'Cayman Islands', - 'Central African Republic', - 'Chad', - 'Chile', - 'China', - 'Christmas Island', - 'Cocos (Keeling) Islands', - 'Colombia', - 'Comoros', - 'Congo', - 'Congo, the Democratic Republic of the', - 'Cook Islands', - 'Costa Rica', - 'Croatia', - 'Cuba', - 'Curaçao', - 'Cyprus', - 'Czech Republic', - "Côte d'Ivoire", - 'Denmark', - 'Djibouti', - 'Dominica', - 'Dominican Republic', - 'Ecuador', - 'Egypt', - 'El Salvador', - 'Equatorial Guinea', - 'Eritrea', - 'Estonia', - 'Ethiopia', - 'Falkland Islands (Malvinas)', - 'Faroe Islands', - 'Fiji', - 'Finland', - 'France', - 'French Guiana', - 'French Polynesia', - 'French Southern Territories', - 'Gabon', - 'Gambia', - 'Georgia', - 'Germany', - 'Ghana', - 'Gibraltar', - 'Greece', - 'Greenland', - 'Grenada', - 'Guadeloupe', - 'Guam', - 'Guatemala', - 'Guernsey', - 'Guinea', - 'Guinea-Bissau', - 'Guyana', - 'Haiti', - 'Heard Island and Mcdonald Islands', - 'Holy See (Vatican City State)', - 'Honduras', - 'Hong Kong', - 'Hungary', - 'Iceland', - 'India', - 'Indonesia', - 'Iran, Islamic Republic of', - 'Iraq', - 'Ireland', - 'Isle of Man', - 'Israel', - 'Italy', - 'Jamaica', - 'Japan', - 'Jersey', - 'Jordan', - 'Kazakhstan', - 'Kenya', - 'Kiribati', - "Korea, Democratic People's Republic of", - 'Korea, Republic of', - 'Kuwait', - 'Kyrgyzstan', - "Lao People's Democratic Republic", - 'Latvia', - 'Lebanon', - 'Lesotho', - 'Liberia', - 'Libya', - 'Liechtenstein', - 'Lithuania', - 'Luxembourg', - 'Macao', - 'Macedonia, the Former Yugoslav Republic of', - 'Madagascar', - 'Malawi', - 'Malaysia', - 'Maldives', - 'Mali', - 'Malta', - 'Marshall Islands', - 'Martinique', - 'Mauritania', - 'Mauritius', - 'Mayotte', - 'Mexico', - 'Micronesia, Federated States of', - 'Moldova, Republic of', - 'Monaco', - 'Mongolia', - 'Montenegro', - 'Montserrat', - 'Morocco', - 'Mozambique', - 'Myanmar', - 'Namibia', - 'Nauru', - 'Nepal', - 'Netherlands', - 'New Caledonia', - 'New Zealand', - 'Nicaragua', - 'Niger', - 'Nigeria', - 'Niue', - 'Norfolk Island', - 'Northern Mariana Islands', - 'Norway', - 'Oman', - 'Pakistan', - 'Palau', - 'Palestine, State of', - 'Panama', - 'Papua New Guinea', - 'Paraguay', - 'Peru', - 'Philippines', - 'Pitcairn', - 'Poland', - 'Portugal', - 'Puerto Rico', - 'Qatar', - 'Romania', - 'Russian Federation', - 'Rwanda', - 'Réunion', - 'Saint Barthélemy', - 'Saint Helena, Ascension and Tristan da Cunha', - 'Saint Kitts and Nevis', - 'Saint Lucia', - 'Saint Martin (French part)', - 'Saint Pierre and Miquelon', - 'Saint Vincent and the Grenadines', - 'Samoa', - 'San Marino', - 'Sao Tome and Principe', - 'Saudi Arabia', - 'Senegal', - 'Serbia', - 'Seychelles', - 'Sierra Leone', - 'Singapore', - 'Sint Maarten (Dutch part)', - 'Slovakia', - 'Slovenia', - 'Solomon Islands', - 'Somalia', - 'South Africa', - 'South Georgia and the South Sandwich Islands', - 'South Sudan', - 'Spain', - 'Sri Lanka', - 'Sudan', - 'Suriname', - 'Svalbard and Jan Mayen', - 'Swaziland', - 'Sweden', - 'Switzerland', - 'Syrian Arab Republic', - 'Taiwan, Province of China', - 'Tajikistan', - 'Tanzania, United Republic of', - 'Thailand', - 'Timor-Leste', - 'Togo', - 'Tokelau', - 'Tonga', - 'Trinidad and Tobago', - 'Tunisia', - 'Turkey', - 'Turkmenistan', - 'Turks and Caicos Islands', - 'Tuvalu', - 'Uganda', - 'Ukraine', - 'United Arab Emirates', - 'United Kingdom', - 'United States', - 'United States Minor Outlying Islands', - 'Uruguay', - 'Uzbekistan', - 'Vanuatu', - 'Venezuela, Bolivarian Republic of', - 'Viet Nam', - 'Virgin Islands, British', - 'Virgin Islands, U.S.', - 'Wallis and Futuna', - 'Western Sahara', - 'Yemen', - 'Zambia', - 'Zimbabwe', - 'Åland Islands' - ] - }, - state: { - name: 'state', - displayName: 'Geographic Coverage State / Province', - title: 'State / Province', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOnCreate: true, - displayOrder: 2 - }, - city: { - name: 'city', - displayName: 'Geographic Coverage City', - title: 'City', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - }, - otherGeographicCoverage: { - name: 'otherGeographicCoverage', - displayName: 'Geographic Coverage Other', - title: 'Other', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Other information on the geographic coverage of the data.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '#VALUE, ', - isRequired: false, - displayOnCreate: true, - displayOrder: 4 - } - } - }, - geographicUnit: { - name: 'geographicUnit', - displayName: 'Geographic Unit', - title: 'Geographic Unit', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Lowest level of geographic aggregation covered by the Dataset, e.g., village, county, region.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 5 - }, - geographicBoundingBox: { - name: 'geographicBoundingBox', - displayName: 'Geographic Bounding Box', - title: 'Geographic Bounding Box', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - "The fundamental geometric description for any Dataset that models geography is the geographic bounding box. It describes the minimum box, defined by west and east longitudes and north and south latitudes, which includes the largest geographic extent of the Dataset's geographic coverage. This element is used in the first pass of a coordinate-based search. Inclusion of this element in the codebook is recommended, but is required if the bound polygon box is included. ", - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 6, - childMetadataFields: { - westLongitude: { - name: 'westLongitude', - displayName: 'Geographic Bounding Box Westernmost (Left) Longitude', - title: 'Westernmost (Left) Longitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 7 - }, - eastLongitude: { - name: 'eastLongitude', - displayName: 'Geographic Bounding Box Easternmost (Right) Longitude', - title: 'Easternmost (Right) Longitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 8 - }, - northLatitude: { - name: 'northLatitude', - displayName: 'Geographic Bounding Box Northernmost (Top) Latitude', - title: 'Northernmost (Top) Latitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 9 - }, - southLatitude: { - name: 'southLatitude', - displayName: 'Geographic Bounding Box Southernmost (Bottom) Latitude', - title: 'Southernmost (Bottom) Latitude', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 10 - } - } - } - } - }, - { - id: 4, - name: 'astrophysics', - displayName: 'Astronomy and Astrophysics Metadata', - displayOnCreate: false, - metadataFields: { - astroType: { - name: 'astroType', - displayName: 'Type', - title: 'Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'The nature or genre of the content of the files in the dataset.', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 0, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Image', - 'Mosaic', - 'EventList', - 'Spectrum', - 'Cube', - 'Table', - 'Catalog', - 'LightCurve', - 'Simulation', - 'Figure', - 'Artwork', - 'Animation', - 'PrettyPicture', - 'Documentation', - 'Other', - 'Library', - 'Press Release', - 'Facsimile', - 'Historical', - 'Observation', - 'Object', - 'Value', - 'ValuePair', - 'Survey' - ] - }, - astroFacility: { - name: 'astroFacility', - displayName: 'Facility', - title: 'Facility', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The observatory or facility where the data was obtained. ', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 1 - }, - astroInstrument: { - name: 'astroInstrument', - displayName: 'Instrument', - title: 'Instrument', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The instrument used to collect the data.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 2 - }, - astroObject: { - name: 'astroObject', - displayName: 'Object', - title: 'Object', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Astronomical Objects represented in the data (Given as SIMBAD recognizable names preferred).', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - }, - 'resolution.Spatial': { - name: 'resolution.Spatial', - displayName: 'Spatial Resolution', - title: 'Spatial Resolution', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The spatial (angular) resolution that is typical of the observations, in decimal degrees.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 4 - }, - 'resolution.Spectral': { - name: 'resolution.Spectral', - displayName: 'Spectral Resolution', - title: 'Spectral Resolution', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The spectral resolution that is typical of the observations, given as the ratio \\u03bb/\\u0394\\u03bb.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 5 - }, - 'resolution.Temporal': { - name: 'resolution.Temporal', - displayName: 'Time Resolution', - title: 'Time Resolution', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The temporal resolution that is typical of the observations, given in seconds.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 6 - }, - 'coverage.Spectral.Bandpass': { - name: 'coverage.Spectral.Bandpass', - displayName: 'Bandpass', - title: 'Bandpass', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Conventional bandpass name', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 7 - }, - 'coverage.Spectral.CentralWavelength': { - name: 'coverage.Spectral.CentralWavelength', - displayName: 'Central Wavelength (m)', - title: 'Central Wavelength (m)', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The central wavelength of the spectral bandpass, in meters.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 8 - }, - 'coverage.Spectral.Wavelength': { - name: 'coverage.Spectral.Wavelength', - displayName: 'Wavelength Range', - title: 'Wavelength Range', - type: 'NONE', - typeClass: 'compound', - watermark: 'Enter a floating-point number.', - description: 'The minimum and maximum wavelength of the spectral bandpass.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 9, - childMetadataFields: { - 'coverage.Spectral.MinimumWavelength': { - name: 'coverage.Spectral.MinimumWavelength', - displayName: 'Wavelength Range Minimum (m)', - title: 'Minimum (m)', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The minimum wavelength of the spectral bandpass, in meters.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 10 - }, - 'coverage.Spectral.MaximumWavelength': { - name: 'coverage.Spectral.MaximumWavelength', - displayName: 'Wavelength Range Maximum (m)', - title: 'Maximum (m)', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The maximum wavelength of the spectral bandpass, in meters.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 11 - } - } - }, - 'coverage.Temporal': { - name: 'coverage.Temporal', - displayName: 'Dataset Date Range', - title: 'Dataset Date Range', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: ' Time period covered by the data.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 12, - childMetadataFields: { - 'coverage.Temporal.StartTime': { - name: 'coverage.Temporal.StartTime', - displayName: 'Dataset Date Range Start', - title: 'Start', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'Dataset Start Date', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 13 - }, - 'coverage.Temporal.StopTime': { - name: 'coverage.Temporal.StopTime', - displayName: 'Dataset Date Range End', - title: 'End', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY-MM-DD', - description: 'Dataset End Date', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 14 - } - } - }, - 'coverage.Spatial': { - name: 'coverage.Spatial', - displayName: 'Sky Coverage', - title: 'Sky Coverage', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The sky coverage of the data object.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 15 - }, - 'coverage.Depth': { - name: 'coverage.Depth', - displayName: 'Depth Coverage', - title: 'Depth Coverage', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: 'The (typical) depth coverage, or sensitivity, of the data object in Jy.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 16 - }, - 'coverage.ObjectDensity': { - name: 'coverage.ObjectDensity', - displayName: 'Object Density', - title: 'Object Density', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The (typical) density of objects, catalog entries, telescope pointings, etc., on the sky, in number per square degree.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 17 - }, - 'coverage.ObjectCount': { - name: 'coverage.ObjectCount', - displayName: 'Object Count', - title: 'Object Count', - type: 'INT', - typeClass: 'primitive', - watermark: 'Enter an integer.', - description: 'The total number of objects, catalog entries, etc., in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 18 - }, - 'coverage.SkyFraction': { - name: 'coverage.SkyFraction', - displayName: 'Fraction of Sky', - title: 'Fraction of Sky', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The fraction of the sky represented in the observations, ranging from 0 to 1.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 19 - }, - 'coverage.Polarization': { - name: 'coverage.Polarization', - displayName: 'Polarization', - title: 'Polarization', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The polarization coverage', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 20 - }, - redshiftType: { - name: 'redshiftType', - displayName: 'RedshiftType', - title: 'RedshiftType', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'RedshiftType string C "Redshift"; or "Optical" or "Radio" definitions of Doppler velocity used in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 21 - }, - 'resolution.Redshift': { - name: 'resolution.Redshift', - displayName: 'Redshift Resolution', - title: 'Redshift Resolution', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The resolution in redshift (unitless) or Doppler velocity (km/s) in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 22 - }, - 'coverage.RedshiftValue': { - name: 'coverage.RedshiftValue', - displayName: 'Redshift Value', - title: 'Redshift Value', - type: 'FLOAT', - typeClass: 'compound', - watermark: 'Enter a floating-point number.', - description: - 'The value of the redshift (unitless) or Doppler velocity (km/s in the data object.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 23, - childMetadataFields: { - 'coverage.Redshift.MinimumValue': { - name: 'coverage.Redshift.MinimumValue', - displayName: 'Redshift Value Minimum', - title: 'Minimum', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The minimum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 24 - }, - 'coverage.Redshift.MaximumValue': { - name: 'coverage.Redshift.MaximumValue', - displayName: 'Redshift Value Maximum', - title: 'Maximum', - type: 'FLOAT', - typeClass: 'primitive', - watermark: 'Enter a floating-point number.', - description: - 'The maximum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 25 - } - } - } - } - }, - { - id: 5, - name: 'biomedical', - displayName: 'Life Sciences Metadata', - displayOnCreate: false, - metadataFields: { - studyDesignType: { - name: 'studyDesignType', - displayName: 'Design Type', - title: 'Design Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'Design types that are based on the overall experimental design.', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 0, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Case Control', - 'Cross Sectional', - 'Cohort Study', - 'Nested Case Control Design', - 'Not Specified', - 'Parallel Group Design', - 'Perturbation Design', - 'Randomized Controlled Trial', - 'Technological Design', - 'Other' - ] - }, - studyOtherDesignType: { - name: 'studyOtherDesignType', - displayName: 'Other Design Type', - title: 'Other Design Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Design Type, list any other design types that were used in this Dataset.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 1 - }, - studyFactorType: { - name: 'studyFactorType', - displayName: 'Factor Type', - title: 'Factor Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: 'Factors used in the Dataset.', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 2, - controlledVocabularyValues: [ - 'Age', - 'Biomarkers', - 'Cell Surface Markers', - 'Cell Type/Cell Line', - 'Developmental Stage', - 'Disease State', - 'Drug Susceptibility', - 'Extract Molecule', - 'Genetic Characteristics', - 'Immunoprecipitation Antibody', - 'Organism', - 'Passages', - 'Platform', - 'Sex', - 'Strain', - 'Time Point', - 'Tissue Type', - 'Treatment Compound', - 'Treatment Type', - 'Other' - ] - }, - studyOtherFactorType: { - name: 'studyOtherFactorType', - displayName: 'Other Factor Type', - title: 'Other Factor Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Factor Type, list any other factor types that were used in this Dataset.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - }, - studyAssayOrganism: { - name: 'studyAssayOrganism', - displayName: 'Organism', - title: 'Organism', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'The taxonomic name of the organism used in the Dataset or from which the starting biological material derives.', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 4, - displayOnCreate: true, - controlledVocabularyValues: [ - 'Arabidopsis thaliana', - 'Bos taurus', - 'Caenorhabditis elegans', - 'Chlamydomonas reinhardtii', - 'Danio rerio (zebrafish)', - 'Dictyostelium discoideum', - 'Drosophila melanogaster', - 'Escherichia coli', - 'Hepatitis C virus', - 'Homo sapiens', - 'Mus musculus', - 'Mycobacterium africanum', - 'Mycobacterium canetti', - 'Mycobacterium tuberculosis', - 'Mycoplasma pneumoniae', - 'Oryza sativa', - 'Plasmodium falciparum', - 'Pneumocystis carinii', - 'Rattus norvegicus', - "Saccharomyces cerevisiae (brewer's yeast)", - 'Schizosaccharomyces pombe', - 'Takifugu rubripes', - 'Xenopus laevis', - 'Zea mays', - 'Other' - ] - }, - studyAssayOtherOrganism: { - name: 'studyAssayOtherOrganism', - displayName: 'Other Organism', - title: 'Other Organism', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Organism, list any other organisms that were used in this Dataset. Terms from the NCBI Taxonomy are recommended.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 5 - }, - studyAssayMeasurementType: { - name: 'studyAssayMeasurementType', - displayName: 'Measurement Type', - title: 'Measurement Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'A term to qualify the endpoint, or what is being measured (e.g. gene expression profiling; protein identification).', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 6, - displayOnCreate: true, - controlledVocabularyValues: [ - 'cell sorting', - 'clinical chemistry analysis', - 'copy number variation profiling', - 'DNA methylation profiling', - 'DNA methylation profiling (Bisulfite-Seq)', - 'DNA methylation profiling (MeDIP-Seq)', - 'drug susceptibility', - 'environmental gene survey', - 'genome sequencing', - 'hematology', - 'histology', - 'Histone Modification (ChIP-Seq)', - 'loss of heterozygosity profiling', - 'metabolite profiling', - 'metagenome sequencing', - 'protein expression profiling', - 'protein identification', - 'protein-DNA binding site identification', - 'protein-protein interaction detection', - 'protein-RNA binding (RIP-Seq)', - 'SNP analysis', - 'targeted sequencing', - 'transcription factor binding (ChIP-Seq)', - 'transcription factor binding site identification', - 'transcription profiling', - 'transcription profiling (Microarray)', - 'transcription profiling (RNA-Seq)', - 'TRAP translational profiling', - 'Other' - ] - }, - studyAssayOtherMeasurmentType: { - name: 'studyAssayOtherMeasurmentType', - displayName: 'Other Measurement Type', - title: 'Other Measurement Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Measurement Type, list any other measurement types that were used. Terms from NCBO Bioportal are recommended.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 7 - }, - studyAssayTechnologyType: { - name: 'studyAssayTechnologyType', - displayName: 'Technology Type', - title: 'Technology Type', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'A term to identify the technology used to perform the measurement (e.g. DNA microarray; mass spectrometry).', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 8, - displayOnCreate: true, - controlledVocabularyValues: [ - 'culture based drug susceptibility testing, single concentration', - 'culture based drug susceptibility testing, two concentrations', - 'culture based drug susceptibility testing, three or more concentrations (minimium inhibitory concentration measurement)', - 'DNA microarray', - 'flow cytometry', - 'gel electrophoresis', - 'mass spectrometry', - 'NMR spectroscopy', - 'nucleotide sequencing', - 'protein microarray', - 'real time PCR', - 'no technology required', - 'Other' - ] - }, - studyAssayOtherTechnologyType: { - name: 'studyAssayOtherTechnologyType', - displayName: 'Other Technology Type', - title: 'Other Technology Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Technology Type, list any other technology types that were used in this Dataset.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 9 - }, - studyAssayPlatform: { - name: 'studyAssayPlatform', - displayName: 'Technology Platform', - title: 'Technology Platform', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'The manufacturer and name of the technology platform used in the assay (e.g. Bruker AVANCE).', - multiple: true, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 10, - controlledVocabularyValues: [ - '210-MS GC Ion Trap (Varian)', - '220-MS GC Ion Trap (Varian)', - '225-MS GC Ion Trap (Varian)', - '240-MS GC Ion Trap (Varian)', - '300-MS quadrupole GC/MS (Varian)', - '320-MS LC/MS (Varian)', - '325-MS LC/MS (Varian)', - '320-MS GC/MS (Varian)', - '500-MS LC/MS (Varian)', - '800D (Jeol)', - '910-MS TQ-FT (Varian)', - '920-MS TQ-FT (Varian)', - '3100 Mass Detector (Waters)', - '6110 Quadrupole LC/MS (Agilent)', - '6120 Quadrupole LC/MS (Agilent)', - '6130 Quadrupole LC/MS (Agilent)', - '6140 Quadrupole LC/MS (Agilent)', - '6310 Ion Trap LC/MS (Agilent)', - '6320 Ion Trap LC/MS (Agilent)', - '6330 Ion Trap LC/MS (Agilent)', - '6340 Ion Trap LC/MS (Agilent)', - '6410 Triple Quadrupole LC/MS (Agilent)', - '6430 Triple Quadrupole LC/MS (Agilent)', - '6460 Triple Quadrupole LC/MS (Agilent)', - '6490 Triple Quadrupole LC/MS (Agilent)', - '6530 Q-TOF LC/MS (Agilent)', - '6540 Q-TOF LC/MS (Agilent)', - '6210 TOF LC/MS (Agilent)', - '6220 TOF LC/MS (Agilent)', - '6230 TOF LC/MS (Agilent)', - '7000B Triple Quadrupole GC/MS (Agilent)', - 'AccuTO DART (Jeol)', - 'AccuTOF GC (Jeol)', - 'AccuTOF LC (Jeol)', - 'ACQUITY SQD (Waters)', - 'ACQUITY TQD (Waters)', - 'Agilent', - 'Agilent 5975E GC/MSD (Agilent)', - 'Agilent 5975T LTM GC/MSD (Agilent)', - '5975C Series GC/MSD (Agilent)', - 'Affymetrix', - 'amaZon ETD ESI Ion Trap (Bruker)', - 'amaZon X ESI Ion Trap (Bruker)', - 'apex-ultra hybrid Qq-FTMS (Bruker)', - 'API 2000 (AB Sciex)', - 'API 3200 (AB Sciex)', - 'API 3200 QTRAP (AB Sciex)', - 'API 4000 (AB Sciex)', - 'API 4000 QTRAP (AB Sciex)', - 'API 5000 (AB Sciex)', - 'API 5500 (AB Sciex)', - 'API 5500 QTRAP (AB Sciex)', - 'Applied Biosystems Group (ABI)', - 'AQI Biosciences', - 'Atmospheric Pressure GC (Waters)', - 'autoflex III MALDI-TOF MS (Bruker)', - 'autoflex speed(Bruker)', - 'AutoSpec Premier (Waters)', - 'AXIMA Mega TOF (Shimadzu)', - 'AXIMA Performance MALDI TOF/TOF (Shimadzu)', - 'A-10 Analyzer (Apogee)', - 'A-40-MiniFCM (Apogee)', - 'Bactiflow (Chemunex SA)', - 'Base4innovation', - 'BD BACTEC MGIT 320', - 'BD BACTEC MGIT 960', - 'BD Radiometric BACTEC 460TB', - 'BioNanomatrix', - 'Cell Lab Quanta SC (Becman Coulter)', - 'Clarus 560 D GC/MS (PerkinElmer)', - 'Clarus 560 S GC/MS (PerkinElmer)', - 'Clarus 600 GC/MS (PerkinElmer)', - 'Complete Genomics', - 'Cyan (Dako Cytomation)', - 'CyFlow ML (Partec)', - 'Cyow SL (Partec)', - 'CyFlow SL3 (Partec)', - 'CytoBuoy (Cyto Buoy Inc)', - 'CytoSence (Cyto Buoy Inc)', - 'CytoSub (Cyto Buoy Inc)', - 'Danaher', - 'DFS (Thermo Scientific)', - 'Exactive(Thermo Scientific)', - 'FACS Canto (Becton Dickinson)', - 'FACS Canto2 (Becton Dickinson)', - 'FACS Scan (Becton Dickinson)', - 'FC 500 (Becman Coulter)', - 'GCmate II GC/MS (Jeol)', - 'GCMS-QP2010 Plus (Shimadzu)', - 'GCMS-QP2010S Plus (Shimadzu)', - 'GCT Premier (Waters)', - 'GENEQ', - 'Genome Corp.', - 'GenoVoxx', - 'GnuBio', - 'Guava EasyCyte Mini (Millipore)', - 'Guava EasyCyte Plus (Millipore)', - 'Guava Personal Cell Analysis (Millipore)', - 'Guava Personal Cell Analysis-96 (Millipore)', - 'Helicos BioSciences', - 'Illumina', - 'Indirect proportion method on LJ medium', - 'Indirect proportion method on Middlebrook Agar 7H9', - 'Indirect proportion method on Middlebrook Agar 7H10', - 'Indirect proportion method on Middlebrook Agar 7H11', - 'inFlux Analyzer (Cytopeia)', - 'Intelligent Bio-Systems', - 'ITQ 700 (Thermo Scientific)', - 'ITQ 900 (Thermo Scientific)', - 'ITQ 1100 (Thermo Scientific)', - 'JMS-53000 SpiralTOF (Jeol)', - 'LaserGen', - 'LCMS-2020 (Shimadzu)', - 'LCMS-2010EV (Shimadzu)', - 'LCMS-IT-TOF (Shimadzu)', - 'Li-Cor', - 'Life Tech', - 'LightSpeed Genomics', - 'LCT Premier XE (Waters)', - 'LCQ Deca XP MAX (Thermo Scientific)', - 'LCQ Fleet (Thermo Scientific)', - 'LXQ (Thermo Scientific)', - 'LTQ Classic (Thermo Scientific)', - 'LTQ XL (Thermo Scientific)', - 'LTQ Velos (Thermo Scientific)', - 'LTQ Orbitrap Classic (Thermo Scientific)', - 'LTQ Orbitrap XL (Thermo Scientific)', - 'LTQ Orbitrap Discovery (Thermo Scientific)', - 'LTQ Orbitrap Velos (Thermo Scientific)', - 'Luminex 100 (Luminex)', - 'Luminex 200 (Luminex)', - 'MACS Quant (Miltenyi)', - 'MALDI SYNAPT G2 HDMS (Waters)', - 'MALDI SYNAPT G2 MS (Waters)', - 'MALDI SYNAPT HDMS (Waters)', - 'MALDI SYNAPT MS (Waters)', - 'MALDI micro MX (Waters)', - 'maXis (Bruker)', - 'maXis G4 (Bruker)', - 'microflex LT MALDI-TOF MS (Bruker)', - 'microflex LRF MALDI-TOF MS (Bruker)', - 'microflex III MALDI-TOF MS (Bruker)', - 'micrOTOF II ESI TOF (Bruker)', - 'micrOTOF-Q II ESI-Qq-TOF (Bruker)', - 'microplate Alamar Blue (resazurin) colorimetric method', - 'Mstation (Jeol)', - 'MSQ Plus (Thermo Scientific)', - 'NABsys', - 'Nanophotonics Biosciences', - 'Network Biosystems', - 'Nimblegen', - 'Oxford Nanopore Technologies', - 'Pacific Biosciences', - 'Population Genetics Technologies', - 'Q1000GC UltraQuad (Jeol)', - 'Quattro micro API (Waters)', - 'Quattro micro GC (Waters)', - 'Quattro Premier XE (Waters)', - 'QSTAR (AB Sciex)', - 'Reveo', - 'Roche', - 'Seirad', - 'solariX hybrid Qq-FTMS (Bruker)', - 'Somacount (Bently Instruments)', - 'SomaScope (Bently Instruments)', - 'SYNAPT G2 HDMS (Waters)', - 'SYNAPT G2 MS (Waters)', - 'SYNAPT HDMS (Waters)', - 'SYNAPT MS (Waters)', - 'TripleTOF 5600 (AB Sciex)', - 'TSQ Quantum Ultra (Thermo Scientific)', - 'TSQ Quantum Access (Thermo Scientific)', - 'TSQ Quantum Access MAX (Thermo Scientific)', - 'TSQ Quantum Discovery MAX (Thermo Scientific)', - 'TSQ Quantum GC (Thermo Scientific)', - 'TSQ Quantum XLS (Thermo Scientific)', - 'TSQ Vantage (Thermo Scientific)', - 'ultrafleXtreme MALDI-TOF MS (Bruker)', - 'VisiGen Biotechnologies', - 'Xevo G2 QTOF (Waters)', - 'Xevo QTof MS (Waters)', - 'Xevo TQ MS (Waters)', - 'Xevo TQ-S (Waters)', - 'Other' - ] - }, - studyAssayOtherPlatform: { - name: 'studyAssayOtherPlatform', - displayName: 'Other Technology Platform', - title: 'Other Technology Platform', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If Other was selected in Technology Platform, list any other technology platforms that were used in this Dataset.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 11 - }, - studyAssayCellType: { - name: 'studyAssayCellType', - displayName: 'Cell Type', - title: 'Cell Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'The name of the cell line from which the source or sample derives.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 12 - } - } - }, - { - id: 6, - name: 'journal', - displayName: 'Journal Metadata', - displayOnCreate: false, - metadataFields: { - journalVolumeIssue: { - name: 'journalVolumeIssue', - displayName: 'Journal', - title: 'Journal', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'Indicates the volume, issue and date of a journal, which this Dataset is associated with.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOrder: 0, - displayOnCreate: true, - childMetadataFields: { - journalVolume: { - name: 'journalVolume', - displayName: 'Journal Volume', - title: 'Volume', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The journal volume which this Dataset is associated with (e.g., Volume 4).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 1 - }, - journalIssue: { - name: 'journalIssue', - displayName: 'Journal Issue', - title: 'Issue', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The journal issue number which this Dataset is associated with (e.g., Number 2, Autumn).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 2 - }, - journalPubDate: { - name: 'journalPubDate', - displayName: 'Journal Publication Date', - title: 'Publication Date', - type: 'DATE', - typeClass: 'primitive', - watermark: 'YYYY or YYYY-MM or YYYY-MM-DD', - description: - 'The publication date for this journal volume/issue, which this Dataset is associated with (e.g., 1999).', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - } - } - }, - journalArticleType: { - name: 'journalArticleType', - displayName: 'Type of Article', - title: 'Type of Article', - type: 'TEXT', - typeClass: 'controlledVocabulary', - watermark: '', - description: - 'Indicates what kind of article this is, for example, a research article, a commentary, a book or product review, a case report, a calendar, etc (based on JATS). ', - multiple: false, - isControlledVocabulary: true, - displayFormat: '', - isRequired: false, - displayOrder: 4, - displayOnCreate: true, - controlledVocabularyValues: [ - 'abstract', - 'addendum', - 'announcement', - 'article-commentary', - 'book review', - 'books received', - 'brief report', - 'calendar', - 'case report', - 'collection', - 'correction', - 'data paper', - 'discussion', - 'dissertation', - 'editorial', - 'in brief', - 'introduction', - 'letter', - 'meeting report', - 'news', - 'obituary', - 'oration', - 'partial retraction', - 'product review', - 'rapid communication', - 'reply', - 'reprint', - 'research article', - 'retraction', - 'review article', - 'translation', - 'other' - ] - } - } - }, - { - id: 3, - name: 'socialscience', - displayName: 'Social Science and Humanities Metadata', - displayOnCreate: false, - metadataFields: { - unitOfAnalysis: { - name: 'unitOfAnalysis', - displayName: 'Unit of Analysis', - title: 'Unit of Analysis', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - "Basic unit of analysis or observation that this Dataset describes, such as individuals, families/households, groups, institutions/organizations, administrative units, and more. For information about the DDI's controlled vocabulary for this element, please refer to the DDI web page at http://www.ddialliance.org/controlled-vocabularies.", - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 0 - }, - universe: { - name: 'universe', - displayName: 'Universe', - title: 'Universe', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Description of the population covered by the data in the file; the group of people or other elements that are the object of the study and to which the study results refer. Age, nationality, and residence commonly help to delineate a given universe, but any number of other factors may be used, such as age limits, sex, marital status, race, ethnic group, nationality, income, veteran status, criminal convictions, and more. The universe may consist of elements other than persons, such as housing units, court cases, deaths, countries, and so on. In general, it should be possible to tell from the description of the universe whether a given individual or element is a member of the population under study. Also known as the universe of interest, population of interest, and target population.', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 1 - }, - timeMethod: { - name: 'timeMethod', - displayName: 'Time Method', - title: 'Time Method', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'The time method or time dimension of the data collection, such as panel, cross-sectional, trend, time- series, or other.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 2 - }, - dataCollector: { - name: 'dataCollector', - displayName: 'Data Collector', - title: 'Data Collector', - type: 'TEXT', - typeClass: 'primitive', - watermark: 'FamilyName, GivenName or Organization', - description: - 'Individual, agency or organization responsible for administering the questionnaire or interview or compiling the data.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 3 - }, - collectorTraining: { - name: 'collectorTraining', - displayName: 'Collector Training', - title: 'Collector Training', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Type of training provided to the data collector', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 4 - }, - frequencyOfDataCollection: { - name: 'frequencyOfDataCollection', - displayName: 'Frequency', - title: 'Frequency', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'If the data collected includes more than one point in time, indicate the frequency with which the data was collected; that is, monthly, quarterly, or other.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 5 - }, - samplingProcedure: { - name: 'samplingProcedure', - displayName: 'Sampling Procedure', - title: 'Sampling Procedure', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Type of sample and sample design used to select the survey respondents to represent the population. May include reference to the target sample size and the sampling fraction.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 6 - }, - targetSampleSize: { - name: 'targetSampleSize', - displayName: 'Target Sample Size', - title: 'Target Sample Size', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: - 'Specific information regarding the target sample size, actual sample size, and the formula used to determine this.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 7, - childMetadataFields: { - targetSampleActualSize: { - name: 'targetSampleActualSize', - displayName: 'Target Sample Size Actual', - title: 'Actual', - type: 'INT', - typeClass: 'primitive', - watermark: 'Enter an integer...', - description: 'Actual sample size.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 8 - }, - targetSampleSizeFormula: { - name: 'targetSampleSizeFormula', - displayName: 'Target Sample Size Formula', - title: 'Formula', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Formula used to determine target sample size.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 9 - } - } - }, - deviationsFromSampleDesign: { - name: 'deviationsFromSampleDesign', - displayName: 'Major Deviations for Sample Design', - title: 'Major Deviations for Sample Design', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Show correspondence as well as discrepancies between the sampled units (obtained) and available statistics for the population (age, sex-ratio, marital status, etc.) as a whole.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 10 - }, - collectionMode: { - name: 'collectionMode', - displayName: 'Collection Mode', - title: 'Collection Mode', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Method used to collect the data; instrumentation characteristics (e.g., telephone interview, mail questionnaire, or other).', - multiple: true, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 11 - }, - researchInstrument: { - name: 'researchInstrument', - displayName: 'Type of Research Instrument', - title: 'Type of Research Instrument', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Type of data collection instrument used. Structured indicates an instrument in which all respondents are asked the same questions/tests, possibly with precoded answers. If a small portion of such a questionnaire includes open-ended questions, provide appropriate comments. Semi-structured indicates that the research instrument contains mainly open-ended questions. Unstructured indicates that in-depth interviews were conducted.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 12 - }, - dataCollectionSituation: { - name: 'dataCollectionSituation', - displayName: 'Characteristics of Data Collection Situation', - title: 'Characteristics of Data Collection Situation', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'Description of noteworthy aspects of the data collection situation. Includes information on factors such as cooperativeness of respondents, duration of interviews, number of call backs, or similar.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 13 - }, - actionsToMinimizeLoss: { - name: 'actionsToMinimizeLoss', - displayName: 'Actions to Minimize Losses', - title: 'Actions to Minimize Losses', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Summary of actions taken to minimize data loss. Include information on actions such as follow-up visits, supervisory checks, historical matching, estimation, and so on.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 14 - }, - controlOperations: { - name: 'controlOperations', - displayName: 'Control Operations', - title: 'Control Operations', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Control OperationsMethods to facilitate data control performed by the primary investigator or by the data archive.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 15 - }, - weighting: { - name: 'weighting', - displayName: 'Weighting', - title: 'Weighting', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: - 'The use of sampling procedures might make it necessary to apply weights to produce accurate statistical results. Describes the criteria for using weights in analysis of a collection. If a weighting formula or coefficient was developed, the formula is provided, its elements are defined, and it is indicated how the formula was applied to the data.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 16 - }, - cleaningOperations: { - name: 'cleaningOperations', - displayName: 'Cleaning Operations', - title: 'Cleaning Operations', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Methods used to clean the data collection, such as consistency checking, wildcode checking, or other.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 17 - }, - datasetLevelErrorNotes: { - name: 'datasetLevelErrorNotes', - displayName: 'Study Level Error Notes', - title: 'Study Level Error Notes', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Note element used for any information annotating or clarifying the methodology and processing of the study. ', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 18 - }, - responseRate: { - name: 'responseRate', - displayName: 'Response Rate', - title: 'Response Rate', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'Percentage of sample members who provided information.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 19 - }, - samplingErrorEstimates: { - name: 'samplingErrorEstimates', - displayName: 'Estimates of Sampling Error', - title: 'Estimates of Sampling Error', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Measure of how precisely one can estimate a population value from a given sample.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 20 - }, - otherDataAppraisal: { - name: 'otherDataAppraisal', - displayName: 'Other Forms of Data Appraisal', - title: 'Other Forms of Data Appraisal', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: - 'Other issues pertaining to the data appraisal. Describe issues such as response variance, nonresponse rate and testing for bias, interviewer and response bias, confidence levels, question bias, or similar.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 21 - }, - socialScienceNotes: { - name: 'socialScienceNotes', - displayName: 'Notes', - title: 'Notes', - type: 'NONE', - typeClass: 'compound', - watermark: '', - description: 'General notes about this Dataset.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 22, - childMetadataFields: { - socialScienceNotesType: { - name: 'socialScienceNotesType', - displayName: 'Notes Type', - title: 'Type', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Type of note.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 23 - }, - socialScienceNotesSubject: { - name: 'socialScienceNotesSubject', - displayName: 'Notes Subject', - title: 'Subject', - type: 'TEXT', - typeClass: 'primitive', - watermark: '', - description: 'Note subject.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 24 - }, - socialScienceNotesText: { - name: 'socialScienceNotesText', - displayName: 'Notes Text', - title: 'Text', - type: 'TEXTBOX', - typeClass: 'primitive', - watermark: '', - description: 'Text for this note.', - multiple: false, - isControlledVocabulary: false, - displayFormat: '', - isRequired: false, - displayOnCreate: true, - displayOrder: 25 - } - } - } - } - } -] diff --git a/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx index d8584334b..0c45cdb46 100644 --- a/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx +++ b/src/sections/create-dataset/useGetMetadataBlocksInfo.tsx @@ -69,7 +69,7 @@ export const useGetMetadataBlocksInfo = ({ const errorMessage = err instanceof Error && err.message ? err.message - : 'Something went wrong getting the datasets' + : 'Something went wrong getting the information from the metadata blocks. Try again later.' setError(errorMessage) } finally { setIsLoading(false) diff --git a/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts b/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts index 4b6c2b8a6..390aae8b8 100644 --- a/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts +++ b/tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother.ts @@ -221,6 +221,37 @@ export class MetadataBlockInfoMother { isRequired: false, displayOnCreate: true, displayOrder: 18 + }, + multipleVocab: { + name: 'multipleVocab', + displayName: 'Multiple Vocabulary', + title: 'Multiple Vocabulary', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The area of study relevant to the Dataset', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: true, + displayOrder: 19, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Agricultural Sciences', + 'Arts and Humanities', + 'Astronomy and Astrophysics', + 'Business and Management', + 'Chemistry', + 'Computer and Information Science', + 'Earth and Environmental Sciences', + 'Engineering', + 'Law', + 'Mathematical Sciences', + 'Medicine, Health and Life Sciences', + 'Physics', + 'Social Sciences', + 'Other' + ] } } }, @@ -565,4 +596,3442 @@ export class MetadataBlockInfoMother { } ] } + + static getByCollectionIdFullResponse(): MetadataBlockInfo2[] { + return [ + { + id: 1, + name: 'citation', + displayName: 'Citation Metadata', + displayOnCreate: true, + metadataFields: { + title: { + name: 'title', + displayName: 'Title', + title: 'Title', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The main title of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOnCreate: true, + displayOrder: 0 + }, + subtitle: { + name: 'subtitle', + displayName: 'Subtitle', + title: 'Subtitle', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'A secondary title that amplifies or states certain limitations on the main title', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + displayOnCreate: true, + isRequired: false, + displayOrder: 1 + }, + alternativeTitle: { + name: 'alternativeTitle', + displayName: 'Alternative Title', + title: 'Alternative Title', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Either 1) a title commonly used to refer to the Dataset or 2) an abbreviation of the main title', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + alternativeURL: { + name: 'alternativeURL', + displayName: 'Alternative URL', + title: 'Alternative URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + 'Another URL where one can view or access the data in the Dataset, e.g. a project or personal webpage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + otherId: { + name: 'otherId', + displayName: 'Other Identifier', + title: 'Other Identifier', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + "Another unique identifier for the Dataset (e.g. producer's or another repository's identifier)", + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 4, + displayOnCreate: true, + childMetadataFields: { + otherIdAgency: { + name: 'otherIdAgency', + displayName: 'Other Identifier Agency', + title: 'Agency', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the agency that generated the other identifier', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 5 + }, + otherIdValue: { + name: 'otherIdValue', + displayName: 'Other Identifier Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Another identifier uniquely identifies the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 6 + } + } + }, + author: { + name: 'author', + displayName: 'Author', + title: 'Author', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'The entity, e.g. a person or organization, that created the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 7, + displayOnCreate: true, + childMetadataFields: { + authorName: { + name: 'authorName', + displayName: 'Author Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) Family Name, Given Name or 2) Organization XYZ', + description: + "The name of the author, such as the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOnCreate: true, + displayOrder: 8 + }, + authorAffiliation: { + name: 'authorAffiliation', + displayName: 'Author Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the author, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 9 + }, + authorIdentifierScheme: { + name: 'authorIdentifierScheme', + displayName: 'Author Identifier Type', + title: 'Identifier Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The type of identifier that uniquely identifies the author (e.g. ORCID, ISNI)', + multiple: false, + isControlledVocabulary: true, + displayFormat: '- #VALUE:', + isRequired: false, + displayOnCreate: true, + displayOrder: 10, + controlledVocabularyValues: [ + 'ORCID', + 'ISNI', + 'LCNA', + 'VIAF', + 'GND', + 'DAI', + 'ResearcherID', + 'ScopusID' + ] + }, + authorIdentifier: { + name: 'authorIdentifier', + displayName: 'Author Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Uniquely identifies the author when paired with an identifier type', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 11 + } + } + }, + datasetContact: { + name: 'datasetContact', + displayName: 'Point of Contact', + title: 'Point of Contact', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, e.g. a person or organization, that users of the Dataset can contact with questions', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 12, + displayOnCreate: true, + childMetadataFields: { + datasetContactName: { + name: 'datasetContactName', + displayName: 'Point of Contact Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the point of contact, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 13 + }, + datasetContactAffiliation: { + name: 'datasetContactAffiliation', + displayName: 'Point of Contact Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the point of contact, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 14 + }, + datasetContactEmail: { + name: 'datasetContactEmail', + displayName: 'Point of Contact E-mail', + title: 'E-mail', + type: 'EMAIL', + typeClass: 'primitive', + watermark: 'name@email.xyz', + description: "The point of contact's email address", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#EMAIL', + isRequired: true, + displayOnCreate: true, + displayOrder: 15 + } + } + }, + dsDescription: { + name: 'dsDescription', + displayName: 'Description', + title: 'Description', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'A summary describing the purpose, nature, and scope of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: true, + displayOrder: 16, + displayOnCreate: true, + childMetadataFields: { + dsDescriptionValue: { + name: 'dsDescriptionValue', + displayName: 'Description Text', + title: 'Text', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'A summary describing the purpose, nature, and scope of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOnCreate: true, + displayOrder: 17 + }, + dsDescriptionDate: { + name: 'dsDescriptionDate', + displayName: 'Description Date', + title: 'Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 18 + } + } + }, + subject: { + name: 'subject', + displayName: 'Subject', + title: 'Subject', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The area of study relevant to the Dataset', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: true, + displayOrder: 19, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Agricultural Sciences', + 'Arts and Humanities', + 'Astronomy and Astrophysics', + 'Business and Management', + 'Chemistry', + 'Computer and Information Science', + 'Earth and Environmental Sciences', + 'Engineering', + 'Law', + 'Mathematical Sciences', + 'Medicine, Health and Life Sciences', + 'Physics', + 'Social Sciences', + 'Other' + ] + }, + keyword: { + name: 'keyword', + displayName: 'Keyword', + title: 'Keyword', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 20, + displayOnCreate: true, + childMetadataFields: { + keywordValue: { + name: 'keywordValue', + displayName: 'Keyword Term', + title: 'Term', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'A key term that describes important aspects of the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 21 + }, + keywordVocabulary: { + name: 'keywordVocabulary', + displayName: 'Keyword Controlled Vocabulary Name', + title: 'Controlled Vocabulary Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 22 + }, + keywordVocabularyURI: { + name: 'keywordVocabularyURI', + displayName: 'Keyword Controlled Vocabulary URL', + title: 'Controlled Vocabulary URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL where one can access information about the term's controlled vocabulary", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 23 + } + } + }, + topicClassification: { + name: 'topicClassification', + displayName: 'Topic Classification', + title: 'Topic Classification', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 24, + displayOnCreate: true, + childMetadataFields: { + topicClassValue: { + name: 'topicClassValue', + displayName: 'Topic Classification Term', + title: 'Term', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'A topic or subject term', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 25 + }, + topicClassVocab: { + name: 'topicClassVocab', + displayName: 'Topic Classification Controlled Vocabulary Name', + title: 'Controlled Vocabulary Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 26 + }, + topicClassVocabURI: { + name: 'topicClassVocabURI', + displayName: 'Topic Classification Controlled Vocabulary URL', + title: 'Controlled Vocabulary URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL where one can access information about the term's controlled vocabulary", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 27 + } + } + }, + publication: { + name: 'publication', + displayName: 'Related Publication', + title: 'Related Publication', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The article or report that uses the data in the Dataset. The full list of related publications will be displayed on the metadata tab', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 28, + displayOnCreate: true, + childMetadataFields: { + publicationCitation: { + name: 'publicationCitation', + displayName: 'Related Publication Citation', + title: 'Citation', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'The full bibliographic citation for the related publication', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 29 + }, + publicationIDType: { + name: 'publicationIDType', + displayName: 'Related Publication Identifier Type', + title: 'Identifier Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The type of identifier that uniquely identifies a related publication', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE: ', + isRequired: false, + displayOrder: 30, + displayOnCreate: true, + controlledVocabularyValues: [ + 'ark', + 'arXiv', + 'bibcode', + 'cstr', + 'doi', + 'ean13', + 'eissn', + 'handle', + 'isbn', + 'issn', + 'istc', + 'lissn', + 'lsid', + 'pmid', + 'purl', + 'upc', + 'url', + 'urn', + 'DASH-NRS' + ] + }, + publicationIDNumber: { + name: 'publicationIDNumber', + displayName: 'Related Publication Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The identifier for a related publication', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 31 + }, + publicationURL: { + name: 'publicationURL', + displayName: 'Related Publication URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + 'The URL form of the identifier entered in the Identifier field, e.g. the DOI URL if a DOI was entered in the Identifier field. Used to display what was entered in the ID Type and ID Number fields as a link. If what was entered in the Identifier field has no URL form, the URL of the publication webpage is used, e.g. a journal article webpage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 32 + } + } + }, + notesText: { + name: 'notesText', + displayName: 'Notes', + title: 'Notes', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Additional information about the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 33, + displayOnCreate: true + }, + language: { + name: 'language', + displayName: 'Language', + title: 'Language', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: "A language that the Dataset's files is written in", + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 34, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Abkhaz', + 'Afar', + 'Afrikaans', + 'Akan', + 'Albanian', + 'Amharic', + 'Arabic', + 'Aragonese', + 'Armenian', + 'Assamese', + 'Avaric', + 'Avestan', + 'Aymara', + 'Azerbaijani', + 'Bambara', + 'Bashkir', + 'Basque', + 'Belarusian', + 'Bengali, Bangla', + 'Bihari', + 'Bislama', + 'Bosnian', + 'Breton', + 'Bulgarian', + 'Burmese', + 'Catalan,Valencian', + 'Chamorro', + 'Chechen', + 'Chichewa, Chewa, Nyanja', + 'Chinese', + 'Chuvash', + 'Cornish', + 'Corsican', + 'Cree', + 'Croatian', + 'Czech', + 'Danish', + 'Divehi, Dhivehi, Maldivian', + 'Dutch', + 'Dzongkha', + 'English', + 'Esperanto', + 'Estonian', + 'Ewe', + 'Faroese', + 'Fijian', + 'Finnish', + 'French', + 'Fula, Fulah, Pulaar, Pular', + 'Galician', + 'Georgian', + 'German', + 'Greek (modern)', + 'Guaraní', + 'Gujarati', + 'Haitian, Haitian Creole', + 'Hausa', + 'Hebrew (modern)', + 'Herero', + 'Hindi', + 'Hiri Motu', + 'Hungarian', + 'Interlingua', + 'Indonesian', + 'Interlingue', + 'Irish', + 'Igbo', + 'Inupiaq', + 'Ido', + 'Icelandic', + 'Italian', + 'Inuktitut', + 'Japanese', + 'Javanese', + 'Kalaallisut, Greenlandic', + 'Kannada', + 'Kanuri', + 'Kashmiri', + 'Kazakh', + 'Khmer', + 'Kikuyu, Gikuyu', + 'Kinyarwanda', + 'Kyrgyz', + 'Komi', + 'Kongo', + 'Korean', + 'Kurdish', + 'Kwanyama, Kuanyama', + 'Latin', + 'Luxembourgish, Letzeburgesch', + 'Ganda', + 'Limburgish, Limburgan, Limburger', + 'Lingala', + 'Lao', + 'Lithuanian', + 'Luba-Katanga', + 'Latvian', + 'Manx', + 'Macedonian', + 'Malagasy', + 'Malay', + 'Malayalam', + 'Maltese', + 'Māori', + 'Marathi (Marāṭhī)', + 'Marshallese', + 'Mixtepec Mixtec', + 'Mongolian', + 'Nauru', + 'Navajo, Navaho', + 'Northern Ndebele', + 'Nepali', + 'Ndonga', + 'Norwegian Bokmål', + 'Norwegian Nynorsk', + 'Norwegian', + 'Nuosu', + 'Southern Ndebele', + 'Occitan', + 'Ojibwe, Ojibwa', + 'Old Church Slavonic,Church Slavonic,Old Bulgarian', + 'Oromo', + 'Oriya', + 'Ossetian, Ossetic', + 'Panjabi, Punjabi', + 'Pāli', + 'Persian (Farsi)', + 'Polish', + 'Pashto, Pushto', + 'Portuguese', + 'Quechua', + 'Romansh', + 'Kirundi', + 'Romanian', + 'Russian', + 'Sanskrit (Saṁskṛta)', + 'Sardinian', + 'Sindhi', + 'Northern Sami', + 'Samoan', + 'Sango', + 'Serbian', + 'Scottish Gaelic, Gaelic', + 'Shona', + 'Sinhala, Sinhalese', + 'Slovak', + 'Slovene', + 'Somali', + 'Southern Sotho', + 'Spanish, Castilian', + 'Sundanese', + 'Swahili', + 'Swati', + 'Swedish', + 'Tamil', + 'Telugu', + 'Tajik', + 'Thai', + 'Tigrinya', + 'Tibetan Standard, Tibetan, Central', + 'Turkmen', + 'Tagalog', + 'Tswana', + 'Tonga (Tonga Islands)', + 'Turkish', + 'Tsonga', + 'Tatar', + 'Twi', + 'Tahitian', + 'Uyghur, Uighur', + 'Ukrainian', + 'Urdu', + 'Uzbek', + 'Venda', + 'Vietnamese', + 'Volapük', + 'Walloon', + 'Welsh', + 'Wolof', + 'Western Frisian', + 'Xhosa', + 'Yiddish', + 'Yoruba', + 'Zhuang, Chuang', + 'Zulu', + 'Not applicable' + ] + }, + producer: { + name: 'producer', + displayName: 'Producer', + title: 'Producer', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such a person or organization, managing the finances or other administrative processes involved in the creation of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 35, + displayOnCreate: true, + childMetadataFields: { + producerName: { + name: 'producerName', + displayName: 'Producer Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the entity, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: true, + displayOnCreate: true, + displayOrder: 36 + }, + producerAffiliation: { + name: 'producerAffiliation', + displayName: 'Producer Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the producer, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 37 + }, + producerAbbreviation: { + name: 'producerAbbreviation', + displayName: 'Producer Abbreviated Name', + title: 'Abbreviated Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: "The producer's abbreviated name (e.g. IQSS, ICPSR)", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 38 + }, + producerURL: { + name: 'producerURL', + displayName: 'Producer URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the producer's website", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 39 + }, + producerLogoURL: { + name: 'producerLogoURL', + displayName: 'Producer Logo URL', + title: 'Logo URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the producer's logo", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<img src="#VALUE" alt="#NAME" class="metadata-logo"/><br/>', + isRequired: false, + displayOnCreate: true, + displayOrder: 40 + } + } + }, + productionDate: { + name: 'productionDate', + displayName: 'Production Date', + title: 'Production Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the data were produced (not distributed, published, or archived)', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 41 + }, + productionPlace: { + name: 'productionPlace', + displayName: 'Production Location', + title: 'Production Location', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The location where the data and any related materials were produced or collected', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 42 + }, + contributor: { + name: 'contributor', + displayName: 'Contributor', + title: 'Contributor', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 43, + displayOnCreate: true, + childMetadataFields: { + contributorType: { + name: 'contributorType', + displayName: 'Contributor Type', + title: 'Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Indicates the type of contribution made to the dataset', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE ', + isRequired: false, + displayOrder: 44, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Data Collector', + 'Data Curator', + 'Data Manager', + 'Editor', + 'Funder', + 'Hosting Institution', + 'Project Leader', + 'Project Manager', + 'Project Member', + 'Related Person', + 'Researcher', + 'Research Group', + 'Rights Holder', + 'Sponsor', + 'Supervisor', + 'Work Package Leader', + 'Other' + ] + }, + contributorName: { + name: 'contributorName', + displayName: 'Contributor Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the contributor, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 45 + } + } + }, + grantNumber: { + name: 'grantNumber', + displayName: 'Funding Information', + title: 'Funding Information', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: "Information about the Dataset's financial support", + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 46, + displayOnCreate: true, + childMetadataFields: { + grantNumberAgency: { + name: 'grantNumberAgency', + displayName: 'Funding Information Agency', + title: 'Agency', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: 'The agency that provided financial support for the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 47 + }, + grantNumberValue: { + name: 'grantNumberValue', + displayName: 'Funding Information Identifier', + title: 'Identifier', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The grant identifier or contract identifier of the agency that provided financial support for the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 48 + } + } + }, + distributor: { + name: 'distributor', + displayName: 'Distributor', + title: 'Distributor', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The entity, such as a person or organization, designated to generate copies of the Dataset, including any editions or revisions', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 49, + displayOnCreate: true, + childMetadataFields: { + distributorName: { + name: 'distributorName', + displayName: 'Distributor Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + "The name of the entity, e.g. the person's name or the name of an organization", + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 50 + }, + distributorAffiliation: { + name: 'distributorAffiliation', + displayName: 'Distributor Affiliation', + title: 'Affiliation', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'Organization XYZ', + description: + "The name of the entity affiliated with the distributor, e.g. an organization's name", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 51 + }, + distributorAbbreviation: { + name: 'distributorAbbreviation', + displayName: 'Distributor Abbreviated Name', + title: 'Abbreviated Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: "The distributor's abbreviated name (e.g. IQSS, ICPSR)", + multiple: false, + isControlledVocabulary: false, + displayFormat: '(#VALUE)', + isRequired: false, + displayOnCreate: true, + displayOrder: 52 + }, + distributorURL: { + name: 'distributorURL', + displayName: 'Distributor URL', + title: 'URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: "The URL of the distributor's webpage", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<a href="#VALUE" target="_blank" rel="noopener">#VALUE</a>', + isRequired: false, + displayOnCreate: true, + displayOrder: 53 + }, + distributorLogoURL: { + name: 'distributorLogoURL', + displayName: 'Distributor Logo URL', + title: 'Logo URL', + type: 'URL', + typeClass: 'primitive', + watermark: 'https://', + description: + "The URL of the distributor's logo image, used to show the image on the Dataset's page", + multiple: false, + isControlledVocabulary: false, + displayFormat: '<img src="#VALUE" alt="#NAME" class="metadata-logo"/><br/>', + isRequired: false, + displayOnCreate: true, + displayOrder: 54 + } + } + }, + distributionDate: { + name: 'distributionDate', + displayName: 'Distribution Date', + title: 'Distribution Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: + 'The date when the Dataset was made available for distribution/presentation', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 55, + displayOnCreate: false + }, + depositor: { + name: 'depositor', + displayName: 'Depositor', + title: 'Depositor', + type: 'TEXT', + typeClass: 'primitive', + watermark: '1) FamilyName, GivenName or 2) Organization', + description: + 'The entity, such as a person or organization, that deposited the Dataset in the repository', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 56, + displayOnCreate: false + }, + dateOfDeposit: { + name: 'dateOfDeposit', + displayName: 'Deposit Date', + title: 'Deposit Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the Dataset was deposited into the repository', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 57, + displayOnCreate: false + }, + timePeriodCovered: { + name: 'timePeriodCovered', + displayName: 'Time Period', + title: 'Time Period', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'The time period that the data refer to. Also known as span. This is the time period covered by the data, not the dates of coding, collecting data, or making documents machine-readable', + multiple: true, + isControlledVocabulary: false, + displayFormat: ';', + isRequired: false, + displayOrder: 58, + displayOnCreate: true, + childMetadataFields: { + timePeriodCoveredStart: { + name: 'timePeriodCoveredStart', + displayName: 'Time Period Start Date', + title: 'Start Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The start date of the time period that the data refer to', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOnCreate: true, + displayOrder: 59 + }, + timePeriodCoveredEnd: { + name: 'timePeriodCoveredEnd', + displayName: 'Time Period End Date', + title: 'End Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The end date of the time period that the data refer to', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOnCreate: true, + displayOrder: 60 + } + } + }, + dateOfCollection: { + name: 'dateOfCollection', + displayName: 'Date of Collection', + title: 'Date of Collection', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'The dates when the data were collected or generated', + multiple: true, + isControlledVocabulary: false, + displayFormat: ';', + isRequired: false, + displayOrder: 61, + displayOnCreate: true, + childMetadataFields: { + dateOfCollectionStart: { + name: 'dateOfCollectionStart', + displayName: 'Date of Collection Start Date', + title: 'Start Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the data collection started', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOnCreate: true, + displayOrder: 62 + }, + dateOfCollectionEnd: { + name: 'dateOfCollectionEnd', + displayName: 'Date of Collection End Date', + title: 'End Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'The date when the data collection ended', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE ', + isRequired: false, + displayOnCreate: true, + displayOrder: 63 + } + } + }, + kindOfData: { + name: 'kindOfData', + displayName: 'Data Type', + title: 'Data Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The type of data included in the files (e.g. survey data, clinical data, or machine-readable text)', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 64, + displayOnCreate: false + }, + series: { + name: 'series', + displayName: 'Series', + title: 'Series', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'Information about the dataset series to which the Dataset belong', + multiple: true, + isControlledVocabulary: false, + displayFormat: ':', + isRequired: false, + displayOrder: 65, + displayOnCreate: true, + childMetadataFields: { + seriesName: { + name: 'seriesName', + displayName: 'Series Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the dataset series', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 66 + }, + seriesInformation: { + name: 'seriesInformation', + displayName: 'Series Information', + title: 'Information', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Can include 1) a history of the series and 2) a summary of features that apply to the series', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 67 + } + } + }, + software: { + name: 'software', + displayName: 'Software', + title: 'Software', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'Information about the software used to generate the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: ',', + isRequired: false, + displayOrder: 68, + displayOnCreate: true, + childMetadataFields: { + softwareName: { + name: 'softwareName', + displayName: 'Software Name', + title: 'Name', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of software used to generate the Dataset', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 69 + }, + softwareVersion: { + name: 'softwareVersion', + displayName: 'Software Version', + title: 'Version', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The version of the software used to generate the Dataset, e.g. 4.11', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#NAME: #VALUE', + isRequired: false, + displayOnCreate: true, + displayOrder: 70 + } + } + }, + relatedMaterial: { + name: 'relatedMaterial', + displayName: 'Related Material', + title: 'Related Material', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about the material related to the Dataset, such as appendices or sampling information available outside of the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 71, + displayOnCreate: false + }, + relatedDatasets: { + name: 'relatedDatasets', + displayName: 'Related Dataset', + title: 'Related Dataset', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + "Information, such as a persistent ID or citation, about a related dataset, such as previous research on the Dataset's subject", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 72, + displayOnCreate: false + }, + otherReferences: { + name: 'otherReferences', + displayName: 'Other Reference', + title: 'Other Reference', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about another type of resource that provides background or supporting material to the Dataset', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 73, + displayOnCreate: false + }, + dataSources: { + name: 'dataSources', + displayName: 'Data Source', + title: 'Data Source', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Information, such as a persistent ID or citation, about sources of the Dataset (e.g. a book, article, serial, or machine-readable data file)', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 74, + displayOnCreate: false + }, + originOfSources: { + name: 'originOfSources', + displayName: 'Origin of Historical Sources', + title: 'Origin of Historical Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'For historical sources, the origin and any rules followed in establishing them as sources', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 75, + displayOnCreate: false + }, + characteristicOfSources: { + name: 'characteristicOfSources', + displayName: 'Characteristic of Sources', + title: 'Characteristic of Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Characteristics not already noted elsewhere', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 76, + displayOnCreate: false + }, + accessToSources: { + name: 'accessToSources', + displayName: 'Documentation and Access to Sources', + title: 'Documentation and Access to Sources', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + '1) Methods or procedures for accessing data sources and 2) any special permissions needed for access', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 77, + displayOnCreate: false + } + } + }, + { + id: 2, + name: 'geospatial', + displayName: 'Geospatial Metadata', + displayOnCreate: false, + metadataFields: { + geographicCoverage: { + name: 'geographicCoverage', + displayName: 'Geographic Coverage', + title: 'Geographic Coverage', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Information on the geographic coverage of the data. Includes the total geographic scope of the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0, + displayOnCreate: true, + childMetadataFields: { + country: { + name: 'country', + displayName: 'Geographic Coverage Country / Nation', + title: 'Country / Nation', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The country or nation that the Dataset is about.', + multiple: false, + isControlledVocabulary: true, + displayFormat: '#VALUE, ', + isRequired: false, + displayOrder: 1, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'American Samoa', + 'Andorra', + 'Angola', + 'Anguilla', + 'Antarctica', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Aruba', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bermuda', + 'Bhutan', + 'Bolivia, Plurinational State of', + 'Bonaire, Sint Eustatius and Saba', + 'Bosnia and Herzegovina', + 'Botswana', + 'Bouvet Island', + 'Brazil', + 'British Indian Ocean Territory', + 'Brunei Darussalam', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Cayman Islands', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Christmas Island', + 'Cocos (Keeling) Islands', + 'Colombia', + 'Comoros', + 'Congo', + 'Congo, the Democratic Republic of the', + 'Cook Islands', + 'Costa Rica', + 'Croatia', + 'Cuba', + 'Curaçao', + 'Cyprus', + 'Czech Republic', + "Côte d'Ivoire", + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Falkland Islands (Malvinas)', + 'Faroe Islands', + 'Fiji', + 'Finland', + 'France', + 'French Guiana', + 'French Polynesia', + 'French Southern Territories', + 'Gabon', + 'Gambia', + 'Georgia', + 'Germany', + 'Ghana', + 'Gibraltar', + 'Greece', + 'Greenland', + 'Grenada', + 'Guadeloupe', + 'Guam', + 'Guatemala', + 'Guernsey', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Heard Island and Mcdonald Islands', + 'Holy See (Vatican City State)', + 'Honduras', + 'Hong Kong', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran, Islamic Republic of', + 'Iraq', + 'Ireland', + 'Isle of Man', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jersey', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + "Korea, Democratic People's Republic of", + 'Korea, Republic of', + 'Kuwait', + 'Kyrgyzstan', + "Lao People's Democratic Republic", + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macao', + 'Macedonia, the Former Yugoslav Republic of', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Martinique', + 'Mauritania', + 'Mauritius', + 'Mayotte', + 'Mexico', + 'Micronesia, Federated States of', + 'Moldova, Republic of', + 'Monaco', + 'Mongolia', + 'Montenegro', + 'Montserrat', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Caledonia', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Niue', + 'Norfolk Island', + 'Northern Mariana Islands', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Palestine, State of', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Pitcairn', + 'Poland', + 'Portugal', + 'Puerto Rico', + 'Qatar', + 'Romania', + 'Russian Federation', + 'Rwanda', + 'Réunion', + 'Saint Barthélemy', + 'Saint Helena, Ascension and Tristan da Cunha', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Martin (French part)', + 'Saint Pierre and Miquelon', + 'Saint Vincent and the Grenadines', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Sint Maarten (Dutch part)', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'South Georgia and the South Sandwich Islands', + 'South Sudan', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Svalbard and Jan Mayen', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syrian Arab Republic', + 'Taiwan, Province of China', + 'Tajikistan', + 'Tanzania, United Republic of', + 'Thailand', + 'Timor-Leste', + 'Togo', + 'Tokelau', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Turks and Caicos Islands', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'United States Minor Outlying Islands', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Venezuela, Bolivarian Republic of', + 'Viet Nam', + 'Virgin Islands, British', + 'Virgin Islands, U.S.', + 'Wallis and Futuna', + 'Western Sahara', + 'Yemen', + 'Zambia', + 'Zimbabwe', + 'Åland Islands' + ] + }, + state: { + name: 'state', + displayName: 'Geographic Coverage State / Province', + title: 'State / Province', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + city: { + name: 'city', + displayName: 'Geographic Coverage City', + title: 'City', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The name of the city that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + otherGeographicCoverage: { + name: 'otherGeographicCoverage', + displayName: 'Geographic Coverage Other', + title: 'Other', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Other information on the geographic coverage of the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '#VALUE, ', + isRequired: false, + displayOnCreate: true, + displayOrder: 4 + } + } + }, + geographicUnit: { + name: 'geographicUnit', + displayName: 'Geographic Unit', + title: 'Geographic Unit', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Lowest level of geographic aggregation covered by the Dataset, e.g., village, county, region.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 5 + }, + geographicBoundingBox: { + name: 'geographicBoundingBox', + displayName: 'Geographic Bounding Box', + title: 'Geographic Bounding Box', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + "The fundamental geometric description for any Dataset that models geography is the geographic bounding box. It describes the minimum box, defined by west and east longitudes and north and south latitudes, which includes the largest geographic extent of the Dataset's geographic coverage. This element is used in the first pass of a coordinate-based search. Inclusion of this element in the codebook is recommended, but is required if the bound polygon box is included. ", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 6, + childMetadataFields: { + westLongitude: { + name: 'westLongitude', + displayName: 'Geographic Bounding Box Westernmost (Left) Longitude', + title: 'Westernmost (Left) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 7 + }, + eastLongitude: { + name: 'eastLongitude', + displayName: 'Geographic Bounding Box Easternmost (Right) Longitude', + title: 'Easternmost (Right) Longitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 8 + }, + northLatitude: { + name: 'northLatitude', + displayName: 'Geographic Bounding Box Northernmost (Top) Latitude', + title: 'Northernmost (Top) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 9 + }, + southLatitude: { + name: 'southLatitude', + displayName: 'Geographic Bounding Box Southernmost (Bottom) Latitude', + title: 'Southernmost (Bottom) Latitude', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 10 + } + } + } + } + }, + { + id: 4, + name: 'astrophysics', + displayName: 'Astronomy and Astrophysics Metadata', + displayOnCreate: false, + metadataFields: { + astroType: { + name: 'astroType', + displayName: 'Type', + title: 'Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'The nature or genre of the content of the files in the dataset.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 0, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Image', + 'Mosaic', + 'EventList', + 'Spectrum', + 'Cube', + 'Table', + 'Catalog', + 'LightCurve', + 'Simulation', + 'Figure', + 'Artwork', + 'Animation', + 'PrettyPicture', + 'Documentation', + 'Other', + 'Library', + 'Press Release', + 'Facsimile', + 'Historical', + 'Observation', + 'Object', + 'Value', + 'ValuePair', + 'Survey' + ] + }, + astroFacility: { + name: 'astroFacility', + displayName: 'Facility', + title: 'Facility', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The observatory or facility where the data was obtained. ', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 1 + }, + astroInstrument: { + name: 'astroInstrument', + displayName: 'Instrument', + title: 'Instrument', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The instrument used to collect the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + astroObject: { + name: 'astroObject', + displayName: 'Object', + title: 'Object', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Astronomical Objects represented in the data (Given as SIMBAD recognizable names preferred).', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + 'resolution.Spatial': { + name: 'resolution.Spatial', + displayName: 'Spatial Resolution', + title: 'Spatial Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The spatial (angular) resolution that is typical of the observations, in decimal degrees.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 4 + }, + 'resolution.Spectral': { + name: 'resolution.Spectral', + displayName: 'Spectral Resolution', + title: 'Spectral Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The spectral resolution that is typical of the observations, given as the ratio \\u03bb/\\u0394\\u03bb.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 5 + }, + 'resolution.Temporal': { + name: 'resolution.Temporal', + displayName: 'Time Resolution', + title: 'Time Resolution', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The temporal resolution that is typical of the observations, given in seconds.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 6 + }, + 'coverage.Spectral.Bandpass': { + name: 'coverage.Spectral.Bandpass', + displayName: 'Bandpass', + title: 'Bandpass', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Conventional bandpass name', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 7 + }, + 'coverage.Spectral.CentralWavelength': { + name: 'coverage.Spectral.CentralWavelength', + displayName: 'Central Wavelength (m)', + title: 'Central Wavelength (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The central wavelength of the spectral bandpass, in meters.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 8 + }, + 'coverage.Spectral.Wavelength': { + name: 'coverage.Spectral.Wavelength', + displayName: 'Wavelength Range', + title: 'Wavelength Range', + type: 'NONE', + typeClass: 'compound', + watermark: 'Enter a floating-point number.', + description: 'The minimum and maximum wavelength of the spectral bandpass.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 9, + childMetadataFields: { + 'coverage.Spectral.MinimumWavelength': { + name: 'coverage.Spectral.MinimumWavelength', + displayName: 'Wavelength Range Minimum (m)', + title: 'Minimum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The minimum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 10 + }, + 'coverage.Spectral.MaximumWavelength': { + name: 'coverage.Spectral.MaximumWavelength', + displayName: 'Wavelength Range Maximum (m)', + title: 'Maximum (m)', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The maximum wavelength of the spectral bandpass, in meters.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 11 + } + } + }, + 'coverage.Temporal': { + name: 'coverage.Temporal', + displayName: 'Dataset Date Range', + title: 'Dataset Date Range', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: ' Time period covered by the data.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 12, + childMetadataFields: { + 'coverage.Temporal.StartTime': { + name: 'coverage.Temporal.StartTime', + displayName: 'Dataset Date Range Start', + title: 'Start', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset Start Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 13 + }, + 'coverage.Temporal.StopTime': { + name: 'coverage.Temporal.StopTime', + displayName: 'Dataset Date Range End', + title: 'End', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY-MM-DD', + description: 'Dataset End Date', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 14 + } + } + }, + 'coverage.Spatial': { + name: 'coverage.Spatial', + displayName: 'Sky Coverage', + title: 'Sky Coverage', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The sky coverage of the data object.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 15 + }, + 'coverage.Depth': { + name: 'coverage.Depth', + displayName: 'Depth Coverage', + title: 'Depth Coverage', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: 'The (typical) depth coverage, or sensitivity, of the data object in Jy.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 16 + }, + 'coverage.ObjectDensity': { + name: 'coverage.ObjectDensity', + displayName: 'Object Density', + title: 'Object Density', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The (typical) density of objects, catalog entries, telescope pointings, etc., on the sky, in number per square degree.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 17 + }, + 'coverage.ObjectCount': { + name: 'coverage.ObjectCount', + displayName: 'Object Count', + title: 'Object Count', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer.', + description: 'The total number of objects, catalog entries, etc., in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 18 + }, + 'coverage.SkyFraction': { + name: 'coverage.SkyFraction', + displayName: 'Fraction of Sky', + title: 'Fraction of Sky', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The fraction of the sky represented in the observations, ranging from 0 to 1.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 19 + }, + 'coverage.Polarization': { + name: 'coverage.Polarization', + displayName: 'Polarization', + title: 'Polarization', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The polarization coverage', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 20 + }, + redshiftType: { + name: 'redshiftType', + displayName: 'RedshiftType', + title: 'RedshiftType', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'RedshiftType string C "Redshift"; or "Optical" or "Radio" definitions of Doppler velocity used in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 21 + }, + 'resolution.Redshift': { + name: 'resolution.Redshift', + displayName: 'Redshift Resolution', + title: 'Redshift Resolution', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The resolution in redshift (unitless) or Doppler velocity (km/s) in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 22 + }, + 'coverage.RedshiftValue': { + name: 'coverage.RedshiftValue', + displayName: 'Redshift Value', + title: 'Redshift Value', + type: 'FLOAT', + typeClass: 'compound', + watermark: 'Enter a floating-point number.', + description: + 'The value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 23, + childMetadataFields: { + 'coverage.Redshift.MinimumValue': { + name: 'coverage.Redshift.MinimumValue', + displayName: 'Redshift Value Minimum', + title: 'Minimum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The minimum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 24 + }, + 'coverage.Redshift.MaximumValue': { + name: 'coverage.Redshift.MaximumValue', + displayName: 'Redshift Value Maximum', + title: 'Maximum', + type: 'FLOAT', + typeClass: 'primitive', + watermark: 'Enter a floating-point number.', + description: + 'The maximum value of the redshift (unitless) or Doppler velocity (km/s in the data object.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 25 + } + } + } + } + }, + { + id: 5, + name: 'biomedical', + displayName: 'Life Sciences Metadata', + displayOnCreate: false, + metadataFields: { + studyDesignType: { + name: 'studyDesignType', + displayName: 'Design Type', + title: 'Design Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Design types that are based on the overall experimental design.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 0, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Case Control', + 'Cross Sectional', + 'Cohort Study', + 'Nested Case Control Design', + 'Not Specified', + 'Parallel Group Design', + 'Perturbation Design', + 'Randomized Controlled Trial', + 'Technological Design', + 'Other' + ] + }, + studyOtherDesignType: { + name: 'studyOtherDesignType', + displayName: 'Other Design Type', + title: 'Other Design Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Design Type, list any other design types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 1 + }, + studyFactorType: { + name: 'studyFactorType', + displayName: 'Factor Type', + title: 'Factor Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: 'Factors used in the Dataset.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2, + controlledVocabularyValues: [ + 'Age', + 'Biomarkers', + 'Cell Surface Markers', + 'Cell Type/Cell Line', + 'Developmental Stage', + 'Disease State', + 'Drug Susceptibility', + 'Extract Molecule', + 'Genetic Characteristics', + 'Immunoprecipitation Antibody', + 'Organism', + 'Passages', + 'Platform', + 'Sex', + 'Strain', + 'Time Point', + 'Tissue Type', + 'Treatment Compound', + 'Treatment Type', + 'Other' + ] + }, + studyOtherFactorType: { + name: 'studyOtherFactorType', + displayName: 'Other Factor Type', + title: 'Other Factor Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Factor Type, list any other factor types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + studyAssayOrganism: { + name: 'studyAssayOrganism', + displayName: 'Organism', + title: 'Organism', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The taxonomic name of the organism used in the Dataset or from which the starting biological material derives.', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 4, + displayOnCreate: true, + controlledVocabularyValues: [ + 'Arabidopsis thaliana', + 'Bos taurus', + 'Caenorhabditis elegans', + 'Chlamydomonas reinhardtii', + 'Danio rerio (zebrafish)', + 'Dictyostelium discoideum', + 'Drosophila melanogaster', + 'Escherichia coli', + 'Hepatitis C virus', + 'Homo sapiens', + 'Mus musculus', + 'Mycobacterium africanum', + 'Mycobacterium canetti', + 'Mycobacterium tuberculosis', + 'Mycoplasma pneumoniae', + 'Oryza sativa', + 'Plasmodium falciparum', + 'Pneumocystis carinii', + 'Rattus norvegicus', + "Saccharomyces cerevisiae (brewer's yeast)", + 'Schizosaccharomyces pombe', + 'Takifugu rubripes', + 'Xenopus laevis', + 'Zea mays', + 'Other' + ] + }, + studyAssayOtherOrganism: { + name: 'studyAssayOtherOrganism', + displayName: 'Other Organism', + title: 'Other Organism', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Organism, list any other organisms that were used in this Dataset. Terms from the NCBI Taxonomy are recommended.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 5 + }, + studyAssayMeasurementType: { + name: 'studyAssayMeasurementType', + displayName: 'Measurement Type', + title: 'Measurement Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'A term to qualify the endpoint, or what is being measured (e.g. gene expression profiling; protein identification).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 6, + displayOnCreate: true, + controlledVocabularyValues: [ + 'cell sorting', + 'clinical chemistry analysis', + 'copy number variation profiling', + 'DNA methylation profiling', + 'DNA methylation profiling (Bisulfite-Seq)', + 'DNA methylation profiling (MeDIP-Seq)', + 'drug susceptibility', + 'environmental gene survey', + 'genome sequencing', + 'hematology', + 'histology', + 'Histone Modification (ChIP-Seq)', + 'loss of heterozygosity profiling', + 'metabolite profiling', + 'metagenome sequencing', + 'protein expression profiling', + 'protein identification', + 'protein-DNA binding site identification', + 'protein-protein interaction detection', + 'protein-RNA binding (RIP-Seq)', + 'SNP analysis', + 'targeted sequencing', + 'transcription factor binding (ChIP-Seq)', + 'transcription factor binding site identification', + 'transcription profiling', + 'transcription profiling (Microarray)', + 'transcription profiling (RNA-Seq)', + 'TRAP translational profiling', + 'Other' + ] + }, + studyAssayOtherMeasurmentType: { + name: 'studyAssayOtherMeasurmentType', + displayName: 'Other Measurement Type', + title: 'Other Measurement Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Measurement Type, list any other measurement types that were used. Terms from NCBO Bioportal are recommended.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 7 + }, + studyAssayTechnologyType: { + name: 'studyAssayTechnologyType', + displayName: 'Technology Type', + title: 'Technology Type', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'A term to identify the technology used to perform the measurement (e.g. DNA microarray; mass spectrometry).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 8, + displayOnCreate: true, + controlledVocabularyValues: [ + 'culture based drug susceptibility testing, single concentration', + 'culture based drug susceptibility testing, two concentrations', + 'culture based drug susceptibility testing, three or more concentrations (minimium inhibitory concentration measurement)', + 'DNA microarray', + 'flow cytometry', + 'gel electrophoresis', + 'mass spectrometry', + 'NMR spectroscopy', + 'nucleotide sequencing', + 'protein microarray', + 'real time PCR', + 'no technology required', + 'Other' + ] + }, + studyAssayOtherTechnologyType: { + name: 'studyAssayOtherTechnologyType', + displayName: 'Other Technology Type', + title: 'Other Technology Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Technology Type, list any other technology types that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 9 + }, + studyAssayPlatform: { + name: 'studyAssayPlatform', + displayName: 'Technology Platform', + title: 'Technology Platform', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'The manufacturer and name of the technology platform used in the assay (e.g. Bruker AVANCE).', + multiple: true, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 10, + controlledVocabularyValues: [ + '210-MS GC Ion Trap (Varian)', + '220-MS GC Ion Trap (Varian)', + '225-MS GC Ion Trap (Varian)', + '240-MS GC Ion Trap (Varian)', + '300-MS quadrupole GC/MS (Varian)', + '320-MS LC/MS (Varian)', + '325-MS LC/MS (Varian)', + '320-MS GC/MS (Varian)', + '500-MS LC/MS (Varian)', + '800D (Jeol)', + '910-MS TQ-FT (Varian)', + '920-MS TQ-FT (Varian)', + '3100 Mass Detector (Waters)', + '6110 Quadrupole LC/MS (Agilent)', + '6120 Quadrupole LC/MS (Agilent)', + '6130 Quadrupole LC/MS (Agilent)', + '6140 Quadrupole LC/MS (Agilent)', + '6310 Ion Trap LC/MS (Agilent)', + '6320 Ion Trap LC/MS (Agilent)', + '6330 Ion Trap LC/MS (Agilent)', + '6340 Ion Trap LC/MS (Agilent)', + '6410 Triple Quadrupole LC/MS (Agilent)', + '6430 Triple Quadrupole LC/MS (Agilent)', + '6460 Triple Quadrupole LC/MS (Agilent)', + '6490 Triple Quadrupole LC/MS (Agilent)', + '6530 Q-TOF LC/MS (Agilent)', + '6540 Q-TOF LC/MS (Agilent)', + '6210 TOF LC/MS (Agilent)', + '6220 TOF LC/MS (Agilent)', + '6230 TOF LC/MS (Agilent)', + '7000B Triple Quadrupole GC/MS (Agilent)', + 'AccuTO DART (Jeol)', + 'AccuTOF GC (Jeol)', + 'AccuTOF LC (Jeol)', + 'ACQUITY SQD (Waters)', + 'ACQUITY TQD (Waters)', + 'Agilent', + 'Agilent 5975E GC/MSD (Agilent)', + 'Agilent 5975T LTM GC/MSD (Agilent)', + '5975C Series GC/MSD (Agilent)', + 'Affymetrix', + 'amaZon ETD ESI Ion Trap (Bruker)', + 'amaZon X ESI Ion Trap (Bruker)', + 'apex-ultra hybrid Qq-FTMS (Bruker)', + 'API 2000 (AB Sciex)', + 'API 3200 (AB Sciex)', + 'API 3200 QTRAP (AB Sciex)', + 'API 4000 (AB Sciex)', + 'API 4000 QTRAP (AB Sciex)', + 'API 5000 (AB Sciex)', + 'API 5500 (AB Sciex)', + 'API 5500 QTRAP (AB Sciex)', + 'Applied Biosystems Group (ABI)', + 'AQI Biosciences', + 'Atmospheric Pressure GC (Waters)', + 'autoflex III MALDI-TOF MS (Bruker)', + 'autoflex speed(Bruker)', + 'AutoSpec Premier (Waters)', + 'AXIMA Mega TOF (Shimadzu)', + 'AXIMA Performance MALDI TOF/TOF (Shimadzu)', + 'A-10 Analyzer (Apogee)', + 'A-40-MiniFCM (Apogee)', + 'Bactiflow (Chemunex SA)', + 'Base4innovation', + 'BD BACTEC MGIT 320', + 'BD BACTEC MGIT 960', + 'BD Radiometric BACTEC 460TB', + 'BioNanomatrix', + 'Cell Lab Quanta SC (Becman Coulter)', + 'Clarus 560 D GC/MS (PerkinElmer)', + 'Clarus 560 S GC/MS (PerkinElmer)', + 'Clarus 600 GC/MS (PerkinElmer)', + 'Complete Genomics', + 'Cyan (Dako Cytomation)', + 'CyFlow ML (Partec)', + 'Cyow SL (Partec)', + 'CyFlow SL3 (Partec)', + 'CytoBuoy (Cyto Buoy Inc)', + 'CytoSence (Cyto Buoy Inc)', + 'CytoSub (Cyto Buoy Inc)', + 'Danaher', + 'DFS (Thermo Scientific)', + 'Exactive(Thermo Scientific)', + 'FACS Canto (Becton Dickinson)', + 'FACS Canto2 (Becton Dickinson)', + 'FACS Scan (Becton Dickinson)', + 'FC 500 (Becman Coulter)', + 'GCmate II GC/MS (Jeol)', + 'GCMS-QP2010 Plus (Shimadzu)', + 'GCMS-QP2010S Plus (Shimadzu)', + 'GCT Premier (Waters)', + 'GENEQ', + 'Genome Corp.', + 'GenoVoxx', + 'GnuBio', + 'Guava EasyCyte Mini (Millipore)', + 'Guava EasyCyte Plus (Millipore)', + 'Guava Personal Cell Analysis (Millipore)', + 'Guava Personal Cell Analysis-96 (Millipore)', + 'Helicos BioSciences', + 'Illumina', + 'Indirect proportion method on LJ medium', + 'Indirect proportion method on Middlebrook Agar 7H9', + 'Indirect proportion method on Middlebrook Agar 7H10', + 'Indirect proportion method on Middlebrook Agar 7H11', + 'inFlux Analyzer (Cytopeia)', + 'Intelligent Bio-Systems', + 'ITQ 700 (Thermo Scientific)', + 'ITQ 900 (Thermo Scientific)', + 'ITQ 1100 (Thermo Scientific)', + 'JMS-53000 SpiralTOF (Jeol)', + 'LaserGen', + 'LCMS-2020 (Shimadzu)', + 'LCMS-2010EV (Shimadzu)', + 'LCMS-IT-TOF (Shimadzu)', + 'Li-Cor', + 'Life Tech', + 'LightSpeed Genomics', + 'LCT Premier XE (Waters)', + 'LCQ Deca XP MAX (Thermo Scientific)', + 'LCQ Fleet (Thermo Scientific)', + 'LXQ (Thermo Scientific)', + 'LTQ Classic (Thermo Scientific)', + 'LTQ XL (Thermo Scientific)', + 'LTQ Velos (Thermo Scientific)', + 'LTQ Orbitrap Classic (Thermo Scientific)', + 'LTQ Orbitrap XL (Thermo Scientific)', + 'LTQ Orbitrap Discovery (Thermo Scientific)', + 'LTQ Orbitrap Velos (Thermo Scientific)', + 'Luminex 100 (Luminex)', + 'Luminex 200 (Luminex)', + 'MACS Quant (Miltenyi)', + 'MALDI SYNAPT G2 HDMS (Waters)', + 'MALDI SYNAPT G2 MS (Waters)', + 'MALDI SYNAPT HDMS (Waters)', + 'MALDI SYNAPT MS (Waters)', + 'MALDI micro MX (Waters)', + 'maXis (Bruker)', + 'maXis G4 (Bruker)', + 'microflex LT MALDI-TOF MS (Bruker)', + 'microflex LRF MALDI-TOF MS (Bruker)', + 'microflex III MALDI-TOF MS (Bruker)', + 'micrOTOF II ESI TOF (Bruker)', + 'micrOTOF-Q II ESI-Qq-TOF (Bruker)', + 'microplate Alamar Blue (resazurin) colorimetric method', + 'Mstation (Jeol)', + 'MSQ Plus (Thermo Scientific)', + 'NABsys', + 'Nanophotonics Biosciences', + 'Network Biosystems', + 'Nimblegen', + 'Oxford Nanopore Technologies', + 'Pacific Biosciences', + 'Population Genetics Technologies', + 'Q1000GC UltraQuad (Jeol)', + 'Quattro micro API (Waters)', + 'Quattro micro GC (Waters)', + 'Quattro Premier XE (Waters)', + 'QSTAR (AB Sciex)', + 'Reveo', + 'Roche', + 'Seirad', + 'solariX hybrid Qq-FTMS (Bruker)', + 'Somacount (Bently Instruments)', + 'SomaScope (Bently Instruments)', + 'SYNAPT G2 HDMS (Waters)', + 'SYNAPT G2 MS (Waters)', + 'SYNAPT HDMS (Waters)', + 'SYNAPT MS (Waters)', + 'TripleTOF 5600 (AB Sciex)', + 'TSQ Quantum Ultra (Thermo Scientific)', + 'TSQ Quantum Access (Thermo Scientific)', + 'TSQ Quantum Access MAX (Thermo Scientific)', + 'TSQ Quantum Discovery MAX (Thermo Scientific)', + 'TSQ Quantum GC (Thermo Scientific)', + 'TSQ Quantum XLS (Thermo Scientific)', + 'TSQ Vantage (Thermo Scientific)', + 'ultrafleXtreme MALDI-TOF MS (Bruker)', + 'VisiGen Biotechnologies', + 'Xevo G2 QTOF (Waters)', + 'Xevo QTof MS (Waters)', + 'Xevo TQ MS (Waters)', + 'Xevo TQ-S (Waters)', + 'Other' + ] + }, + studyAssayOtherPlatform: { + name: 'studyAssayOtherPlatform', + displayName: 'Other Technology Platform', + title: 'Other Technology Platform', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If Other was selected in Technology Platform, list any other technology platforms that were used in this Dataset.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 11 + }, + studyAssayCellType: { + name: 'studyAssayCellType', + displayName: 'Cell Type', + title: 'Cell Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'The name of the cell line from which the source or sample derives.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 12 + } + } + }, + { + id: 6, + name: 'journal', + displayName: 'Journal Metadata', + displayOnCreate: false, + metadataFields: { + journalVolumeIssue: { + name: 'journalVolumeIssue', + displayName: 'Journal', + title: 'Journal', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Indicates the volume, issue and date of a journal, which this Dataset is associated with.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOrder: 0, + displayOnCreate: true, + childMetadataFields: { + journalVolume: { + name: 'journalVolume', + displayName: 'Journal Volume', + title: 'Volume', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The journal volume which this Dataset is associated with (e.g., Volume 4).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 1 + }, + journalIssue: { + name: 'journalIssue', + displayName: 'Journal Issue', + title: 'Issue', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The journal issue number which this Dataset is associated with (e.g., Number 2, Autumn).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + journalPubDate: { + name: 'journalPubDate', + displayName: 'Journal Publication Date', + title: 'Publication Date', + type: 'DATE', + typeClass: 'primitive', + watermark: 'YYYY or YYYY-MM or YYYY-MM-DD', + description: + 'The publication date for this journal volume/issue, which this Dataset is associated with (e.g., 1999).', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + } + } + }, + journalArticleType: { + name: 'journalArticleType', + displayName: 'Type of Article', + title: 'Type of Article', + type: 'TEXT', + typeClass: 'controlledVocabulary', + watermark: '', + description: + 'Indicates what kind of article this is, for example, a research article, a commentary, a book or product review, a case report, a calendar, etc (based on JATS). ', + multiple: false, + isControlledVocabulary: true, + displayFormat: '', + isRequired: false, + displayOrder: 4, + displayOnCreate: true, + controlledVocabularyValues: [ + 'abstract', + 'addendum', + 'announcement', + 'article-commentary', + 'book review', + 'books received', + 'brief report', + 'calendar', + 'case report', + 'collection', + 'correction', + 'data paper', + 'discussion', + 'dissertation', + 'editorial', + 'in brief', + 'introduction', + 'letter', + 'meeting report', + 'news', + 'obituary', + 'oration', + 'partial retraction', + 'product review', + 'rapid communication', + 'reply', + 'reprint', + 'research article', + 'retraction', + 'review article', + 'translation', + 'other' + ] + } + } + }, + { + id: 3, + name: 'socialscience', + displayName: 'Social Science and Humanities Metadata', + displayOnCreate: false, + metadataFields: { + unitOfAnalysis: { + name: 'unitOfAnalysis', + displayName: 'Unit of Analysis', + title: 'Unit of Analysis', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + "Basic unit of analysis or observation that this Dataset describes, such as individuals, families/households, groups, institutions/organizations, administrative units, and more. For information about the DDI's controlled vocabulary for this element, please refer to the DDI web page at http://www.ddialliance.org/controlled-vocabularies.", + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 0 + }, + universe: { + name: 'universe', + displayName: 'Universe', + title: 'Universe', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Description of the population covered by the data in the file; the group of people or other elements that are the object of the study and to which the study results refer. Age, nationality, and residence commonly help to delineate a given universe, but any number of other factors may be used, such as age limits, sex, marital status, race, ethnic group, nationality, income, veteran status, criminal convictions, and more. The universe may consist of elements other than persons, such as housing units, court cases, deaths, countries, and so on. In general, it should be possible to tell from the description of the universe whether a given individual or element is a member of the population under study. Also known as the universe of interest, population of interest, and target population.', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 1 + }, + timeMethod: { + name: 'timeMethod', + displayName: 'Time Method', + title: 'Time Method', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'The time method or time dimension of the data collection, such as panel, cross-sectional, trend, time- series, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 2 + }, + dataCollector: { + name: 'dataCollector', + displayName: 'Data Collector', + title: 'Data Collector', + type: 'TEXT', + typeClass: 'primitive', + watermark: 'FamilyName, GivenName or Organization', + description: + 'Individual, agency or organization responsible for administering the questionnaire or interview or compiling the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 3 + }, + collectorTraining: { + name: 'collectorTraining', + displayName: 'Collector Training', + title: 'Collector Training', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Type of training provided to the data collector', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 4 + }, + frequencyOfDataCollection: { + name: 'frequencyOfDataCollection', + displayName: 'Frequency', + title: 'Frequency', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'If the data collected includes more than one point in time, indicate the frequency with which the data was collected; that is, monthly, quarterly, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 5 + }, + samplingProcedure: { + name: 'samplingProcedure', + displayName: 'Sampling Procedure', + title: 'Sampling Procedure', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Type of sample and sample design used to select the survey respondents to represent the population. May include reference to the target sample size and the sampling fraction.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 6 + }, + targetSampleSize: { + name: 'targetSampleSize', + displayName: 'Target Sample Size', + title: 'Target Sample Size', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: + 'Specific information regarding the target sample size, actual sample size, and the formula used to determine this.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 7, + childMetadataFields: { + targetSampleActualSize: { + name: 'targetSampleActualSize', + displayName: 'Target Sample Size Actual', + title: 'Actual', + type: 'INT', + typeClass: 'primitive', + watermark: 'Enter an integer...', + description: 'Actual sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 8 + }, + targetSampleSizeFormula: { + name: 'targetSampleSizeFormula', + displayName: 'Target Sample Size Formula', + title: 'Formula', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Formula used to determine target sample size.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 9 + } + } + }, + deviationsFromSampleDesign: { + name: 'deviationsFromSampleDesign', + displayName: 'Major Deviations for Sample Design', + title: 'Major Deviations for Sample Design', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Show correspondence as well as discrepancies between the sampled units (obtained) and available statistics for the population (age, sex-ratio, marital status, etc.) as a whole.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 10 + }, + collectionMode: { + name: 'collectionMode', + displayName: 'Collection Mode', + title: 'Collection Mode', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Method used to collect the data; instrumentation characteristics (e.g., telephone interview, mail questionnaire, or other).', + multiple: true, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 11 + }, + researchInstrument: { + name: 'researchInstrument', + displayName: 'Type of Research Instrument', + title: 'Type of Research Instrument', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Type of data collection instrument used. Structured indicates an instrument in which all respondents are asked the same questions/tests, possibly with precoded answers. If a small portion of such a questionnaire includes open-ended questions, provide appropriate comments. Semi-structured indicates that the research instrument contains mainly open-ended questions. Unstructured indicates that in-depth interviews were conducted.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 12 + }, + dataCollectionSituation: { + name: 'dataCollectionSituation', + displayName: 'Characteristics of Data Collection Situation', + title: 'Characteristics of Data Collection Situation', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'Description of noteworthy aspects of the data collection situation. Includes information on factors such as cooperativeness of respondents, duration of interviews, number of call backs, or similar.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 13 + }, + actionsToMinimizeLoss: { + name: 'actionsToMinimizeLoss', + displayName: 'Actions to Minimize Losses', + title: 'Actions to Minimize Losses', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Summary of actions taken to minimize data loss. Include information on actions such as follow-up visits, supervisory checks, historical matching, estimation, and so on.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 14 + }, + controlOperations: { + name: 'controlOperations', + displayName: 'Control Operations', + title: 'Control Operations', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Control OperationsMethods to facilitate data control performed by the primary investigator or by the data archive.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 15 + }, + weighting: { + name: 'weighting', + displayName: 'Weighting', + title: 'Weighting', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: + 'The use of sampling procedures might make it necessary to apply weights to produce accurate statistical results. Describes the criteria for using weights in analysis of a collection. If a weighting formula or coefficient was developed, the formula is provided, its elements are defined, and it is indicated how the formula was applied to the data.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 16 + }, + cleaningOperations: { + name: 'cleaningOperations', + displayName: 'Cleaning Operations', + title: 'Cleaning Operations', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Methods used to clean the data collection, such as consistency checking, wildcode checking, or other.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 17 + }, + datasetLevelErrorNotes: { + name: 'datasetLevelErrorNotes', + displayName: 'Study Level Error Notes', + title: 'Study Level Error Notes', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Note element used for any information annotating or clarifying the methodology and processing of the study. ', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 18 + }, + responseRate: { + name: 'responseRate', + displayName: 'Response Rate', + title: 'Response Rate', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Percentage of sample members who provided information.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 19 + }, + samplingErrorEstimates: { + name: 'samplingErrorEstimates', + displayName: 'Estimates of Sampling Error', + title: 'Estimates of Sampling Error', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Measure of how precisely one can estimate a population value from a given sample.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 20 + }, + otherDataAppraisal: { + name: 'otherDataAppraisal', + displayName: 'Other Forms of Data Appraisal', + title: 'Other Forms of Data Appraisal', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: + 'Other issues pertaining to the data appraisal. Describe issues such as response variance, nonresponse rate and testing for bias, interviewer and response bias, confidence levels, question bias, or similar.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 21 + }, + socialScienceNotes: { + name: 'socialScienceNotes', + displayName: 'Notes', + title: 'Notes', + type: 'NONE', + typeClass: 'compound', + watermark: '', + description: 'General notes about this Dataset.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 22, + childMetadataFields: { + socialScienceNotesType: { + name: 'socialScienceNotesType', + displayName: 'Notes Type', + title: 'Type', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Type of note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 23 + }, + socialScienceNotesSubject: { + name: 'socialScienceNotesSubject', + displayName: 'Notes Subject', + title: 'Subject', + type: 'TEXT', + typeClass: 'primitive', + watermark: '', + description: 'Note subject.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 24 + }, + socialScienceNotesText: { + name: 'socialScienceNotesText', + displayName: 'Notes Text', + title: 'Text', + type: 'TEXTBOX', + typeClass: 'primitive', + watermark: '', + description: 'Text for this note.', + multiple: false, + isControlledVocabulary: false, + displayFormat: '', + isRequired: false, + displayOnCreate: true, + displayOrder: 25 + } + } + } + } + } + ] + } } From 893e29fcbea0881747ec30478d99aefd888c032e Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 16:11:25 -0300 Subject: [PATCH 17/20] feat(Dynamic Fields): Add stories and its mocks repositories --- .../create-dataset/DatasetCreate.stories.tsx | 28 ++++++++++++++++++- .../MetadataBlockInfoMockErrorRepository.ts | 23 +++++++++++++++ .../MetadataBlockInfoMockLoadingRepository.ts | 15 ++++++++++ .../MetadataBlockInfoMockRepository.ts | 24 ++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/stories/create-dataset/MetadataBlockInfoMockErrorRepository.ts create mode 100644 src/stories/create-dataset/MetadataBlockInfoMockLoadingRepository.ts create mode 100644 src/stories/create-dataset/MetadataBlockInfoMockRepository.ts diff --git a/src/stories/create-dataset/DatasetCreate.stories.tsx b/src/stories/create-dataset/DatasetCreate.stories.tsx index 52298009d..f5dc5ef40 100644 --- a/src/stories/create-dataset/DatasetCreate.stories.tsx +++ b/src/stories/create-dataset/DatasetCreate.stories.tsx @@ -3,6 +3,9 @@ import { CreateDatasetForm } from '../../sections/create-dataset/CreateDatasetFo import { WithLayout } from '../WithLayout' import { WithI18next } from '../WithI18next' import { DatasetMockRepository } from '../dataset/DatasetMockRepository' +import { MetadataBlockInfoMockRepository } from './MetadataBlockInfoMockRepository' +import { MetadataBlockInfoMockLoadingRepository } from './MetadataBlockInfoMockLoadingRepository' +import { MetadataBlockInfoMockErrorRepository } from './MetadataBlockInfoMockErrorRepository' const meta: Meta<typeof CreateDatasetForm> = { title: 'Pages/Create Dataset', @@ -13,5 +16,28 @@ export default meta type Story = StoryObj<typeof CreateDatasetForm> export const Default: Story = { - render: () => <CreateDatasetForm repository={new DatasetMockRepository()} /> + render: () => ( + <CreateDatasetForm + repository={new DatasetMockRepository()} + metadataBlockInfoRepository={new MetadataBlockInfoMockRepository()} + /> + ) +} + +export const LoadingMetadataBlocksConfiguration: Story = { + render: () => ( + <CreateDatasetForm + repository={new DatasetMockRepository()} + metadataBlockInfoRepository={new MetadataBlockInfoMockLoadingRepository()} + /> + ) +} + +export const ErrorLoadingMetadataBlocksConfiguration: Story = { + render: () => ( + <CreateDatasetForm + repository={new DatasetMockRepository()} + metadataBlockInfoRepository={new MetadataBlockInfoMockErrorRepository()} + /> + ) } diff --git a/src/stories/create-dataset/MetadataBlockInfoMockErrorRepository.ts b/src/stories/create-dataset/MetadataBlockInfoMockErrorRepository.ts new file mode 100644 index 000000000..b64a9cf2a --- /dev/null +++ b/src/stories/create-dataset/MetadataBlockInfoMockErrorRepository.ts @@ -0,0 +1,23 @@ +import { + MetadataBlockInfo, + MetadataBlockInfo2 +} from '../../metadata-block-info/domain/models/MetadataBlockInfo' +import { MetadataBlockInfoMockRepository } from './MetadataBlockInfoMockRepository' + +export class MetadataBlockInfoMockErrorRepository implements MetadataBlockInfoMockRepository { + getByName(_name: string): Promise<MetadataBlockInfo | undefined> { + return new Promise((_resolve, reject) => { + setTimeout(() => { + reject('Error thrown from mock') + }, 1000) + }) + } + + getByColecctionId(_collectionId: string, _create: boolean): Promise<MetadataBlockInfo2[]> { + return new Promise((_resolve, reject) => { + setTimeout(() => { + reject('Error thrown from mock') + }, 1000) + }) + } +} diff --git a/src/stories/create-dataset/MetadataBlockInfoMockLoadingRepository.ts b/src/stories/create-dataset/MetadataBlockInfoMockLoadingRepository.ts new file mode 100644 index 000000000..79741e09e --- /dev/null +++ b/src/stories/create-dataset/MetadataBlockInfoMockLoadingRepository.ts @@ -0,0 +1,15 @@ +import { + MetadataBlockInfo, + MetadataBlockInfo2 +} from '../../metadata-block-info/domain/models/MetadataBlockInfo' +import { MetadataBlockInfoMockRepository } from './MetadataBlockInfoMockRepository' + +export class MetadataBlockInfoMockLoadingRepository implements MetadataBlockInfoMockRepository { + getByName(_name: string): Promise<MetadataBlockInfo | undefined> { + return new Promise(() => {}) + } + + getByColecctionId(_collectionId: string, _create: boolean): Promise<MetadataBlockInfo2[]> { + return new Promise(() => {}) + } +} diff --git a/src/stories/create-dataset/MetadataBlockInfoMockRepository.ts b/src/stories/create-dataset/MetadataBlockInfoMockRepository.ts new file mode 100644 index 000000000..6f4d03901 --- /dev/null +++ b/src/stories/create-dataset/MetadataBlockInfoMockRepository.ts @@ -0,0 +1,24 @@ +import { MetadataBlockInfoMother } from '../../../tests/component/metadata-block-info/domain/models/MetadataBlockInfoMother' +import { + MetadataBlockInfo, + MetadataBlockInfo2 +} from '../../metadata-block-info/domain/models/MetadataBlockInfo' +import { MetadataBlockInfoRepository } from '../../metadata-block-info/domain/repositories/MetadataBlockInfoRepository' + +export class MetadataBlockInfoMockRepository implements MetadataBlockInfoRepository { + getByName(_name: string): Promise<MetadataBlockInfo | undefined> { + return new Promise((resolve) => { + setTimeout(() => { + resolve(MetadataBlockInfoMother.create()) + }, 1_000) + }) + } + + getByColecctionId(_collectionId: string, _create: boolean): Promise<MetadataBlockInfo2[]> { + return new Promise((resolve) => { + setTimeout(() => { + resolve(MetadataBlockInfoMother.getByCollectionIdFullResponse()) + }, 1_000) + }) + } +} From 05b43d67b707e603cddc34729dec1b750337e649 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 16:11:41 -0300 Subject: [PATCH 18/20] feat(Dynamic Fields): Add more tests --- .../create-dataset/CreateDatasetForm.spec.tsx | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tests/component/create-dataset/CreateDatasetForm.spec.tsx b/tests/component/create-dataset/CreateDatasetForm.spec.tsx index cd39ae36e..30f8294e4 100644 --- a/tests/component/create-dataset/CreateDatasetForm.spec.tsx +++ b/tests/component/create-dataset/CreateDatasetForm.spec.tsx @@ -114,7 +114,10 @@ describe('Create Dataset', () => { cy.findByLabelText(/Integer Something/).should('exist') cy.findByTestId('int-field').should('exist') - // TODO:ME: Check the multiple select (checbox being rendered when voacabullary multiple) + // Multiple Vocabulary field - VOCABULARY and MULTIPLE + cy.findByText('Multiple Vocabulary').should('exist') + cy.findAllByTestId('vocabulary-multiple').should('exist') + cy.findByTestId('vocabulary-multiple').should('exist') }) cy.findByText(/Save Dataset/i).should('exist') @@ -122,6 +125,45 @@ describe('Create Dataset', () => { cy.findByText(/Cancel/i).should('exist') }) + it('renders skeleton while loading', () => { + cy.customMount( + <CreateDatasetForm + repository={datasetRepository} + metadataBlockInfoRepository={metadataBlockInfoRepository} + /> + ) + + cy.findByTestId('metadata-blocks-skeleton').should('exist') + }) + + describe('When getting collection metadata blocks info fails', () => { + it('renders error message', () => { + metadataBlockInfoRepository.getByColecctionId = cy.stub().rejects(new Error('some error')) + + cy.customMount( + <CreateDatasetForm + repository={datasetRepository} + metadataBlockInfoRepository={metadataBlockInfoRepository} + /> + ) + + cy.findByText('Error').should('exist') + }) + + it('disables save button', () => { + metadataBlockInfoRepository.getByColecctionId = cy.stub().rejects(new Error('some error')) + + cy.customMount( + <CreateDatasetForm + repository={datasetRepository} + metadataBlockInfoRepository={metadataBlockInfoRepository} + /> + ) + + cy.findByText(/Save Dataset/i).should('be.disabled') + }) + }) + // it.skip('shows an error message when the title is not provided', () => { // cy.customMount( // <CreateDatasetForm From 38d9ddb510180238c8ad8c80cb77e4b47ad167b6 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 16:55:04 -0300 Subject: [PATCH 19/20] feat(Dynamic Fields): Skip test of submiting valid form --- .../e2e/sections/create-dataset/CreateDatasetForm.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e-integration/e2e/sections/create-dataset/CreateDatasetForm.spec.tsx b/tests/e2e-integration/e2e/sections/create-dataset/CreateDatasetForm.spec.tsx index f200d8986..0c5ece159 100644 --- a/tests/e2e-integration/e2e/sections/create-dataset/CreateDatasetForm.spec.tsx +++ b/tests/e2e-integration/e2e/sections/create-dataset/CreateDatasetForm.spec.tsx @@ -16,7 +16,7 @@ describe('Create Dataset', () => { cy.findByRole('heading', { name: 'Create Dataset' }).should('exist') }) - it('navigates to the new dataset after submitting a valid form', () => { + it.skip('navigates to the new dataset after submitting a valid form', () => { cy.visit('/spa/datasets/create') cy.findByLabelText(/Title/i).type('Test Dataset Title') From 9ca06a77b85df2e8fdb731802b6a7e6afdef15a2 Mon Sep 17 00:00:00 2001 From: German Saracca <gersaracca@gmail.com> Date: Thu, 28 Mar 2024 17:34:47 -0300 Subject: [PATCH 20/20] feat(Dynamic Fields): Add test for rendering childrens trough react fragments --- .../form/form-group/FormGroup.spec.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/design-system/tests/component/form/form-group/FormGroup.spec.tsx diff --git a/packages/design-system/tests/component/form/form-group/FormGroup.spec.tsx b/packages/design-system/tests/component/form/form-group/FormGroup.spec.tsx new file mode 100644 index 000000000..08ab51372 --- /dev/null +++ b/packages/design-system/tests/component/form/form-group/FormGroup.spec.tsx @@ -0,0 +1,19 @@ +import { FormGroup } from '../../../../src/lib/components/form/form-group/FormGroup' +import { Form } from '../../../../src/lib/components/form/Form' + +describe('FormGroup', () => { + it('should render childrens correctly even trough react fragments', () => { + cy.mount( + <Form> + <FormGroup controlId="some-control-id"> + <> + <label htmlFor="username">Username</label> + <input type="text" id="username" /> + </> + </FormGroup> + </Form> + ) + + cy.findByText('Username').should('exist') + }) +})