Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RA: Fix Flatpage edit (PATCH to /undefined) #526

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/Admin/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {Admin as ReactAdmin, defaultDarkTheme, defaultLightTheme, RaThemeOptions
import {AdminLayout} from './AdminLayout'
import {dataProvider} from './dataProvider'
import {myI18nProvider} from './i18nProvider'
import {FlatpageCreate} from './resources/base/flat-page/FlatpageCreate'
import {FlatpageEdit} from './resources/base/flat-page/FlatpageEdit'
import {FlatpageList} from './resources/base/flat-page/FlatpageList'
import {FlatpageShow} from './resources/base/flat-page/FlatpageShow'
import {FlatpageCreate} from './resources/cms/flat-page/FlatpageCreate'
import {FlatpageEdit} from './resources/cms/flat-page/FlatpageEdit'
import {FlatpageList} from './resources/cms/flat-page/FlatpageList'
import {FlatpageShow} from './resources/cms/flat-page/FlatpageShow'
import {PostCreate} from './resources/cms/post/PostCreate'
import {PostEdit} from './resources/cms/post/PostEdit'
import {PostList} from './resources/cms/post/PostList'
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 {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
Loading