- added LicenseController.ts and MimetypeController for enabling mime_types and licences
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
- add new authors and contributors only by unique email addresses - allow multiple file upload - added validation rule for validating length of uploaded files - modified Dockerfile for starting "bin/server.js" instead of *server.js" - npm updates
This commit is contained in:
parent
770e791613
commit
ac473b1e72
27 changed files with 1720 additions and 914 deletions
|
@ -216,18 +216,24 @@ export default class DatasetController {
|
|||
authors: vine
|
||||
.array(
|
||||
vine.object({
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail(),
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail().isUniquePerson({ table: 'persons', column: 'email', idField: 'id' }),
|
||||
first_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
last_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
}),
|
||||
)
|
||||
.minLength(1),
|
||||
.minLength(1)
|
||||
.distinct('email'),
|
||||
contributors: vine
|
||||
.array(
|
||||
vine.object({
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail(),
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail().isUniquePerson({ table: 'persons', column: 'email', idField: 'id' }),
|
||||
first_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
last_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
pivot_contributor_type: vine.enum(Object.keys(ContributorTypes)),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
.distinct('email')
|
||||
.optional(),
|
||||
project_id: vine.number().optional(),
|
||||
});
|
||||
|
||||
|
@ -287,18 +293,24 @@ export default class DatasetController {
|
|||
authors: vine
|
||||
.array(
|
||||
vine.object({
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail(),
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail().isUniquePerson({ table: 'persons', column: 'email', idField: 'id' }),
|
||||
first_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
last_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
}),
|
||||
)
|
||||
.minLength(1),
|
||||
.minLength(1)
|
||||
.distinct('email'),
|
||||
contributors: vine
|
||||
.array(
|
||||
vine.object({
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail(),
|
||||
email: vine.string().trim().maxLength(255).email().normalizeEmail().isUniquePerson({ table: 'persons', column: 'email', idField: 'id' }),
|
||||
first_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
last_name: vine.string().trim().minLength(3).maxLength(255),
|
||||
pivot_contributor_type: vine.enum(Object.keys(ContributorTypes)),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
.distinct('email')
|
||||
.optional(),
|
||||
// third step
|
||||
project_id: vine.number().optional(),
|
||||
// embargo_date: schema.date.optional({ format: 'yyyy-MM-dd' }, [rules.after(10, 'days')]),
|
||||
|
@ -631,7 +643,9 @@ export default class DatasetController {
|
|||
'The language of the translated description must be different from the language of the dataset',
|
||||
|
||||
'authors.array.minLength': 'at least {{ min }} author must be defined',
|
||||
'authors.distinct': 'The {{ field }} array must have unique values based on the {{ fields }} attribute.',
|
||||
'contributors.*.pivot_contributor_type.required': 'contributor type is required, if defined',
|
||||
'contributors.distinct': 'The {{ field }} array must have unique values based on the {{ fields }} attribute.',
|
||||
|
||||
'after': `{{ field }} must be older than ${dayjs().add(10, 'day')}`,
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue