Skip to content

Commit

Permalink
Deleted ID's from react admin (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smilinko authored Dec 9, 2023
1 parent 87e4be2 commit b8c1189
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 50 deletions.
13 changes: 1 addition & 12 deletions src/components/Admin/resources/cms/post/PostCreate.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import {FC} from 'react'
import {
ArrayInput,
DateTimeInput,
FormTab,
NumberInput,
required,
SimpleFormIterator,
TabbedForm,
TextInput,
} from 'react-admin'
import {ArrayInput, DateTimeInput, FormTab, required, SimpleFormIterator, TabbedForm, TextInput} from 'react-admin'

import {MyCreate} from '@/components/Admin/custom/MyCreate'
import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput'
Expand All @@ -17,7 +8,6 @@ export const PostCreate: FC = () => (
<MyCreate>
<TabbedForm>
<FormTab label="general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="short_text" fullWidth validate={required()} />
<TextInput source="details" multiline fullWidth />
Expand All @@ -29,7 +19,6 @@ export const PostCreate: FC = () => (
<FormTab label="links">
<ArrayInput source="links" defaultValue={[]}>
<SimpleFormIterator>
<NumberInput source="id" fullWidth disabled />
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="url" fullWidth validate={required()} />
</SimpleFormIterator>
Expand Down
13 changes: 1 addition & 12 deletions src/components/Admin/resources/cms/post/PostEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import {FC} from 'react'
import {
ArrayInput,
DateTimeInput,
FormTab,
NumberInput,
required,
SimpleFormIterator,
TabbedForm,
TextInput,
} from 'react-admin'
import {ArrayInput, DateTimeInput, FormTab, required, SimpleFormIterator, TabbedForm, TextInput} from 'react-admin'

import {MyEdit} from '@/components/Admin/custom/MyEdit'
import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput'
Expand All @@ -17,7 +8,6 @@ export const PostEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="short_text" fullWidth validate={required()} />
<TextInput source="details" multiline fullWidth />
Expand All @@ -29,7 +19,6 @@ export const PostEdit: FC = () => (
<FormTab label="links">
<ArrayInput source="links" defaultValue={[]}>
<SimpleFormIterator>
<NumberInput source="id" fullWidth disabled />
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="url" fullWidth validate={required()} />
</SimpleFormIterator>
Expand Down
1 change: 0 additions & 1 deletion src/components/Admin/resources/cms/post/PostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField'
export const PostList: FC = () => (
<List>
<Datagrid rowClick="show">
<NumberField source="id" />
<TextField source="caption" />
<TruncatedTextField source="short_text" maxTextWidth={50} />
<TruncatedTextField source="details" maxTextWidth={50} />
Expand Down
14 changes: 1 addition & 13 deletions src/components/Admin/resources/cms/post/PostShow.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import {FC} from 'react'
import {
ArrayField,
Datagrid,
DateField,
NumberField,
Show,
SimpleShowLayout,
Tab,
TabbedShowLayout,
TextField,
} from 'react-admin'
import {ArrayField, Datagrid, DateField, Show, SimpleShowLayout, Tab, TabbedShowLayout, TextField} from 'react-admin'

import {MyShowActions} from '@/components/Admin/custom/MyShowActions'
import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField'
Expand All @@ -19,7 +9,6 @@ export const PostShow: FC = () => (
<TabbedShowLayout>
<Tab label="general">
<SimpleShowLayout>
<NumberField source="id" />
<TextField source="caption" />
<TextField source="short_text" />
<TextField source="details" />
Expand All @@ -33,7 +22,6 @@ export const PostShow: FC = () => (
<SimpleShowLayout>
<ArrayField source="links">
<Datagrid>
<NumberField source="id" />
<TextField source="caption" />
<TextField source="url" />
</Datagrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const CompetitionEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="name" fullWidth />
<NumberInput source="start_year" fullWidth />
<TextInput source="description" fullWidth />
Expand All @@ -20,7 +19,6 @@ export const CompetitionEdit: FC = () => (
<FormTab label="events">
<ArrayInput source="event_set" defaultValue={[]}>
<SimpleFormIterator>
<NumberInput source="id" fullWidth disabled />
{/* unspecifiedpublication_set: UnspecifiedPublication[]
registration_links: RegistrationLink[] */}
<NumberInput source="year" fullWidth />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField'
export const CompetitionList: FC = () => (
<List>
<Datagrid rowClick="show">
<NumberField source="id" />
<TextField source="name" />
<TextField source="slug" />
<NumberField source="start_year" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const CompetitionShow: FC = () => (
<TabbedShowLayout>
<Tab label="general">
<SimpleShowLayout>
<NumberField source="id" />
<TextField source="name" />
<TextField source="slug" />
<NumberField source="start_year" />
Expand All @@ -39,7 +38,6 @@ export const CompetitionShow: FC = () => (
<SimpleShowLayout>
<ArrayField source="history_events">
<Datagrid>
<NumberField source="id" />
<NumberField source="year" />
<TextField source="school_year" />
<DateField source="start" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {FC} from 'react'
import {ArrayInput, DateInput, FormTab, NumberInput, SimpleFormIterator, TabbedForm, TextInput} from 'react-admin'
import {ArrayInput, DateInput, FormTab, SimpleFormIterator, TabbedForm, TextInput} from 'react-admin'

import {MyEdit} from '@/components/Admin/custom/MyEdit'

Expand All @@ -9,14 +9,12 @@ export const SeriesEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="general">
<NumberInput source="id" fullWidth />
<DateInput source="deadline" fullWidth />
<TextInput source="order" fullWidth />
</FormTab>
<FormTab label="problems">
<ArrayInput source="problems">
<SimpleFormIterator>
<NumberInput source="id" fullWidth />
<TextInput source="text" fullWidth />
</SimpleFormIterator>
</ArrayInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField'
export const SeriesList: FC = () => (
<List>
<Datagrid rowClick="show">
<TextField source="id" />
<DateField source="deadline" />
<TextField source="order" />
<ArrayField source="problems">
<Datagrid>
<TextField source="id" />
<TruncatedTextField source="text" maxTextWidth={50} />
</Datagrid>
</ArrayField>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const SeriesShow: FC = () => (
<TabbedShowLayout>
<Tab label="general">
<SimpleShowLayout>
<TextField source="id" />
<DateField source="deadline" />
<TextField source="order" />
<NumberField source="semester" />
Expand All @@ -32,7 +31,6 @@ export const SeriesShow: FC = () => (
<SimpleShowLayout>
<ArrayField source="problems">
<Datagrid>
<TextField source="id" />
<TruncatedTextField source="text" maxTextWidth={100} expandable />
</Datagrid>
</ArrayField>
Expand Down

0 comments on commit b8c1189

Please sign in to comment.