diff --git a/client/src/modules/Score/components/ScoreTable/index.tsx b/client/src/modules/Score/components/ScoreTable/index.tsx index 66b2d1cc51..5e39b16068 100644 --- a/client/src/modules/Score/components/ScoreTable/index.tsx +++ b/client/src/modules/Score/components/ScoreTable/index.tsx @@ -108,6 +108,8 @@ export function ScoreTable(props: Props) { setCourseTasks(sortedTasks); setColumns( getColumns({ + githubId, + name, cityName, mentor, handleSettings: () => setIsVisibleSettings(true), diff --git a/client/src/modules/Score/data/getColumns.tsx b/client/src/modules/Score/data/getColumns.tsx index 1a1fe2cc59..53f142e5cb 100644 --- a/client/src/modules/Score/data/getColumns.tsx +++ b/client/src/modules/Score/data/getColumns.tsx @@ -8,6 +8,8 @@ import Link from 'next/link'; type Props = { taskColumns: Record[]; + githubId?: string | string[]; + name?: string | string[]; cityName?: string | string[]; mentor?: string | string[]; handleSettings: () => void; @@ -19,7 +21,7 @@ const getSearchProps = (key: string) => ({ }); export function getColumns(props: Props): ColumnType[] { - const { cityName, mentor, handleSettings, taskColumns } = props; + const { githubId, name, cityName, mentor, handleSettings, taskColumns } = props; return [ { @@ -37,6 +39,7 @@ export function getColumns(props: Props): ColumnType[] { key: 'githubId', dataIndex: 'githubId', sorter: 'githubId', + defaultFilteredValue: githubId ? (isArray(githubId) ? githubId : [githubId]) : undefined, width: 150, render: (value: string) => (
@@ -54,6 +57,7 @@ export function getColumns(props: Props): ColumnType[] { dataIndex: 'name', width: 150, sorter: 'name', + defaultFilteredValue: name ? (isArray(name) ? name : [name]) : undefined, render: (value, record) => ( {value} diff --git a/client/src/modules/Score/hooks/useScorePaging.tsx b/client/src/modules/Score/hooks/useScorePaging.tsx index 8d6358d41b..4b67e08d90 100644 --- a/client/src/modules/Score/hooks/useScorePaging.tsx +++ b/client/src/modules/Score/hooks/useScorePaging.tsx @@ -8,7 +8,7 @@ import { ScoreOrder, ScoreTableFilters } from './types'; export function useScorePaging(router: NextRouter, courseService: CourseService, activeOnly: boolean) { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { ['mentor.githubId']: mentor, cityName, ...currentQuery } = router.query; + const { githubId, name, ['mentor.githubId']: mentor, cityName, ...currentQuery } = router.query; const setQueryParams = useCallback( (query: ParsedUrlQuery) => {