How to use the strapi-helper-plugin.translatedErrors.minLength function in strapi-helper-plugin

To help you get started, we’ve selected a few strapi-helper-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi-admin / admin / src / containers / AuthPage / forms.js View on Github external
},
          name: 'news',
          type: 'checkbox',
          value: false,
        },
      ],
    ],
    schema: yup.object({
      email: yup
        .string()
        .email(translatedErrors.email)
        .required(translatedErrors.required),
      username: yup.string().required(translatedErrors.required),
      password: yup
        .string()
        .min(6, translatedErrors.minLength)
        .required(translatedErrors.required),
      passwordConfirmation: yup
        .string()
        .min(6, translatedErrors.minLength)
        .oneOf(
          [yup.ref('password'), null],
          'components.Input.error.password.noMatch'
        )
        .required(translatedErrors.required),
    }),
  },
  'reset-password': {
    endPoint: 'reset-password',
    inputs: [
      [
        {
github strapi / strapi / packages / strapi-admin / admin / src / containers / AuthPage / forms.js View on Github external
},
      ],
    ],
    schema: yup.object({
      email: yup
        .string()
        .email(translatedErrors.email)
        .required(translatedErrors.required),
      username: yup.string().required(translatedErrors.required),
      password: yup
        .string()
        .min(6, translatedErrors.minLength)
        .required(translatedErrors.required),
      passwordConfirmation: yup
        .string()
        .min(6, translatedErrors.minLength)
        .oneOf(
          [yup.ref('password'), null],
          'components.Input.error.password.noMatch'
        )
        .required(translatedErrors.required),
    }),
  },
  'reset-password': {
    endPoint: 'reset-password',
    inputs: [
      [
        {
          name: 'password',
          type: 'password',
          label: {
            id: 'Auth.form.register.password.label',
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / EditViewDataManagerProvider / utils / schema.js View on Github external
}
          break;
        }
        case 'maxLength':
          schema = schema.max(validationValue, errorsTrads.maxLength);
          break;
        case 'min': {
          if (type === 'biginteger') {
            schema = schema.isSuperior(errorsTrads.min, validationValue);
          } else {
            schema = schema.min(validationValue, errorsTrads.min);
          }
          break;
        }
        case 'minLength':
          schema = schema.min(validationValue, errorsTrads.minLength);
          break;
        case 'regex':
          schema = schema.matches(validationValue, errorsTrads.regex);
          break;
        case 'lowercase':
          if (['text', 'textarea', 'email', 'string'].includes(type)) {
            schema = schema.strict().lowercase();
          }
          break;
        case 'uppercase':
          if (['text', 'textarea', 'email', 'string'].includes(type)) {
            schema = schema.strict().uppercase();
          }
          break;
        case 'positive':
          if (
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / EditView / utils / schema.js View on Github external
) {
      switch (validation) {
        case 'required':
          schema = schema.required(errorsTrads.required);
          break;
        case 'max':
          schema = schema.max(validationValue, errorsTrads.max);
          break;
        case 'maxLength':
          schema = schema.max(validationValue, errorsTrads.maxLength);
          break;
        case 'min':
          schema = schema.min(validationValue, errorsTrads.min);
          break;
        case 'minLength':
          schema = schema.min(validationValue, errorsTrads.minLength);
          break;
        case 'regex':
          schema = schema.matches(validationValue, errorsTrads.regex);
          break;
        case 'lowercase':
          if (['text', 'textarea', 'email', 'string'].includes(type)) {
            schema = schema.strict().lowercase();
          }
          break;
        case 'uppercase':
          if (['text', 'textarea', 'email', 'string'].includes(type)) {
            schema = schema.strict().uppercase();
          }
          break;
        case 'positive':
          if (