Skip to content

Commit

Permalink
Merge pull request #278 from SELab-2/group_performance
Browse files Browse the repository at this point in the history
Group performance
  • Loading branch information
friedrecursion authored May 19, 2024
2 parents 98ab637 + 6d8a29b commit 7578f13
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions frontend/frontend/src/components/CustomComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const Divider = ({ children, ...props }: CustomCardProps) => {
)
}


interface EvenlySpacedRowProps {
items: ReactNode[]
}
Expand Down
25 changes: 16 additions & 9 deletions frontend/frontend/src/pages/groupsPage/GroupsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export function GroupsPage() {
const [filteredStudents, setFilteredStudents] = useState(availableStudents)

// for filtering students
const handleAutocompleteChange = (_, value) => {
const handleAutocompleteChange = (_: unknown, value: number | null) => {
if (value) {
setFilteredStudents([value])
}
Expand All @@ -405,12 +405,14 @@ export function GroupsPage() {
setFilteredStudents(availableStudents)
}

const filterOptions = (_, { inputValue }) => {
const filtered = availableStudents.filter((option) => {
const filterOptions = (
_: unknown,
{ inputValue }: { inputValue: string }
) => {
return availableStudents.filter((option) => {
const label = studentNames.get(option)
return label?.toLowerCase().startsWith(inputValue.toLowerCase())
})
return filtered
}
return (
<>
Expand Down Expand Up @@ -751,11 +753,16 @@ export function GroupsPage() {
}
getOptionLabel={(
student
) =>
studentNames.get(
student
)
}
) => {
const name =
studentNames.get(
student
)
return name !=
null
? name
: '' // This checks for both null and undefined
}}
onChange={
handleAutocompleteChange
}
Expand Down

0 comments on commit 7578f13

Please sign in to comment.