@dmptool/types 1.2.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +1 -1
  2. package/dist/answers/__tests__/defaults.spec.js +216 -0
  3. package/dist/answers/answer.d.ts +29 -14
  4. package/dist/answers/answer.js +11 -5
  5. package/dist/answers/dateAnswers.d.ts +20 -47
  6. package/dist/answers/dateAnswers.js +20 -10
  7. package/dist/answers/graphQLAnswers.d.ts +48 -120
  8. package/dist/answers/graphQLAnswers.js +46 -21
  9. package/dist/answers/index.d.ts +155 -1439
  10. package/dist/answers/index.js +26 -1
  11. package/dist/answers/numberAnswers.d.ts +38 -92
  12. package/dist/answers/numberAnswers.js +38 -19
  13. package/dist/answers/optionBasedAnswers.d.ts +42 -87
  14. package/dist/answers/optionBasedAnswers.js +37 -21
  15. package/dist/answers/tableAnswers.d.ts +348 -3032
  16. package/dist/answers/tableAnswers.js +25 -61
  17. package/dist/answers/textAnswers.d.ts +32 -68
  18. package/dist/answers/textAnswers.js +30 -17
  19. package/dist/questions/__tests__/dateQuestions.spec.js +3 -0
  20. package/dist/questions/__tests__/defaults.spec.d.ts +1 -0
  21. package/dist/questions/__tests__/defaults.spec.js +668 -0
  22. package/dist/questions/__tests__/optionBasedQuestions.spec.js +3 -2
  23. package/dist/questions/__tests__/tableQuestion.spec.js +22 -23
  24. package/dist/questions/__tests__/textQuestions.spec.js +32 -0
  25. package/dist/questions/dateQuestions.d.ts +45 -191
  26. package/dist/questions/dateQuestions.js +26 -23
  27. package/dist/questions/graphQLQuestions.d.ts +262 -556
  28. package/dist/questions/graphQLQuestions.js +225 -223
  29. package/dist/questions/index.d.ts +680 -8090
  30. package/dist/questions/index.js +26 -1
  31. package/dist/questions/numberQuestions.d.ts +85 -331
  32. package/dist/questions/numberQuestions.js +50 -36
  33. package/dist/questions/optionBasedQuestions.d.ts +83 -290
  34. package/dist/questions/optionBasedQuestions.js +58 -41
  35. package/dist/questions/question.d.ts +72 -35
  36. package/dist/questions/question.js +14 -5
  37. package/dist/questions/tableQuestions.d.ts +2029 -10357
  38. package/dist/questions/tableQuestions.js +197 -190
  39. package/dist/questions/textQuestions.d.ts +70 -226
  40. package/dist/questions/textQuestions.js +31 -31
  41. package/package.json +3 -4
  42. package/dist/answers/__tests__/usage.spec.js +0 -178
  43. package/dist/questions/__tests__/usage.spec.d.ts +0 -8
  44. package/dist/questions/__tests__/usage.spec.js +0 -473
  45. package/dist/schemas/affiliationSearchAnswer.schema.json +0 -45
  46. package/dist/schemas/affiliationSearchQuestion.schema.json +0 -140
  47. package/dist/schemas/anyAnswer.schema.json +0 -605
  48. package/dist/schemas/anyQuestion.schema.json +0 -1737
  49. package/dist/schemas/anyTableColumnAnswer.schema.json +0 -466
  50. package/dist/schemas/anyTableColumnQuestion.schema.json +0 -1092
  51. package/dist/schemas/booleanAnswer.schema.json +0 -34
  52. package/dist/schemas/booleanQuestion.schema.json +0 -56
  53. package/dist/schemas/checkboxesAnswer.schema.json +0 -39
  54. package/dist/schemas/checkboxesQuestion.schema.json +0 -76
  55. package/dist/schemas/currencyAnswer.schema.json +0 -34
  56. package/dist/schemas/currencyQuestion.schema.json +0 -67
  57. package/dist/schemas/dateAnswer.schema.json +0 -34
  58. package/dist/schemas/datePickerAnswer.schema.json +0 -37
  59. package/dist/schemas/datePickerQuestion.schema.json +0 -52
  60. package/dist/schemas/dateQuestion.schema.json +0 -62
  61. package/dist/schemas/dateRangeAnswer.schema.json +0 -45
  62. package/dist/schemas/dateRangeQuestion.schema.json +0 -112
  63. package/dist/schemas/emailAnswer.schema.json +0 -34
  64. package/dist/schemas/emailQuestion.schema.json +0 -66
  65. package/dist/schemas/filteredSearchAnswer.schema.json +0 -40
  66. package/dist/schemas/filteredSearchQuestion.schema.json +0 -130
  67. package/dist/schemas/licenseSearchAnswer.schema.json +0 -49
  68. package/dist/schemas/licenseSearchQuestion.schema.json +0 -164
  69. package/dist/schemas/metadataStandardSearchAnswer.schema.json +0 -49
  70. package/dist/schemas/metadataStandardSearchQuestion.schema.json +0 -174
  71. package/dist/schemas/multiselectBoxAnswer.schema.json +0 -39
  72. package/dist/schemas/multiselectBoxQuestion.schema.json +0 -85
  73. package/dist/schemas/numberAnswer.schema.json +0 -34
  74. package/dist/schemas/numberQuestion.schema.json +0 -63
  75. package/dist/schemas/numberRangeAnswer.schema.json +0 -45
  76. package/dist/schemas/numberRangeQuestion.schema.json +0 -94
  77. package/dist/schemas/numberWithContextAnswer.schema.json +0 -45
  78. package/dist/schemas/numberWithContextQuestion.schema.json +0 -84
  79. package/dist/schemas/radioButtonsAnswer.schema.json +0 -34
  80. package/dist/schemas/radioButtonsQuestion.schema.json +0 -76
  81. package/dist/schemas/repositorySearchAnswer.schema.json +0 -49
  82. package/dist/schemas/repositorySearchQuestion.schema.json +0 -180
  83. package/dist/schemas/researchOutputTableAnswer.schema.json +0 -519
  84. package/dist/schemas/researchOutputTableQuestion.schema.json +0 -1183
  85. package/dist/schemas/selectBoxAnswer.schema.json +0 -34
  86. package/dist/schemas/selectBoxQuestion.schema.json +0 -85
  87. package/dist/schemas/tableAnswer.schema.json +0 -519
  88. package/dist/schemas/tableQuestion.schema.json +0 -1183
  89. package/dist/schemas/textAnswer.schema.json +0 -34
  90. package/dist/schemas/textAreaAnswer.schema.json +0 -34
  91. package/dist/schemas/textAreaQuestion.schema.json +0 -70
  92. package/dist/schemas/textQuestion.schema.json +0 -62
  93. package/dist/schemas/typeaheadSearchAnswer.schema.json +0 -37
  94. package/dist/schemas/typeaheadSearchQuestion.schema.json +0 -120
  95. package/dist/schemas/urlAnswer.schema.json +0 -34
  96. package/dist/schemas/urlQuestion.schema.json +0 -62
  97. /package/dist/answers/__tests__/{usage.spec.d.ts → defaults.spec.d.ts} +0 -0
@@ -0,0 +1,668 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const dateQuestions_1 = require("../dateQuestions");
4
+ const globals_1 = require("@jest/globals");
5
+ const graphQLQuestions_1 = require("../graphQLQuestions");
6
+ const numberQuestions_1 = require("../numberQuestions");
7
+ const optionBasedQuestions_1 = require("../optionBasedQuestions");
8
+ const tableQuestions_1 = require("../tableQuestions");
9
+ describe('questions return the expected defaults', () => {
10
+ (0, globals_1.it)('returns the expected default affiliationSearch', () => {
11
+ const expected = {
12
+ type: "affiliationSearch",
13
+ attributes: {},
14
+ meta: { schemaVersion: "1.0" },
15
+ graphQL: {
16
+ query: graphQLQuestions_1.affiliationQuery,
17
+ queryId: "useAffiliationsQuery",
18
+ displayFields: [
19
+ {
20
+ propertyName: "displayName",
21
+ label: "Institution",
22
+ labelTranslationKey: "SignupPage.institution"
23
+ }
24
+ ],
25
+ answerField: "uri",
26
+ responseField: "affiliations.items",
27
+ variables: [
28
+ {
29
+ type: "string",
30
+ name: "name",
31
+ label: "Search for your institution",
32
+ minLength: 3,
33
+ labelTranslationKey: "SignupPage.institutionHelp"
34
+ },
35
+ ]
36
+ }
37
+ };
38
+ (0, globals_1.expect)(graphQLQuestions_1.DefaultAffiliationSearchQuestion).toEqual(expected);
39
+ });
40
+ (0, globals_1.it)('returns the expected default boolean', () => {
41
+ const expected = {
42
+ type: "boolean",
43
+ attributes: {
44
+ label: 'Is it true?',
45
+ value: false
46
+ },
47
+ meta: { schemaVersion: "1.0" }
48
+ };
49
+ (0, globals_1.expect)(optionBasedQuestions_1.DefaultBooleanQuestion).toEqual(expected);
50
+ });
51
+ (0, globals_1.it)('returns the expected default checkBoxes', () => {
52
+ const expected = {
53
+ type: "checkBoxes",
54
+ attributes: {},
55
+ meta: { schemaVersion: "1.0" },
56
+ options: [{ label: 'Option A', checked: false, value: 'a' }]
57
+ };
58
+ (0, globals_1.expect)(optionBasedQuestions_1.DefaultCheckboxesQuestion).toEqual(expected);
59
+ });
60
+ (0, globals_1.it)('returns the expected default currency', () => {
61
+ const expected = {
62
+ type: "currency",
63
+ attributes: { min: 0, step: 1, denomination: 'USD' },
64
+ meta: { schemaVersion: "1.0" }
65
+ };
66
+ (0, globals_1.expect)(numberQuestions_1.DefaultCurrencyQuestion).toEqual(expected);
67
+ });
68
+ (0, globals_1.it)('returns the expected default date', () => {
69
+ const expected = {
70
+ type: "date",
71
+ attributes: { step: 1 },
72
+ meta: { schemaVersion: "1.0" }
73
+ };
74
+ (0, globals_1.expect)(dateQuestions_1.DefaultDateQuestion).toEqual(expected);
75
+ });
76
+ (0, globals_1.it)('returns the expected default dateRange', () => {
77
+ const expected = {
78
+ type: "dateRange",
79
+ attributes: {},
80
+ meta: { schemaVersion: "1.0" },
81
+ columns: {
82
+ start: { label: 'From', step: 1 },
83
+ end: { label: 'To', step: 1 }
84
+ }
85
+ };
86
+ (0, globals_1.expect)(dateQuestions_1.DefaultDateRangeQuestion).toEqual(expected);
87
+ });
88
+ (0, globals_1.it)('returns the expected default licenseSearch', () => {
89
+ const expected = {
90
+ type: "licenseSearch",
91
+ attributes: {},
92
+ meta: { schemaVersion: "1.0" },
93
+ graphQL: {
94
+ query: graphQLQuestions_1.licenseQuery,
95
+ queryId: "useLicensesQuery",
96
+ variables: [
97
+ {
98
+ type: "string",
99
+ name: "term",
100
+ label: "Search for a license",
101
+ labelTranslationKey: "LicenseSearch.term",
102
+ minLength: 3
103
+ },
104
+ {
105
+ type: "OFFSET",
106
+ name: "paginationOptions",
107
+ label: "Pagination Options",
108
+ labelTranslationKey: "PaginationOptions.label",
109
+ }
110
+ ],
111
+ responseField: "licenses.items",
112
+ answerField: "uri",
113
+ displayFields: [
114
+ {
115
+ propertyName: "name",
116
+ label: "Name",
117
+ labelTranslationKey: "LicenseSearch.name"
118
+ },
119
+ {
120
+ propertyName: "description",
121
+ label: "Description",
122
+ labelTranslationKey: "LicenseSearch.description"
123
+ },
124
+ {
125
+ propertyName: "recommended",
126
+ label: "Recommended",
127
+ labelTranslationKey: "LicenseSearch.recommended"
128
+ }
129
+ ]
130
+ }
131
+ };
132
+ (0, globals_1.expect)(graphQLQuestions_1.DefaultLicenseSearchQuestion).toEqual(expected);
133
+ });
134
+ (0, globals_1.it)('returns the expected default metadataStandardSearch', () => {
135
+ const expected = {
136
+ type: "metadataStandardSearch",
137
+ attributes: {},
138
+ meta: { schemaVersion: "1.0" },
139
+ graphQL: {
140
+ query: graphQLQuestions_1.metadataStandardQuery,
141
+ queryId: "useMetadataStandardsQuery",
142
+ variables: [
143
+ {
144
+ type: "string",
145
+ name: "term",
146
+ label: "Search for a metadata standard",
147
+ labelTranslationKey: "MetadataStandardSearch.term",
148
+ minLength: 3
149
+ },
150
+ {
151
+ type: "string",
152
+ name: "keywords",
153
+ label: "Subject Areas",
154
+ labelTranslationKey: "MetadataStandardSearch.keywords",
155
+ minLength: 3
156
+ },
157
+ {
158
+ type: "OFFSET",
159
+ name: "paginationOptions",
160
+ label: "Pagination Options",
161
+ labelTranslationKey: "PaginationOptions.label",
162
+ }
163
+ ],
164
+ responseField: "metadataStandards.items",
165
+ answerField: "uri",
166
+ displayFields: [
167
+ {
168
+ propertyName: "name",
169
+ label: "Name",
170
+ labelTranslationKey: "MetadataStandardSearch.name"
171
+ },
172
+ {
173
+ propertyName: "description",
174
+ label: "Description",
175
+ labelTranslationKey: "MetadataStandardSearch.description"
176
+ },
177
+ {
178
+ propertyName: "website",
179
+ label: "Website",
180
+ labelTranslationKey: "MetadataStandardSearch.website"
181
+ },
182
+ {
183
+ propertyName: "keywords",
184
+ label: "Subject Areas",
185
+ labelTranslationKey: "MetadataStandardSearch.keywords"
186
+ }
187
+ ]
188
+ }
189
+ };
190
+ (0, globals_1.expect)(graphQLQuestions_1.DefaultMetadataStandardSearchQuestion).toEqual(expected);
191
+ });
192
+ (0, globals_1.it)('returns the expected default multiselectBox', () => {
193
+ const expected = {
194
+ type: "multiselectBox",
195
+ attributes: { multiple: true },
196
+ meta: { schemaVersion: "1.0" },
197
+ options: [{ label: 'Option A', selected: false, value: 'a' }]
198
+ };
199
+ (0, globals_1.expect)(optionBasedQuestions_1.DefaultMultiselectBoxQuestion).toEqual(expected);
200
+ });
201
+ (0, globals_1.it)('returns the expected default number', () => {
202
+ const expected = {
203
+ type: "number",
204
+ attributes: { min: 0, step: 1 },
205
+ meta: { schemaVersion: "1.0" }
206
+ };
207
+ (0, globals_1.expect)(numberQuestions_1.DefaultNumberQuestion).toEqual(expected);
208
+ });
209
+ (0, globals_1.it)('returns the expected default numberRange', () => {
210
+ const expected = {
211
+ type: "numberRange",
212
+ attributes: {},
213
+ meta: { schemaVersion: "1.0" },
214
+ columns: {
215
+ start: { label: "From", min: 0, step: 1 },
216
+ end: { label: "To", min: 0, step: 1 },
217
+ }
218
+ };
219
+ (0, globals_1.expect)(numberQuestions_1.DefaultNumberRangeQuestion).toEqual(expected);
220
+ });
221
+ (0, globals_1.it)('returns the expected default numberWithContext', () => {
222
+ const expected = {
223
+ type: "numberWithContext",
224
+ attributes: { min: 0, step: 1, context: [] },
225
+ meta: { schemaVersion: "1.0" }
226
+ };
227
+ (0, globals_1.expect)(numberQuestions_1.DefaultNumberWithContextQuestion).toEqual(expected);
228
+ });
229
+ (0, globals_1.it)('returns the expected default radioButtons', () => {
230
+ const expected = {
231
+ type: "radioButtons",
232
+ attributes: {},
233
+ meta: { schemaVersion: "1.0" },
234
+ options: [{ label: 'Option A', selected: false, value: 'a' }]
235
+ };
236
+ (0, globals_1.expect)(optionBasedQuestions_1.DefaultRadioButtonsQuestion).toEqual(expected);
237
+ });
238
+ (0, globals_1.it)('returns the expected default researchOutputTable', () => {
239
+ const expected = {
240
+ type: "researchOutputTable",
241
+ attributes: {
242
+ canAddRows: true,
243
+ canRemoveRows: true,
244
+ initialRows: 1,
245
+ },
246
+ meta: { schemaVersion: "1.0" },
247
+ columns: [
248
+ {
249
+ heading: "Title",
250
+ help: "Enter the title of this research output",
251
+ required: true,
252
+ enabled: true,
253
+ content: {
254
+ type: "text",
255
+ attributes: { maxLength: 255 },
256
+ meta: { schemaVersion: "1.0" },
257
+ }
258
+ },
259
+ {
260
+ heading: "Description",
261
+ help: "Enter a brief description of this research output",
262
+ required: false,
263
+ enabled: false,
264
+ content: {
265
+ type: "textArea",
266
+ attributes: {
267
+ asRichText: true,
268
+ cols: 20,
269
+ maxLength: 10000,
270
+ rows: 2
271
+ },
272
+ meta: { schemaVersion: "1.0" },
273
+ }
274
+ },
275
+ {
276
+ heading: "Type",
277
+ help: "Select the type of this research output",
278
+ required: true,
279
+ enabled: true,
280
+ content: {
281
+ type: "selectBox",
282
+ attributes: { multiple: false },
283
+ options: [
284
+ { label: 'Dataset', value: 'dataset', selected: false },
285
+ { label: 'Software', value: 'software', selected: false },
286
+ { label: 'Other', value: 'other', selected: false }
287
+ ],
288
+ meta: { schemaVersion: "1.0" }
289
+ }
290
+ },
291
+ {
292
+ heading: 'Data Flags',
293
+ help: 'Mark all of the statements that are true about the dataset',
294
+ required: false,
295
+ enabled: false,
296
+ content: {
297
+ type: "checkBoxes",
298
+ meta: { schemaVersion: "1.0" },
299
+ attributes: {},
300
+ options: [
301
+ {
302
+ label: 'May contain sensitive data?',
303
+ value: 'sensitive',
304
+ checked: false
305
+ },
306
+ {
307
+ label: 'May contain personally identifiable information?',
308
+ value: 'personal',
309
+ checked: false
310
+ },
311
+ ]
312
+ }
313
+ },
314
+ {
315
+ heading: 'Access Level',
316
+ help: 'Select the access level for this research output',
317
+ required: false,
318
+ enabled: false,
319
+ content: {
320
+ type: "radioButtons",
321
+ meta: { schemaVersion: "1.0" },
322
+ attributes: {},
323
+ options: [
324
+ { label: 'Open Access', value: 'open', selected: false },
325
+ { label: 'Restricted Access', value: 'restricted', selected: false },
326
+ { label: 'Other', value: 'closed', selected: false },
327
+ ]
328
+ }
329
+ },
330
+ {
331
+ heading: "Anticipated Release Date",
332
+ help: "The anticipated release date for the research output",
333
+ required: false,
334
+ enabled: false,
335
+ content: {
336
+ type: "date",
337
+ attributes: {
338
+ step: 1
339
+ },
340
+ meta: { schemaVersion: "1.0" },
341
+ }
342
+ },
343
+ {
344
+ heading: "Byte Size",
345
+ help: "The size of the research output in bytes",
346
+ required: false,
347
+ enabled: false,
348
+ content: {
349
+ type: "numberWithContext",
350
+ attributes: {
351
+ min: 0,
352
+ step: 1,
353
+ context: [
354
+ { label: 'bytes', value: 'bytes', selected: false },
355
+ { label: 'KB (kilobytes)', value: 'kb', selected: true },
356
+ { label: 'MB (megabytes)', value: 'mb', selected: false },
357
+ { label: 'GB (gigabytes)', value: 'gb', selected: false },
358
+ { label: 'TB (terabytes)', value: 'tb', selected: false },
359
+ { label: 'PB (petabytes)', value: 'pb', selected: false }
360
+ ]
361
+ },
362
+ meta: {
363
+ schemaVersion: "1.0"
364
+ }
365
+ }
366
+ },
367
+ {
368
+ heading: "Repository(ies)",
369
+ help: "Select repository(ies) you would prefer users to deposit in",
370
+ required: false,
371
+ enabled: false,
372
+ preferences: [],
373
+ content: {
374
+ type: "repositorySearch",
375
+ attributes: {},
376
+ graphQL: {
377
+ query: "query Repositories($term: String, $keywords: [String!], $repositoryType: String, $paginationOptions: PaginationOptions){ repositories(term: $term, keywords: $keywords, repositoryType: $repositoryType, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description website keywords repositoryTypes } } }",
378
+ queryId: 'useRepositoriesQuery',
379
+ displayFields: [
380
+ {
381
+ propertyName: "name",
382
+ label: "Name",
383
+ labelTranslationKey: "RepositorySearch.name"
384
+ },
385
+ {
386
+ propertyName: "description",
387
+ label: "Description",
388
+ labelTranslationKey: "RepositorySearch.description"
389
+ },
390
+ {
391
+ propertyName: "website",
392
+ label: "Website",
393
+ labelTranslationKey: "RepositorySearch.website"
394
+ },
395
+ {
396
+ propertyName: "keywords",
397
+ label: "Subject Areas",
398
+ labelTranslationKey: "RepositorySearch.keywords"
399
+ }
400
+ ],
401
+ answerField: "uri",
402
+ responseField: "repositories.items",
403
+ variables: [
404
+ {
405
+ type: "string",
406
+ name: "term",
407
+ label: "Search for a repository",
408
+ labelTranslationKey: "RepositorySearch.term",
409
+ minLength: 3
410
+ },
411
+ {
412
+ type: "string",
413
+ name: "keywords",
414
+ label: "Subject Areas",
415
+ labelTranslationKey: "RepositorySearch.keywords",
416
+ minLength: 3
417
+ },
418
+ {
419
+ type: "string",
420
+ name: "repositoryType",
421
+ label: "Repository type",
422
+ labelTranslationKey: "RepositorySearch.repositoryType",
423
+ minLength: 3
424
+ },
425
+ {
426
+ type: "OFFSET",
427
+ name: "paginationOptions",
428
+ label: "Pagination Options",
429
+ labelTranslationKey: "PaginationOptions.label"
430
+ }
431
+ ],
432
+ },
433
+ meta: { schemaVersion: "1.0" }
434
+ }
435
+ },
436
+ {
437
+ heading: "Metadata Standard(s)",
438
+ help: "Select metadata standard(s) you would prefer users to use",
439
+ required: false,
440
+ enabled: false,
441
+ preferences: [],
442
+ content: {
443
+ type: "metadataStandardSearch",
444
+ attributes: {},
445
+ graphQL: {
446
+ query: "query MetadataStandards($term: String, $keywords: [String!], $paginationOptions: PaginationOptions){ metadataStandards(term: $term, keywords: $keywords, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description keywords } } }",
447
+ queryId: 'useMetadataStandardsQuery',
448
+ displayFields: [
449
+ {
450
+ propertyName: "name",
451
+ label: "Name",
452
+ labelTranslationKey: "MetadataStandardSearch.name"
453
+ },
454
+ {
455
+ propertyName: "description",
456
+ label: "Description",
457
+ labelTranslationKey: "MetadataStandardSearch.description"
458
+ },
459
+ {
460
+ propertyName: "website",
461
+ label: "Website",
462
+ labelTranslationKey: "MetadataStandardSearch.website"
463
+ },
464
+ {
465
+ propertyName: "keywords",
466
+ label: "Subject Areas",
467
+ labelTranslationKey: "MetadataStandardSearch.keywords"
468
+ }
469
+ ],
470
+ answerField: "uri",
471
+ responseField: "metadataStandards.items",
472
+ variables: [
473
+ {
474
+ type: "string",
475
+ name: "term",
476
+ label: "Search for a metadata standard",
477
+ labelTranslationKey: "MetadataStandardSearch.term",
478
+ minLength: 3
479
+ },
480
+ {
481
+ type: "string",
482
+ name: "keywords",
483
+ label: "Subject Areas",
484
+ labelTranslationKey: "MetadataStandardSearch.keywords",
485
+ minLength: 3
486
+ },
487
+ {
488
+ type: "OFFSET",
489
+ name: "paginationOptions",
490
+ label: "Pagination Options",
491
+ labelTranslationKey: "PaginationOptions.label"
492
+ }
493
+ ],
494
+ },
495
+ meta: { schemaVersion: "1.0" }
496
+ }
497
+ },
498
+ {
499
+ heading: "License",
500
+ help: "Select the license you will apply to the research output",
501
+ required: false,
502
+ enabled: false,
503
+ preferences: [],
504
+ content: {
505
+ type: "licenseSearch",
506
+ attributes: {},
507
+ graphQL: {
508
+ query: "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }",
509
+ queryId: 'useLicensesQuery',
510
+ displayFields: [
511
+ {
512
+ propertyName: "name",
513
+ label: "Name",
514
+ labelTranslationKey: "LicenseSearch.name"
515
+ },
516
+ {
517
+ propertyName: "description",
518
+ label: "Description",
519
+ labelTranslationKey: "LicenseSearch.description"
520
+ },
521
+ {
522
+ propertyName: "recommended",
523
+ label: "Recommended",
524
+ labelTranslationKey: "LicenseSearch.recommended",
525
+ },
526
+ ],
527
+ answerField: "uri",
528
+ responseField: "licenses.items",
529
+ variables: [
530
+ {
531
+ type: "string",
532
+ name: "term",
533
+ label: "Search for a license",
534
+ labelTranslationKey: "LicenseSearch.term",
535
+ minLength: 3
536
+ },
537
+ {
538
+ type: "OFFSET",
539
+ name: "paginationOptions",
540
+ label: "Pagination Options",
541
+ labelTranslationKey: "PaginationOptions.label"
542
+ }
543
+ ],
544
+ },
545
+ meta: { schemaVersion: "1.0" }
546
+ }
547
+ },
548
+ {
549
+ heading: "Custom Column",
550
+ help: "Explanation of what we expect the user to enter.",
551
+ required: false,
552
+ enabled: false,
553
+ content: {
554
+ type: "text",
555
+ attributes: { maxLength: 255 },
556
+ meta: { schemaVersion: "1.0" },
557
+ }
558
+ }
559
+ ]
560
+ };
561
+ (0, globals_1.expect)(tableQuestions_1.DefaultResearchOutputTableQuestion).toEqual(expected);
562
+ });
563
+ (0, globals_1.it)('returns the expected default repositorySearch', () => {
564
+ const expected = {
565
+ type: "repositorySearch",
566
+ attributes: {},
567
+ meta: { schemaVersion: "1.0" },
568
+ graphQL: {
569
+ query: graphQLQuestions_1.repositoryQuery,
570
+ queryId: "useRepositoriesQuery",
571
+ variables: [
572
+ {
573
+ type: "string",
574
+ name: "term",
575
+ label: "Search for a repository",
576
+ labelTranslationKey: "RepositorySearch.term",
577
+ minLength: 3
578
+ },
579
+ {
580
+ type: "string",
581
+ name: "keywords",
582
+ label: "Subject Areas",
583
+ labelTranslationKey: "RepositorySearch.keywords",
584
+ minLength: 3
585
+ },
586
+ {
587
+ type: "string",
588
+ name: "repositoryType",
589
+ label: "Repository type",
590
+ labelTranslationKey: "RepositorySearch.repositoryType",
591
+ minLength: 3
592
+ },
593
+ {
594
+ type: "OFFSET",
595
+ name: "paginationOptions",
596
+ label: "Pagination Options",
597
+ labelTranslationKey: "PaginationOptions.label",
598
+ }
599
+ ],
600
+ responseField: "repositories.items",
601
+ answerField: "uri",
602
+ displayFields: [
603
+ {
604
+ propertyName: "name",
605
+ label: "Name",
606
+ labelTranslationKey: "RepositorySearch.name"
607
+ },
608
+ {
609
+ propertyName: "description",
610
+ label: "Description",
611
+ labelTranslationKey: "RepositorySearch.description"
612
+ },
613
+ {
614
+ propertyName: "website",
615
+ label: "Website",
616
+ labelTranslationKey: "RepositorySearch.website"
617
+ },
618
+ {
619
+ propertyName: "keywords",
620
+ label: "Subject Areas",
621
+ labelTranslationKey: "RepositorySearch.keywords"
622
+ }
623
+ ]
624
+ }
625
+ };
626
+ (0, globals_1.expect)(graphQLQuestions_1.DefaultRepositorySearchQuestion).toEqual(expected);
627
+ });
628
+ (0, globals_1.it)('returns the expected default selectBox', () => {
629
+ const expected = {
630
+ type: "selectBox",
631
+ attributes: { multiple: false },
632
+ meta: { schemaVersion: "1.0" },
633
+ options: [{ label: 'Option A', selected: false, value: 'a' }]
634
+ };
635
+ (0, globals_1.expect)(optionBasedQuestions_1.DefaultSelectBoxQuestion).toEqual(expected);
636
+ });
637
+ (0, globals_1.it)('returns the expected default table', () => {
638
+ const expected = {
639
+ type: "table",
640
+ attributes: {
641
+ canAddRows: true,
642
+ canRemoveRows: true,
643
+ initialRows: 1,
644
+ },
645
+ meta: { schemaVersion: "1.0" },
646
+ columns: [
647
+ {
648
+ heading: "Column A",
649
+ help: 'Enter the value for column A',
650
+ enabled: true,
651
+ required: false,
652
+ content: {
653
+ type: "textArea",
654
+ attributes: {
655
+ label: '',
656
+ cols: 20,
657
+ rows: 2,
658
+ maxLength: 10000,
659
+ asRichText: true,
660
+ },
661
+ meta: { schemaVersion: "1.0" }
662
+ }
663
+ }
664
+ ]
665
+ };
666
+ (0, globals_1.expect)(tableQuestions_1.DefaultTableQuestion).toEqual(expected);
667
+ });
668
+ });
@@ -22,8 +22,9 @@ const optionBasedQuestions_1 = require("../optionBasedQuestions");
22
22
  schemaVersion: "1.0",
23
23
  },
24
24
  attributes: {
25
- checked: true,
26
- },
25
+ label: "Is it true?",
26
+ value: true
27
+ }
27
28
  };
28
29
  (0, globals_1.expect)(() => optionBasedQuestions_1.BooleanQuestionSchema.parse(validBooleanQuestion)).not.toThrow();
29
30
  });