Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jun 19, 2024
1 parent 5e8c040 commit c1ccf7e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/app/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as yup from "yup"

export const classIdSchema = yup

Check warning on line 3 in src/app/schemas.ts

View check run for this annotation

Codecov / codecov/patch

src/app/schemas.ts#L3

Added line #L3 was not covered by tests
.string()
.matches(/^[A-Z0-9]{5}$/, "Invalid access code")
.matches(/^[A-Z0-9]{5}$/, "Invalid class code")

const passwordSchema = yup.string().required("required")

Check warning on line 7 in src/app/schemas.ts

View check run for this annotation

Codecov / codecov/patch

src/app/schemas.ts#L7

Added line #L7 was not covered by tests

Expand All @@ -23,7 +23,6 @@ export const studentPasswordSchema = passwordSchema.test({
test: password => password.length >= 6,

Check warning on line 23 in src/app/schemas.ts

View check run for this annotation

Codecov / codecov/patch

src/app/schemas.ts#L23

Added line #L23 was not covered by tests
})

// TODO: make indy password schema the same as teacher's.
export const indyPasswordSchema = passwordSchema.test({

Check warning on line 26 in src/app/schemas.ts

View check run for this annotation

Codecov / codecov/patch

src/app/schemas.ts#L26

Added line #L26 was not covered by tests
message: "too-weak",
test: password =>

Check warning on line 28 in src/app/schemas.ts

View check run for this annotation

Codecov / codecov/patch

src/app/schemas.ts#L28

Added line #L28 was not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions src/pages/login/studentForms/Class.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const Class: FC<ClassProps> = () => {
>
<form.TextField
name="classId"
label="Access code"
placeholder="Enter your access code"
label="Class code"
placeholder="Enter your class code"
schema={classIdSchema}
required
/>
Expand Down
8 changes: 2 additions & 6 deletions src/pages/login/studentForms/FirstName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const FirstName: FC<FirstNameProps> = () => {
{
props: {
error: true,
children: "Please provide a valid access code for your class.",
children: "Please provide the correct code for your class.",
},
},
],
Expand All @@ -60,11 +60,7 @@ const FirstName: FC<FirstNameProps> = () => {
},
})}
>
<form.FirstNameField
label="Username"
placeholder="Enter your username"
required
/>
<form.FirstNameField required />
<form.PasswordField required />
<Stack alignItems="end">
<form.SubmitButton endIcon={<ChevronRightIcon />}>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/login/teacherForms/OtpBypassToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const OtpBypassToken: FC<OtpBypassTokenProps> = () => {
return useSession(

Check warning on line 21 in src/pages/login/teacherForms/OtpBypassToken.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/login/teacherForms/OtpBypassToken.tsx#L21

Added line #L21 was not covered by tests
<BaseForm
themedBoxProps={{ userType: "teacher" }}
header="Login as a teacher"
header="Welcome"
initialValues={{ token: "" }}
onSubmit={submitForm(loginWithOtpBypassToken, {
then: () => {
Expand All @@ -34,7 +34,6 @@ const OtpBypassToken: FC<OtpBypassTokenProps> = () => {
have been generated for you to print and keep safe. Please enter one of
these backup tokens to login to your account.
</Typography>
<Typography fontWeight="bold">Token:</Typography>
<form.TextField
name="token"
label="OTP-bypass token"
Expand Down

0 comments on commit c1ccf7e

Please sign in to comment.