-
Notifications
You must be signed in to change notification settings - Fork 2
Panel judging opt in #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Panel judging opt in #343
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,10 +11,9 @@ import hackerStyles from './HackerAuthForm.module.scss'; | |
| import judgeStyles from './JudgeAuthForm.module.scss'; | ||
|
|
||
| type Role = 'hacker' | 'judge'; | ||
| type FieldName = 'email' | 'password' | 'passwordDupe' | 'code'; | ||
|
|
||
| interface FormField { | ||
| name: FieldName; | ||
| name: string; | ||
| type: string; | ||
| label: string; | ||
| placeholder?: string; | ||
|
|
@@ -27,8 +26,8 @@ interface AuthFormProps { | |
| buttonText: string; | ||
| linkText?: string; | ||
| linkHref?: string; | ||
| initialValues: Record<string, string>; | ||
| onSubmit: (values: Record<string, string>) => Promise<any>; | ||
| initialValues: Record<string, any>; | ||
| onSubmit: (values: Record<string, any>) => Promise<any>; | ||
| onSuccess: () => void; | ||
| } | ||
|
|
||
|
|
@@ -68,17 +67,27 @@ export default function AuthForm({ | |
| <p className={styles.error_msg}>{errors[field.name]}</p> | ||
| <div className={styles.input_container}> | ||
| <label htmlFor={field.name}>{field.label}</label> | ||
| <input | ||
| name={field.name} | ||
| type={field.type} | ||
| placeholder={field.placeholder} | ||
| value={formValues[field.name] || ''} | ||
| onInput={handleChange} | ||
| readOnly={field.readOnly} | ||
| style={{ | ||
| cursor: field.readOnly ? 'not-allowed' : 'auto', | ||
| }} | ||
| /> | ||
| {field.type === 'checkbox' ? ( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a frontend example of this? just curious how it looks. Maybe during tmr (10/27) meeting you can briefly share. |
||
| <input | ||
| name={field.name} | ||
| type="checkbox" | ||
| checked={!!formValues[field.name]} | ||
| onChange={handleChange} | ||
| readOnly={field.readOnly} | ||
| /> | ||
| ) : ( | ||
| <input | ||
| name={field.name} | ||
| type={field.type} | ||
| placeholder={field.placeholder} | ||
| value={formValues[field.name] || ''} | ||
| onInput={handleChange} | ||
| readOnly={field.readOnly} | ||
| style={{ | ||
| cursor: field.readOnly ? 'not-allowed' : 'auto', | ||
| }} | ||
| /> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ))} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import User from './user'; | |
| interface Panel { | ||
| _id?: string; | ||
| track: string; | ||
| domain: string; | ||
| domain?: string; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In response to your pr description, yeah I'm not too sure either why "Best Hack for Social Good" doesn't have a domain. It was also not in the admin panel judging view and we had to judge it ourselves last year, not sure if that was intentional - may need to check with Jay or someone last year about that. |
||
| user_ids: string[]; | ||
| users?: User[]; // populated by aggregation | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why FieldName is no longer needed?