@@ -2,8 +2,12 @@ import {
22 NewDatasetDTO ,
33 NewDatasetMetadataFieldValueDTO
44} from '../../../src/datasets/domain/dtos/NewDatasetDTO'
5- import { DatasetLicense , MetadataBlock } from '../../../src'
5+ import { DatasetLicense , MetadataBlock , MetadataFieldType } from '../../../src'
66import { NewDatasetRequestPayload } from '../../../src/datasets/infra/repositories/transformers/newDatasetTransformers'
7+ import {
8+ MetadataFieldWatermark ,
9+ MetadataFieldTypeClass
10+ } from '../../../src/metadataBlocks/domain/models/MetadataBlock'
711
812export const createNewDatasetDTO = (
913 titleFieldValue ?: NewDatasetMetadataFieldValueDTO ,
@@ -102,121 +106,130 @@ export const createNewDatasetMetadataBlockModel = (): MetadataBlock => {
102106 id : 1 ,
103107 name : 'citation' ,
104108 displayName : 'Citation Metadata' ,
109+ displayOnCreate : true ,
105110 metadataFields : {
106111 title : {
107112 name : 'title' ,
108113 displayName : 'title' ,
109114 title : 'title' ,
110- type : 'DatasetField' ,
111- watermark : 'watermark' ,
115+ type : MetadataFieldType . Text ,
116+ watermark : MetadataFieldWatermark . Empty ,
112117 description : 'description' ,
113118 multiple : false ,
114119 isControlledVocabulary : false ,
115120 displayFormat : '#VALUE' ,
116121 isRequired : true ,
117122 displayOrder : 0 ,
118- typeClass : 'primitive'
123+ displayOnCreate : true ,
124+ typeClass : MetadataFieldTypeClass . Primitive
119125 } ,
120126 author : {
121127 name : 'author' ,
122128 displayName : 'author' ,
123129 title : 'author' ,
124- type : 'NONE' ,
125- watermark : 'watermark' ,
130+ type : MetadataFieldType . None ,
131+ watermark : MetadataFieldWatermark . Empty ,
126132 description : 'description' ,
127133 multiple : true ,
128134 isControlledVocabulary : false ,
129135 displayFormat : '#VALUE' ,
130136 isRequired : true ,
131137 displayOrder : 1 ,
132- typeClass : 'compound' ,
138+ typeClass : MetadataFieldTypeClass . Compound ,
139+ displayOnCreate : true ,
133140 childMetadataFields : {
134141 authorName : {
135142 name : 'authorName' ,
136143 displayName : 'author name' ,
137144 title : 'author name' ,
138- type : 'TEXT' ,
139- watermark : 'watermark' ,
145+ type : MetadataFieldType . Text ,
146+ watermark : MetadataFieldWatermark . Empty ,
140147 description : 'description' ,
141148 multiple : false ,
142149 isControlledVocabulary : false ,
143150 displayFormat : '#VALUE' ,
144151 isRequired : true ,
145152 displayOrder : 2 ,
146- typeClass : 'primitive'
153+ displayOnCreate : true ,
154+ typeClass : MetadataFieldTypeClass . Primitive
147155 } ,
148156 authorAffiliation : {
149157 name : 'authorAffiliation' ,
150158 displayName : 'author affiliation' ,
151159 title : 'author affiliation' ,
152- type : 'TEXT' ,
153- watermark : 'watermark' ,
160+ type : MetadataFieldType . Text ,
161+ watermark : MetadataFieldWatermark . Empty ,
154162 description : 'descriprion' ,
155163 multiple : false ,
156164 isControlledVocabulary : false ,
157165 displayFormat : '#VALUE' ,
158166 isRequired : false ,
159167 displayOrder : 3 ,
160- typeClass : 'primitive'
168+ displayOnCreate : true ,
169+ typeClass : MetadataFieldTypeClass . Primitive
161170 }
162171 }
163172 } ,
164173 alternativeRequiredTitle : {
165174 name : 'alternativeRequiredTitle' ,
166175 displayName : 'Alternative Required Title' ,
167176 title : 'Alternative Title' ,
168- type : 'TEXT' ,
169- watermark : '' ,
177+ type : MetadataFieldType . Text ,
178+ watermark : MetadataFieldWatermark . Empty ,
170179 description :
171180 'Either 1) a title commonly used to refer to the Dataset or 2) an abbreviation of the main title' ,
172181 multiple : true ,
173182 isControlledVocabulary : false ,
174183 displayFormat : '' ,
175184 isRequired : true ,
176185 displayOrder : 4 ,
177- typeClass : 'primitive'
186+ displayOnCreate : true ,
187+ typeClass : MetadataFieldTypeClass . Primitive
178188 } ,
179189 timePeriodCoveredStart : {
180190 name : 'timePeriodCoveredStart' ,
181191 displayName : 'Time Period Start Date' ,
182192 title : 'Start Date' ,
183- type : 'DATE' ,
184- watermark : 'YYYY-MM-DD' ,
193+ type : MetadataFieldType . Date ,
194+ watermark : MetadataFieldWatermark . Empty ,
185195 description : 'The start date of the time period that the data refer to' ,
186196 multiple : false ,
187197 isControlledVocabulary : false ,
188198 displayFormat : '#NAME: #VALUE ' ,
189199 isRequired : false ,
190200 displayOrder : 5 ,
191- typeClass : 'primitive'
201+ displayOnCreate : true ,
202+ typeClass : MetadataFieldTypeClass . Primitive
192203 } ,
193204 contributor : {
194205 name : 'contributor' ,
195206 displayName : 'Contributor' ,
196207 title : 'Contributor' ,
197- type : 'NONE' ,
198- watermark : '' ,
208+ type : MetadataFieldType . None ,
209+ watermark : MetadataFieldWatermark . Empty ,
199210 description :
200211 'The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset' ,
201212 multiple : true ,
202213 isControlledVocabulary : false ,
203214 displayFormat : ':' ,
204215 isRequired : false ,
205216 displayOrder : 6 ,
206- typeClass : 'compound' ,
217+ typeClass : MetadataFieldTypeClass . Compound ,
218+ displayOnCreate : true ,
207219 childMetadataFields : {
208220 contributorType : {
209221 name : 'contributorType' ,
210222 displayName : 'Contributor Type' ,
211223 title : 'Type' ,
212- type : 'TEXT' ,
213- watermark : '' ,
224+ type : MetadataFieldType . Text ,
225+ watermark : MetadataFieldWatermark . Empty ,
214226 description : 'Indicates the type of contribution made to the dataset' ,
215227 multiple : false ,
216228 isControlledVocabulary : true ,
217229 displayFormat : '#VALUE ' ,
218230 isRequired : false ,
219231 displayOrder : 7 ,
232+ displayOnCreate : true ,
220233 controlledVocabularyValues : [
221234 'Data Collector' ,
222235 'Data Curator' ,
@@ -236,22 +249,23 @@ export const createNewDatasetMetadataBlockModel = (): MetadataBlock => {
236249 'Work Package Leader' ,
237250 'Other'
238251 ] ,
239- typeClass : 'controlledVocabulary'
252+ typeClass : MetadataFieldTypeClass . ControlledVocabulary
240253 } ,
241254 contributorName : {
242255 name : 'contributorName' ,
243256 displayName : 'Contributor Name' ,
244257 title : 'Name' ,
245- type : 'TEXT' ,
246- watermark : '1) FamilyName, GivenName or 2) Organization' ,
258+ type : MetadataFieldType . Text ,
259+ watermark : MetadataFieldWatermark . Empty ,
247260 description :
248261 "The name of the contributor, e.g. the person's name or the name of an organization" ,
249262 multiple : false ,
250263 isControlledVocabulary : false ,
251264 displayFormat : '#VALUE' ,
252265 isRequired : true ,
253266 displayOrder : 8 ,
254- typeClass : 'primitive'
267+ typeClass : MetadataFieldTypeClass . Primitive ,
268+ displayOnCreate : true
255269 }
256270 }
257271 }
0 commit comments