-
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.
- Loading branch information
Showing
10 changed files
with
110 additions
and
20 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
14 changes: 14 additions & 0 deletions
14
src/components/Admin/custom/list-filtering/CompetitionSeminarFilterSection.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 CompetitionSeminarFilterSection: FC = () => { | ||
return ( | ||
<FilterListSection label="Seminar" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput source="competition" reference="competition/competition" filter={{competition_type: 0}}> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/Admin/custom/list-filtering/EventFilterSection.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 EventFilterSection: FC = () => { | ||
return ( | ||
<FilterListSection label="Event" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput source="event" reference="competition/event"> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/Admin/custom/list-filtering/GradeFilterSection.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 GradeFilterSection: FC = () => { | ||
return ( | ||
<FilterListSection label="Grade" icon={null}> | ||
<FilterLiveForm> | ||
<ReferenceInput source="grade" reference="competition/grade"> | ||
<AutocompleteInput helperText={false} /> | ||
</ReferenceInput> | ||
</FilterLiveForm> | ||
</FilterListSection> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/Admin/custom/list-filtering/SeasonCodeFilterList.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 {FilterList, FilterListItem} from 'react-admin' | ||
|
||
import {seasonCodeStrings} from '../../seasonCodeStrings' | ||
|
||
export const SeasonCodeFilterList: FC = () => { | ||
return ( | ||
<FilterList label="season_code" icon={null}> | ||
{seasonCodeStrings.map((season) => ( | ||
<FilterListItem key={season.id} label={season.name} value={{season_code: season.id}} /> | ||
))} | ||
</FilterList> | ||
) | ||
} |
25 changes: 21 additions & 4 deletions
25
src/components/Admin/resources/competition/event-registration/EventRegistrationList.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 |
---|---|---|
@@ -1,21 +1,38 @@ | ||
import {FC} from 'react' | ||
import {Datagrid, FunctionField, List, ReferenceField, TextField} from 'react-admin' | ||
|
||
import {EventFilterSection} from '@/components/Admin/custom/list-filtering/EventFilterSection' | ||
import {FilterSidebar} from '@/components/Admin/custom/list-filtering/FilterSidebar' | ||
import {GradeFilterSection} from '@/components/Admin/custom/list-filtering/GradeFilterSection' | ||
import {EventRegistration} from '@/types/api/competition' | ||
|
||
export const EventRegistrationList: FC = () => ( | ||
<List> | ||
<List aside={<EventRegistrationListFilters />}> | ||
<Datagrid> | ||
<FunctionField | ||
source="profile.last_name" | ||
label="content.labels.name" | ||
render={(record: EventRegistration) => `${record.profile.first_name} ${record.profile.last_name}`} | ||
sortable={false} | ||
/> | ||
<TextField source="school.abbreviation" /> | ||
<TextField source="grade.tag" /> | ||
<ReferenceField source="event" reference="competition/event" link={false} /> | ||
<TextField source="school.abbreviation" sortable={false} /> | ||
<TextField source="grade.tag" sortable={false} /> | ||
{/* TODO: malo by to byt raditelne podla sortBy="event__start", | ||
ale akosi sa mi to nezda ze by fungovalo a navyse to zo zobrazenia nie je intuitivne */} | ||
<ReferenceField source="event" reference="competition/event" link={false} sortable={false} /> | ||
</Datagrid> | ||
</List> | ||
) | ||
|
||
// TODO: filtre a ordering podla https://github.com/ZdruzenieSTROM/webstrom-backend/pull/460/files#diff-148e08b739e60a78edfc1e546340f501840b75f1646afa58ee524ff82cfc061eR905-R908 | ||
const EventRegistrationListFilters: FC = () => ( | ||
<FilterSidebar> | ||
<EventFilterSection /> | ||
|
||
<GradeFilterSection /> | ||
|
||
{/* TODO: | ||
- school | ||
- profile */} | ||
</FilterSidebar> | ||
) |
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