How to use the strapi-helper-plugin.translatedErrors.email 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
inputs: [
      [
        {
          label: {
            id: 'Auth.form.forgot-password.email.label',
          },
          name: 'email',
          type: 'email',
          placeholder: 'Auth.form.forgot-password.email.placeholder',
        },
      ],
    ],
    schema: yup.object({
      email: yup
        .string()
        .email(translatedErrors.email)
        .required(translatedErrors.required),
    }),
  },
  login: {
    endPoint: 'local',
    inputs: [
      [
        {
          label: {
            id: 'Auth.form.login.username.label',
          },
          name: 'identifier',
          type: 'text',
          placeholder: 'Auth.form.login.username.placeholder',
        },
      ],
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / EditView / utils / schema.js View on Github external
if (value === undefined) {
          return true;
        }

        try {
          JSON.parse(value);
          return true;
        } catch (err) {
          return false;
        }
      })
      .nullable();
  }

  if (type === 'email') {
    schema = schema.email(errorsTrads.email);
  }
  if (['number', 'integer', 'biginteger', 'float', 'decimal'].includes(type)) {
    schema = yup
      .number()
      .transform(cv => (isNaN(cv) ? undefined : cv))
      .typeError();
  }
  if (['date', 'datetime'].includes(type)) {
    schema = yup.date();
  }

  Object.keys(validations).forEach(validation => {
    const validationValue = validations[validation];
    if (
      !!validationValue ||
      ((!isBoolean(validationValue) &&
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / EditViewDataManagerProvider / utils / schema.js View on Github external
) {
          return true;
        }

        try {
          JSON.parse(value);
          return true;
        } catch (err) {
          return false;
        }
      })
      .nullable();
  }

  if (type === 'email') {
    schema = schema.email(errorsTrads.email);
  }

  if (['number', 'integer', 'biginteger', 'float', 'decimal'].includes(type)) {
    schema = yup
      .number()
      .transform(cv => (isNaN(cv) ? undefined : cv))
      .typeError();
  }

  if (['date', 'datetime'].includes(type)) {
    schema = yup.date();
  }

  if (type === 'biginteger') {
    schema = yup.string().matches(/^\d*$/);
  }
github strapi / strapi / packages / strapi-admin / admin / src / containers / AuthPage / forms.js View on Github external
],
      [
        {
          label: {
            id: 'Auth.form.register.news.label',
          },
          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),
    }),
  },