Skip to content
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

Group performance #278

Merged
merged 5 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
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
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