-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What this does Upgrade tn-forms in clients and add lock files for R and R.
- Loading branch information
Showing
11 changed files
with
31,074 additions
and
206 deletions.
There are no files selected for viewing
20,136 changes: 20,136 additions & 0 deletions
20,136
{{cookiecutter.project_slug}}/clients/mobile/react-native/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
{{cookiecutter.project_slug}}/clients/mobile/react-native/src/components/errors.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
{{cookiecutter.project_slug}}/clients/mobile/react-native/src/components/text-form-field.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
342 changes: 171 additions & 171 deletions
342
{{cookiecutter.project_slug}}/clients/mobile/react-native/src/services/user/forms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,171 +1,171 @@ | ||
import Form, { | ||
EmailValidator, | ||
FormField, | ||
IFormField, | ||
MinLengthValidator, | ||
RequiredValidator, | ||
} from '@thinknimble/tn-forms' | ||
export type AccountFormInputs = { | ||
firstName: IFormField<string> | ||
lastName: IFormField<string> | ||
email: IFormField<string> | ||
password: IFormField<string> | ||
confirmPassword: IFormField<string> | ||
} | ||
export type AccountFormValues = { | ||
/** | ||
* HACK - PB - 2023-05-10 | ||
* Temporary hack to get the fields because the form returns all field values as <T> | undefined | ||
*/ | ||
firstName: string | ||
lastName: string | ||
email: string | ||
password: string | ||
confirmPassword: string | ||
} | ||
export class AccountForm extends Form<AccountFormInputs> { | ||
static firstName = FormField.create({ | ||
label: 'First name', | ||
placeholder: 'First Name', | ||
type: 'text', | ||
validators: [new RequiredValidator({ message: 'Please enter your first' })], | ||
value: '', | ||
}) | ||
|
||
static lastName = FormField.create({ | ||
label: 'Last Name', | ||
placeholder: 'Last Name', | ||
type: 'text', | ||
validators: [new RequiredValidator({ message: 'Please enter your last name' })], | ||
value: '', | ||
}) | ||
|
||
static email = FormField.create({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
value: '', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
|
||
static password = FormField.create({ | ||
label: 'Password', | ||
placeholder: 'Password', | ||
type: 'password', | ||
|
||
validators: [ | ||
new MinLengthValidator({ | ||
minLength: 6, | ||
message: 'Please enter a password with a minimum of six characters', | ||
}), | ||
], | ||
value: '', | ||
}) | ||
|
||
static confirmPassword = FormField.create({ | ||
label: 'Confirm Password', | ||
placeholder: 'Confirm Password', | ||
type: 'password', | ||
value: '', | ||
validators: [], | ||
}) | ||
} | ||
export type TAccountForm = AccountForm & AccountFormInputs | ||
export type EmailForgotPasswordInput = { | ||
email: IFormField<string> | ||
} | ||
export class EmailForgotPasswordForm extends Form<EmailForgotPasswordInput> { | ||
static email = FormField.create({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
} | ||
export type TEmailForgotPasswordForm = EmailForgotPasswordForm & EmailForgotPasswordInput | ||
export type ResetPasswordInput = { | ||
email: IFormField<string> | ||
code: IFormField<string> | ||
password: IFormField<string> | ||
confirmPassword: IFormField<string> | ||
} | ||
export class ResetPasswordForm extends Form<ResetPasswordInput> { | ||
static email = new FormField({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
static code = new FormField({ | ||
placeholder: 'Verification Code', | ||
type: 'number', | ||
validators: [ | ||
new MinLengthValidator({ message: 'Please enter a valid 5 digit code', minLength: 5 }), | ||
], | ||
}) | ||
static password = FormField.create({ | ||
label: 'Password', | ||
placeholder: 'Password', | ||
type: 'password', | ||
|
||
validators: [ | ||
new MinLengthValidator({ | ||
minLength: 6, | ||
message: 'Please enter a password with at least 6 characters', | ||
}), | ||
], | ||
value: '', | ||
}) | ||
|
||
static confirmPassword = FormField.create({ | ||
label: 'Confirm Password', | ||
placeholder: 'Confirm Password', | ||
type: 'password', | ||
value: '', | ||
validators: [], | ||
}) | ||
} | ||
export type TResetPasswordForm = ResetPasswordForm & ResetPasswordInput | ||
export type LoginFormInputs = { | ||
email: IFormField<string> | ||
confirmEmail: IFormField<string> | ||
password: IFormField<string> | ||
} | ||
export type TLoginForm = LoginFormInputs & LoginForm | ||
export class LoginForm extends Form<LoginFormInputs> { | ||
static email = new FormField({ | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
static password = new FormField({ | ||
validators: [new RequiredValidator({ message: 'Please enter your password' })], | ||
placeholder: 'Password', | ||
value: '', | ||
type: 'password', | ||
}) | ||
} | ||
export type ForgotPasswordInput = { | ||
email: IFormField<string> | ||
} | ||
export class ForgotPasswordForm extends Form<ForgotPasswordInput> { | ||
static email = new FormField({ | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
} | ||
export type TForgotPasswordForm = ForgotPasswordForm & ForgotPasswordInput | ||
import { | ||
Form, | ||
EmailValidator, | ||
FormField, | ||
IFormField, | ||
MinLengthValidator, | ||
RequiredValidator, | ||
} from '@thinknimble/tn-forms' | ||
|
||
export type AccountFormInputs = { | ||
firstName: IFormField<string> | ||
lastName: IFormField<string> | ||
email: IFormField<string> | ||
password: IFormField<string> | ||
confirmPassword: IFormField<string> | ||
} | ||
export type AccountFormValues = { | ||
/** | ||
* HACK - PB - 2023-05-10 | ||
* Temporary hack to get the fields because the form returns all field values as <T> | undefined | ||
*/ | ||
firstName: string | ||
lastName: string | ||
email: string | ||
password: string | ||
confirmPassword: string | ||
} | ||
export class AccountForm extends Form<AccountFormInputs> { | ||
static firstName = FormField.create({ | ||
label: 'First name', | ||
placeholder: 'First Name', | ||
type: 'text', | ||
validators: [new RequiredValidator({ message: 'Please enter your first' })], | ||
value: '', | ||
}) | ||
|
||
static lastName = FormField.create({ | ||
label: 'Last Name', | ||
placeholder: 'Last Name', | ||
type: 'text', | ||
validators: [new RequiredValidator({ message: 'Please enter your last name' })], | ||
value: '', | ||
}) | ||
|
||
static email = FormField.create({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
value: '', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
|
||
static password = FormField.create({ | ||
label: 'Password', | ||
placeholder: 'Password', | ||
type: 'password', | ||
|
||
validators: [ | ||
new MinLengthValidator({ | ||
minLength: 6, | ||
message: 'Please enter a password with a minimum of six characters', | ||
}), | ||
], | ||
value: '', | ||
}) | ||
|
||
static confirmPassword = FormField.create({ | ||
label: 'Confirm Password', | ||
placeholder: 'Confirm Password', | ||
type: 'password', | ||
value: '', | ||
validators: [], | ||
}) | ||
} | ||
export type TAccountForm = AccountForm & AccountFormInputs | ||
|
||
export type EmailForgotPasswordInput = { | ||
email: IFormField<string> | ||
} | ||
|
||
export class EmailForgotPasswordForm extends Form<EmailForgotPasswordInput> { | ||
static email = FormField.create({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
} | ||
|
||
export type TEmailForgotPasswordForm = EmailForgotPasswordForm & EmailForgotPasswordInput | ||
|
||
export type ResetPasswordInput = { | ||
email: IFormField<string> | ||
code: IFormField<string> | ||
password: IFormField<string> | ||
confirmPassword: IFormField<string> | ||
} | ||
|
||
export class ResetPasswordForm extends Form<ResetPasswordInput> { | ||
static email = new FormField({ | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
static code = new FormField({ | ||
placeholder: 'Verification Code', | ||
type: 'number', | ||
validators: [ | ||
new MinLengthValidator({ message: 'Please enter a valid 5 digit code', minLength: 5 }), | ||
], | ||
}) | ||
static password = FormField.create({ | ||
label: 'Password', | ||
placeholder: 'Password', | ||
type: 'password', | ||
|
||
validators: [ | ||
new MinLengthValidator({ | ||
minLength: 6, | ||
message: 'Please enter a password with at least 6 characters', | ||
}), | ||
], | ||
value: '', | ||
}) | ||
|
||
static confirmPassword = FormField.create({ | ||
label: 'Confirm Password', | ||
placeholder: 'Confirm Password', | ||
type: 'password', | ||
value: '', | ||
validators: [], | ||
}) | ||
} | ||
|
||
export type TResetPasswordForm = ResetPasswordForm & ResetPasswordInput | ||
|
||
export type LoginFormInputs = { | ||
email: IFormField<string> | ||
confirmEmail: IFormField<string> | ||
password: IFormField<string> | ||
} | ||
export type TLoginForm = LoginFormInputs & LoginForm | ||
|
||
export class LoginForm extends Form<LoginFormInputs> { | ||
static email = new FormField({ | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
static password = new FormField({ | ||
validators: [new RequiredValidator({ message: 'Please enter your password' })], | ||
placeholder: 'Password', | ||
value: '', | ||
type: 'password', | ||
}) | ||
} | ||
|
||
export type ForgotPasswordInput = { | ||
email: IFormField<string> | ||
} | ||
|
||
export class ForgotPasswordForm extends Form<ForgotPasswordInput> { | ||
static email = new FormField({ | ||
placeholder: 'Email', | ||
type: 'emailAddress', | ||
validators: [new EmailValidator({ message: 'Please enter a valid email' })], | ||
}) | ||
} | ||
|
||
export type TForgotPasswordForm = ForgotPasswordForm & ForgotPasswordInput |
Oops, something went wrong.