mirror of https://github.com/doccano/doccano.git
Collin Brown
4 years ago
3 changed files with 48 additions and 48 deletions
Unified View
Diff Options
@ -1,38 +1,38 @@ |
|||||
export default { |
export default { |
||||
colorRules: { |
colorRules: { |
||||
rule1: 'Color is required' |
|
||||
|
colorRequired: 'Color is required' |
||||
}, |
}, |
||||
labelNameRules: { |
labelNameRules: { |
||||
rule1: 'Label name is required', |
|
||||
rule2: 'Label name must be less than 30 characters' |
|
||||
|
labelRequied: 'Label name is required', |
||||
|
labelLessThan30Chars: 'Label name must be less than 30 characters' |
||||
}, |
}, |
||||
userNameRules: { |
userNameRules: { |
||||
rule1: 'User name is required', |
|
||||
rule2: 'User name must be less than 30 characters' |
|
||||
|
userNameRequired: 'User name is required', |
||||
|
userNameLessThan30Chars: 'User name must be less than 30 characters' |
||||
}, |
}, |
||||
roleRules: { |
roleRules: { |
||||
rule1: 'Role is required' |
|
||||
|
roleRequired: 'Role is required' |
||||
}, |
}, |
||||
projectNameRules: { |
projectNameRules: { |
||||
rule1: 'Project name is required', |
|
||||
rule2: 'Project name must be less than 30 characters' |
|
||||
|
projectNameRequired: 'Project name is required', |
||||
|
projectNameLessThan30Chars: 'Project name must be less than 30 characters' |
||||
}, |
}, |
||||
descriptionRules: { |
descriptionRules: { |
||||
rule1: 'Description is required', |
|
||||
rule2: 'Description must be less than 100 characters' |
|
||||
|
descriptionRequired: 'Description is required', |
||||
|
descriptionLessThan30Chars: 'Description must be less than 100 characters' |
||||
}, |
}, |
||||
projectTypeRules: { |
projectTypeRules: { |
||||
rule1: 'Project type is required' |
|
||||
|
projectTypeRequired: 'Project type is required' |
||||
}, |
}, |
||||
fileFormatRules: { |
fileFormatRules: { |
||||
rule1: 'File format is required' |
|
||||
|
fileFormatRequired: 'File format is required' |
||||
}, |
}, |
||||
uploadFileRules: { |
uploadFileRules: { |
||||
rule1: 'File is required', |
|
||||
rule2: 'File size should be less than 1 MB!' |
|
||||
|
fileRequired: 'File is required', |
||||
|
fileLessThan1MB: 'File size should be less than 1 MB!' |
||||
}, |
}, |
||||
passwordRules: { |
passwordRules: { |
||||
rule1: 'Password is required', |
|
||||
rule2: 'Password must be less than 30 characters' |
|
||||
|
passwordRequired: 'Password is required', |
||||
|
passwordLessThan30Chars: 'Password must be less than 30 characters' |
||||
} |
} |
||||
} |
} |
@ -1,38 +1,38 @@ |
|||||
export default { |
export default { |
||||
colorRules: { |
colorRules: { |
||||
rule1: 'La couleur est obligatoire' |
|
||||
|
colorRequired: 'La couleur est obligatoire' |
||||
}, |
}, |
||||
labelNameRules: { |
labelNameRules: { |
||||
rule1: 'Le nom de l\'étiquette est obligatoire', |
|
||||
rule2: 'Le nom de l\'étiquette doit comporter moins de 30 caractères' |
|
||||
|
labelRequied: 'Le nom de l\'étiquette est obligatoire', |
||||
|
labelLessThan30Chars: 'Le nom de l\'étiquette doit comporter moins de 30 caractères' |
||||
}, |
}, |
||||
userNameRules: { |
userNameRules: { |
||||
rule1: 'Le nom d\'utilisateur est requis', |
|
||||
rule2: 'Le nom d\'utilisateur doit comporter moins de 30 caractères' |
|
||||
|
userNameRequired: 'Le nom d\'utilisateur est requis', |
||||
|
userNameLessThan30Chars: 'Le nom d\'utilisateur doit comporter moins de 30 caractères' |
||||
}, |
}, |
||||
roleRules: { |
roleRules: { |
||||
rule1: 'Rôle est obligatoire' |
|
||||
|
roleRequired: 'Rôle est obligatoire' |
||||
}, |
}, |
||||
projectNameRules: { |
projectNameRules: { |
||||
rule1: 'Le nom du projet est requis', |
|
||||
rule2: 'Le nom du projet doit comporter moins de 30 caractères' |
|
||||
|
projectNameRequired: 'Le nom du projet est requis', |
||||
|
projectNameLessThan30Chars: 'Le nom du projet doit comporter moins de 30 caractères' |
||||
}, |
}, |
||||
descriptionRules: { |
descriptionRules: { |
||||
rule1: 'Une description est requise', |
|
||||
rule2: 'La description doit comporter moins de 100 caractères' |
|
||||
|
descriptionRequired: 'Une description est requise', |
||||
|
descriptionLessThan30Chars: 'La description doit comporter moins de 100 caractères' |
||||
}, |
}, |
||||
projectTypeRules: { |
projectTypeRules: { |
||||
rule1: 'Le type de projet est requis' |
|
||||
|
projectTypeRequired: 'Le type de projet est requis' |
||||
}, |
}, |
||||
fileFormatRules: { |
fileFormatRules: { |
||||
rule1: 'Le format de fichier est requis' |
|
||||
|
fileFormatRequired: 'Le format de fichier est requis' |
||||
}, |
}, |
||||
uploadFileRules: { |
uploadFileRules: { |
||||
rule1: 'Le fichier est obligatoire', |
|
||||
rule2: 'La taille du fichier doit être inférieure à 1MB' |
|
||||
|
fileRequired: 'Le fichier est obligatoire', |
||||
|
fileLessThan1MB: 'La taille du fichier doit être inférieure à 1MB' |
||||
}, |
}, |
||||
passwordRules: { |
passwordRules: { |
||||
rule1: 'Le mot de passe est obligatoire', |
|
||||
rule2: 'Le mot de passe doit comporter moins de 30 caractères' |
|
||||
|
passwordRequired: 'Le mot de passe est obligatoire', |
||||
|
passwordLessThan30Chars: 'Le mot de passe doit comporter moins de 30 caractères' |
||||
} |
} |
||||
} |
} |
@ -1,70 +1,70 @@ |
|||||
// Rules for project label.
|
// Rules for project label.
|
||||
export const colorRules = (msg) => { |
export const colorRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1 |
|
||||
|
v => !!v || msg.colorRequired |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
export const labelNameRules = (msg) => { |
export const labelNameRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => (v && v.length <= 30) || msg.rule2 |
|
||||
|
v => !!v || msg.labelRequired, |
||||
|
v => (v && v.length <= 30) || msg.labelLessThan30Chars |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
// Rules for project member.
|
// Rules for project member.
|
||||
export const userNameRules = (msg) => { |
export const userNameRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => (v && v.length <= 30) || msg.rule2 |
|
||||
|
v => !!v || msg.userNameRequired, |
||||
|
v => (v && v.length <= 30) || msg.userNameLessThan30Chars |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
export const roleRules = (msg) => { |
export const roleRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1 |
|
||||
|
v => !!v || msg.roleRequired |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
// Rules for a project.
|
// Rules for a project.
|
||||
export const projectNameRules = (msg) => { |
export const projectNameRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => (v && v.length <= 30) || msg.rule2 |
|
||||
|
v => !!v || msg.projectNameRequired, |
||||
|
v => (v && v.length <= 30) || msg.projectNameLessThan30Chars |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
export const descriptionRules = (msg) => { |
export const descriptionRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => (v && v.length <= 100) || msg.rule2 |
|
||||
|
v => !!v || msg.descriptionRequired, |
||||
|
v => (v && v.length <= 100) || msg.descriptionLessThan30Chars |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
export const projectTypeRules = (msg) => { |
export const projectTypeRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1 |
|
||||
|
v => !!v || msg.projectTypeRequired |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
// Rules for Document.
|
// Rules for Document.
|
||||
export const fileFormatRules = (msg) => { |
export const fileFormatRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1 |
|
||||
|
v => !!v || msg.fileFormatRequired |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
export const uploadFileRules = (msg) => { |
export const uploadFileRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => !v || v.size < 1000000 || msg.rule2 |
|
||||
|
v => !!v || msg.fileRequired, |
||||
|
v => !v || v.size < 1000000 || msg.fileLessThan1MB |
||||
] |
] |
||||
} |
} |
||||
|
|
||||
// Rules for user.
|
// Rules for user.
|
||||
export const passwordRules = (msg) => { |
export const passwordRules = (msg) => { |
||||
return [ |
return [ |
||||
v => !!v || msg.rule1, |
|
||||
v => (v && v.length <= 30) || msg.rule2 |
|
||||
|
v => !!v || msg.passwordRequired, |
||||
|
v => (v && v.length <= 30) || msg.passwordLessThan30Chars |
||||
] |
] |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save