Skip to content

Commit c0c0978

Browse files
committed
Console warns: My Account
1 parent 1712f03 commit c0c0978

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

src/app/components/elements/inputs/GenderInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ export const GenderInput = ({className, userToUpdate, setUserToUpdate, submissio
3333
</p>
3434
<StyledDropdown
3535
id={`${idPrefix}-gender-select`}
36-
value={userToUpdate && userToUpdate.gender}
36+
value={userToUpdate && userToUpdate.gender || "UNKNOWN"}
3737
invalid={submissionAttempted && required && !validateUserGender(userToUpdate)}
3838
onChange={(e: ChangeEvent<HTMLInputElement>) =>
3939
setUserToUpdate(Object.assign({}, userToUpdate, {gender: e.target.value}))
4040
}
4141
>
42-
<option value="UNKNOWN" selected disabled hidden></option>
42+
<option value="UNKNOWN" disabled hidden></option>
4343
<option value="FEMALE">Female</option>
4444
<option value="MALE">Male</option>
4545
<option value="OTHER">Other gender identity</option>

src/app/components/elements/inputs/StyledCheckbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import classNames from "classnames";
1010

1111
export const StyledCheckbox = (props: InputProps & {partial?: boolean}) => {
1212

13-
const {label, ignoreLabelHover, className, bsSize, partial, ...rest} = props;
13+
const {label, ignoreLabelHover, className, bsSize, partial, invalid, ...rest} = props;
1414

1515
const [checked, setChecked] = useState(props.checked ?? false);
1616
const id = useMemo(() => {return (props.id ?? "") + "-" + v4();}, [props.id]);
@@ -24,7 +24,7 @@ export const StyledCheckbox = (props: InputProps & {partial?: boolean}) => {
2424
setChecked(props.checked ?? false);
2525
}, [props.checked]);
2626

27-
return <div className={classNames("styled-checkbox-wrapper", {"is-invalid": props.invalid, "checkbox-small": bsSize === "sm"})}>
27+
return <div className={classNames("styled-checkbox-wrapper", {"is-invalid": invalid, "checkbox-small": bsSize === "sm"})}>
2828
<div className={classNames({"me-2 my-2": label})}>
2929
{isAda && checked && <div className="tick"/>}
3030
<input {...rest} id={id} type="checkbox" className={classNames(className ?? "", "d-block", {"checked": checked, "icon-checkbox-off": !partial && !checked, "icon-checkbox-selected": !partial && checked})}

src/app/components/elements/inputs/TogglablePasswordInput.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ interface TogglablePasswordInputProps extends InputProps {
88
export const TogglablePasswordInput = (props: TogglablePasswordInputProps) => {
99
const [showPassword, setShowPassword] = useState(false);
1010

11+
const {feedbackText, ...rest} = props;
12+
1113
return <InputGroup>
1214
<Input
13-
{...props}
15+
{...rest}
1416
type={showPassword ? "text" : "password"}
1517
/>
1618
<button type="button" tabIndex={-1} className="inline-form-input-btn" onClick={() => {setShowPassword(!showPassword);}}>
1719
{showPassword ? "Hide" : "Show"}
1820
</button>
1921
<FormFeedback>
20-
{props.feedbackText ?? "Please enter a valid password."}
22+
{feedbackText ?? "Please enter a valid password."}
2123
</FormFeedback>
2224
</InputGroup>;
2325
};

src/app/components/elements/layout/SidebarLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,8 +1013,8 @@ interface MyAccountSidebarProps extends SidebarProps {
10131013
}
10141014

10151015
export const MyAccountSidebar = (props: MyAccountSidebarProps) => {
1016-
const { editingOtherUser, activeTab, setActiveTab } = props;
1017-
return <ContentSidebar buttonTitle="Account settings" {...props}>
1016+
const { editingOtherUser, activeTab, setActiveTab, ...rest } = props;
1017+
return <ContentSidebar buttonTitle="Account settings" {...rest}>
10181018
<div className="section-divider mt-0"/>
10191019
<h5>Account settings</h5>
10201020
{ACCOUNT_TABS.filter(tab => !tab.hidden && !(editingOtherUser && tab.hiddenIfEditingOtherUser)).map(({tab, title}) =>

src/app/components/elements/panels/TeacherConnections.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const TeacherConnections = ({user, authToken, editingOtherUser, userToEdi
188188
</h3>
189189
<p>Enter the code given by your teacher to create a teacher connection and join a group.</p>
190190
{/* TODO Need to handle nested form complaint */}
191-
<Form onSubmit={processToken} data-testid="teacher-connect-form">
191+
<div data-testid="teacher-connect-form">
192192
<InputGroup className={"separate-input-group mb-4 d-flex flex-row justify-content-center"}>
193193
<Input
194194
type="text" placeholder="Enter your code in here" value={authToken || undefined} className="py-4"
@@ -202,7 +202,7 @@ export const TeacherConnections = ({user, authToken, editingOtherUser, userToEdi
202202
Connect
203203
</Button>
204204
</InputGroup>
205-
</Form>
205+
</div>
206206

207207
<div className="connect-list" data-testid="teacher-connections">
208208
<ConnectionsHeader

src/app/components/elements/panels/UserPassword.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@ export const UserPassword = (
174174
<h4>Linked {siteSpecific("Accounts", "accounts")}</h4>
175175
<Col>
176176
{connectedAccounts.map((provider) => {
177-
return authButtonsMap[provider](true);
177+
return <React.Fragment key={provider}>{authButtonsMap[provider](true)}</React.Fragment>;
178178
})}
179179
</Col>
180180
</FormGroup>}
181181
{unconnectedAccounts.length > 0 && <FormGroup className="form-group">
182182
<h4>Link other accounts</h4>
183183
<Col>
184184
{unconnectedAccounts.map((provider) => {
185-
return authButtonsMap[provider](false);
185+
return <React.Fragment key={provider}>{authButtonsMap[provider](false)}</React.Fragment>;
186186
})}
187187
</Col>
188188
</FormGroup>}

0 commit comments

Comments
 (0)