Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions web-ui/src/components/team-results/EditTeamModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Checkbox from '@mui/material/Checkbox';
import Autocomplete from '@mui/material/Autocomplete';
import './EditTeamModal.css';

const EditTeamModal = ({ team = {}, open, onSave, onClose, headerText }) => {
const EditTeamModal = ({ team = {active: true}, open, onSave, onClose, headerText }) => {
const { state } = useContext(AppContext);
const currentMembers = selectCurrentMembers(state);
const currentUser = selectCurrentUser(state);
Expand Down Expand Up @@ -158,7 +158,7 @@ const EditTeamModal = ({ team = {}, open, onSave, onClose, headerText }) => {

const close = () => {
onClose();
setTeam({});
setTeam({active: true});
};

return (
Expand All @@ -179,7 +179,7 @@ const EditTeamModal = ({ team = {}, open, onSave, onClose, headerText }) => {
label="Active"
variant="outlined"
className="halfWidth"
checked={editedTeam.active ? editedTeam.active : false}
checked={editedTeam.active}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, I was absolutely terrified that I was the one responsible for this. My relief was immense.

onChange={e => setTeam({ ...editedTeam, active: e.target.checked })}
/> Active
<TextField
Expand All @@ -195,6 +195,7 @@ const EditTeamModal = ({ team = {}, open, onSave, onClose, headerText }) => {
<Autocomplete
id="teamLeadSelect"
multiple
freeSolo={true}
isOptionEqualToValue={(option, value) => {
return value ? value.memberId === option.memberId : false;
}}
Expand All @@ -218,6 +219,7 @@ const EditTeamModal = ({ team = {}, open, onSave, onClose, headerText }) => {
/>
<Autocomplete
multiple
freeSolo={true}
isOptionEqualToValue={(option, value) => {
return value ? value.memberId === option.memberId : false;
}}
Expand Down
Loading