Skip to content

Commit

Permalink
fix #513 - remove ID fields/inputs on Flatpage model
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Dec 14, 2024
1 parent bfa065a commit 3985fb6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {FC} from 'react'
import {FormTab, NumberInput, required, TabbedForm, TextInput} from 'react-admin'
import {FormTab, required, TabbedForm, TextInput} from 'react-admin'

import {FlatpagePreview} from '@/components/Admin/custom/FlatpagePreview'
import {MyCreate} from '@/components/Admin/custom/MyCreate'
Expand All @@ -8,7 +8,6 @@ export const FlatpageCreate: FC = () => (
<MyCreate>
<TabbedForm>
<FormTab label="content.labels.general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="url" fullWidth validate={required()} />
<TextInput source="title" fullWidth validate={required()} />
<TextInput source="content" multiline fullWidth validate={required()} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {FC} from 'react'
import {FormTab, NumberInput, required, TabbedForm, TextInput} from 'react-admin'
import {FormTab, required, TabbedForm, TextInput} from 'react-admin'

import {FlatpagePreview} from '@/components/Admin/custom/FlatpagePreview'
import {MyEdit} from '@/components/Admin/custom/MyEdit'
Expand All @@ -8,7 +8,6 @@ export const FlatpageEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="content.labels.general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="url" fullWidth validate={required()} />
<TextInput source="title" fullWidth validate={required()} />
<TextInput source="content" multiline fullWidth validate={required()} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {FC} from 'react'
import {Datagrid, List, NumberField, TextField} from 'react-admin'
import {Datagrid, List, TextField} from 'react-admin'

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

export const FlatpageList: FC = () => (
<List>
<Datagrid>
<NumberField source="id" />
<TextField source="url" />
<TextField source="title" />
<TruncatedTextField source="content" maxTextWidth={30} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {FC} from 'react'
import {NumberField, Show, SimpleShowLayout, TextField} from 'react-admin'
import {Show, SimpleShowLayout, TextField} from 'react-admin'

import {MyShowActions} from '@/components/Admin/custom/MyShowActions'
import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField'

export const FlatpageShow: FC = () => (
<Show actions={<MyShowActions />}>
<SimpleShowLayout>
<NumberField source="id" />
<TextField source="url" />
<TextField source="title" />
<TruncatedTextField source="content" maxTextWidth={200} expandable />
Expand Down

0 comments on commit 3985fb6

Please sign in to comment.