You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

5 years ago
5 years ago
  1. // Rules for project label.
  2. export const colorRules = [
  3. v => !!v || 'Color is required'
  4. ]
  5. export const labelNameRules = [
  6. v => !!v || 'Label name is required',
  7. v => (v && v.length <= 30) || 'Label name must be less than 30 characters'
  8. ]
  9. // Rules for project member.
  10. export const userNameRules = [
  11. v => !!v || 'User name is required',
  12. v => (v && v.length <= 30) || 'User name must be less than 30 characters'
  13. ]
  14. export const roleRules = [
  15. v => !!v || 'Role is required'
  16. ]
  17. // Rules for a project.
  18. export const projectNameRules = [
  19. v => !!v || 'Project name is required',
  20. v => (v && v.length <= 30) || 'Project name must be less than 30 characters'
  21. ]
  22. export const descriptionRules = [
  23. v => !!v || 'Description is required',
  24. v => (v && v.length <= 100) || 'Description must be less than 100 characters'
  25. ]
  26. export const projectTypeRules = [
  27. v => !!v || 'Project type is required'
  28. ]
  29. // Rules for Document.
  30. export const fileFormatRules = [
  31. v => !!v || 'File format is required'
  32. ]
  33. export const uploadFileRules = [
  34. v => !!v || 'File is required',
  35. v => !v || v.size < 1000000 || 'File size should be less than 1 MB!'
  36. ]
  37. // Rules for user.
  38. export const passwordRules = [
  39. v => !!v || 'Password is required',
  40. v => (v && v.length <= 30) || 'Password must be less than 30 characters'
  41. ]