From a8660b6c52d32f75faafd4c9525303d9c33ef35c Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 15 Dec 2024 11:58:14 +0100 Subject: [PATCH] Unified fields across page --- .../competition/problems/ProblemCreate.tsx | 13 +++++++++++-- .../competition/problems/ProblemEdit.tsx | 13 +++++++++++-- .../competition/series/SeriesCreate.tsx | 16 +++++++++++----- .../resources/competition/series/SeriesEdit.tsx | 7 +++---- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/components/Admin/resources/competition/problems/ProblemCreate.tsx b/src/components/Admin/resources/competition/problems/ProblemCreate.tsx index 34079f67..f53e54bd 100644 --- a/src/components/Admin/resources/competition/problems/ProblemCreate.tsx +++ b/src/components/Admin/resources/competition/problems/ProblemCreate.tsx @@ -1,5 +1,14 @@ import {FC} from 'react' -import {FileInput, FormTab, ImageInput, ReferenceInput, required, SelectInput, TabbedForm, TextInput} from 'react-admin' +import { + AutocompleteInput, + FileInput, + FormTab, + ImageInput, + ReferenceInput, + required, + TabbedForm, + TextInput, +} from 'react-admin' import {LatexPreview} from '@/components/Admin/custom/LatexPreview' import {MyCreate} from '@/components/Admin/custom/MyCreate' @@ -19,7 +28,7 @@ export const ProblemCreate: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/problems/ProblemEdit.tsx b/src/components/Admin/resources/competition/problems/ProblemEdit.tsx index ca9d2e9c..51f69cbe 100644 --- a/src/components/Admin/resources/competition/problems/ProblemEdit.tsx +++ b/src/components/Admin/resources/competition/problems/ProblemEdit.tsx @@ -1,5 +1,14 @@ import {FC} from 'react' -import {FileInput, FormTab, ImageInput, ReferenceInput, required, SelectInput, TabbedForm, TextInput} from 'react-admin' +import { + AutocompleteInput, + FileInput, + FormTab, + ImageInput, + ReferenceInput, + required, + TabbedForm, + TextInput, +} from 'react-admin' import {LatexPreview} from '@/components/Admin/custom/LatexPreview' import {MyEdit} from '@/components/Admin/custom/MyEdit' @@ -19,7 +28,7 @@ export const ProblemEdit: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/series/SeriesCreate.tsx b/src/components/Admin/resources/competition/series/SeriesCreate.tsx index 5b3ca9e0..e29db966 100644 --- a/src/components/Admin/resources/competition/series/SeriesCreate.tsx +++ b/src/components/Admin/resources/competition/series/SeriesCreate.tsx @@ -1,19 +1,25 @@ import {FC} from 'react' -import {BooleanInput, FormTab, ReferenceInput, required, SelectInput, TabbedForm, TextInput} from 'react-admin' +import {AutocompleteInput, FormTab, NumberInput, ReferenceInput, required, TabbedForm} from 'react-admin' import {MyCreate} from '@/components/Admin/custom/MyCreate' import {MyDateTimeInput} from '@/components/Admin/custom/MyDateTimeInput' export const SeriesCreate: FC = () => ( - + { + // automaticky sa na BE posiela cely record, ale BE read_only (aj neexistujuce) fieldy ignoruje + // radsej z payloadu odstranime aspon sety + delete record.problems + return record + }} + > - + - - + diff --git a/src/components/Admin/resources/competition/series/SeriesEdit.tsx b/src/components/Admin/resources/competition/series/SeriesEdit.tsx index e49759eb..0e64586c 100644 --- a/src/components/Admin/resources/competition/series/SeriesEdit.tsx +++ b/src/components/Admin/resources/competition/series/SeriesEdit.tsx @@ -1,5 +1,5 @@ import {FC} from 'react' -import {BooleanInput, FormTab, ReferenceInput, required, SelectInput, TabbedForm, TextInput} from 'react-admin' +import {AutocompleteInput, FormTab, NumberInput, ReferenceInput, required, TabbedForm} from 'react-admin' import {MyDateTimeInput} from '@/components/Admin/custom/MyDateTimeInput' import {MyEdit} from '@/components/Admin/custom/MyEdit' @@ -16,11 +16,10 @@ export const SeriesEdit: FC = () => ( - + - - +