-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 488-mathjax
- Loading branch information
Showing
37 changed files
with
570 additions
and
1,935 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/components/Admin/custom/list-filtering/CompetitionFilterSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {FC} from 'react' | ||
import {AutocompleteInput, FilterListSection, FilterLiveForm, ReferenceInput} from 'react-admin' | ||
|
||
export const CompetitionFilterSection: FC = () => { | ||
return ( | ||
<FilterListSection label="Competition" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput source="competition" reference="competition/competition" filter={{competition_type: 0}}> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
31 changes: 31 additions & 0 deletions
31
src/components/Admin/custom/list-filtering/FilterSidebar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {FilterList as FilterListIcon} from '@mui/icons-material' | ||
import {Button, Card, CardContent, Stack} from '@mui/material' | ||
import {FC, PropsWithChildren, useState} from 'react' | ||
import {FilterLiveSearch} from 'react-admin' | ||
|
||
export const FilterSidebar: FC<PropsWithChildren> = ({children}) => { | ||
const [filterOpen, setFilterOpen] = useState(true) | ||
const toggleFilter = () => setFilterOpen((prev) => !prev) | ||
|
||
return ( | ||
<Stack | ||
sx={{ | ||
order: -1, | ||
position: 'relative', | ||
overflow: 'visible', | ||
}} | ||
> | ||
<Button onClick={toggleFilter} sx={{mt: 0.5, position: 'absolute', width: 'max-content', gap: 1}}> | ||
<FilterListIcon /> | ||
Filters | ||
</Button> | ||
|
||
<Card sx={{mt: 8, mr: filterOpen ? 2 : 0, width: filterOpen ? 200 : 0, transition: 'width 0.2s'}}> | ||
<CardContent> | ||
<FilterLiveSearch /> | ||
{children} | ||
</CardContent> | ||
</Card> | ||
</Stack> | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
src/components/Admin/custom/list-filtering/SemesterFilterSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {FC} from 'react' | ||
import {AutocompleteInput, FilterListSection, FilterLiveForm, ReferenceInput, useListContext} from 'react-admin' | ||
|
||
export const SemesterFilterSection: FC = () => { | ||
const {filterValues} = useListContext() | ||
|
||
return ( | ||
<FilterListSection label="Semester" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput | ||
source="semester" | ||
reference="competition/semester" | ||
filter={{competition: filterValues.competition}} | ||
> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
src/components/Admin/custom/list-filtering/SeriesFilterSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {FC} from 'react' | ||
import {AutocompleteInput, FilterListSection, FilterLiveForm, ReferenceInput, useListContext} from 'react-admin' | ||
|
||
export const SeriesFilterSection: FC = () => { | ||
const {filterValues} = useListContext() | ||
|
||
return ( | ||
<FilterListSection label="Séria" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput | ||
source="series" | ||
reference="competition/series" | ||
filter={{competition: filterValues.competition, semester: filterValues.semester}} | ||
> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
Oops, something went wrong.