From b6d74714084eb5b375b57c542f11935469116042 Mon Sep 17 00:00:00 2001 From: Lang <7system7@gmail.com> Date: Wed, 15 Jan 2025 14:27:53 +0100 Subject: [PATCH] add edit form to Person entity --- .env | 1 + .eslintrc.cjs | 21 ----- src/App.tsx | 3 +- .../resources/person/edit.tsx | 77 +++++++++++++++++++ .../resources/person/index.ts | 1 + 5 files changed, 81 insertions(+), 22 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 src/admin-components/resources/person/edit.tsx diff --git a/.env b/.env index 432a093..93813fc 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ VITE_AUTH_URL=http://localhost:8080 +VITE_SECURITY_REST_URL=http://localhost:8081/security VITE_GATEWAY_REST_URL=http://localhost:8081/core/api/admin diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 995e273..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - extends: [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:react/jsx-runtime", - "plugin:@typescript-eslint/recommended", - "plugin:react-hooks/recommended", - "prettier", - ], - ignorePatterns: ["dist", ".eslintrc.cjs"], - parser: "@typescript-eslint/parser", - env: { - browser: true, - es2021: true, - }, - settings: { - react: { - version: "detect", - }, - }, -}; diff --git a/src/App.tsx b/src/App.tsx index 10019fe..a3fb757 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import { Admin, Resource } from "react-admin"; import { Layout } from "./Layout"; -import { AdminDashboard, PersonList, PersonShow } from "@admin"; +import { AdminDashboard, PersonList, PersonShow, PersonEdit } from '@admin'; import { authProvider, dataProvider } from "@core"; export const App = () => ( @@ -15,6 +15,7 @@ export const App = () => ( options={{ label: "Users" }} list={PersonList} show={PersonShow} + edit={PersonEdit} /> ); diff --git a/src/admin-components/resources/person/edit.tsx b/src/admin-components/resources/person/edit.tsx new file mode 100644 index 0000000..2d80f6d --- /dev/null +++ b/src/admin-components/resources/person/edit.tsx @@ -0,0 +1,77 @@ +import React from "react"; +import { + BooleanField, BooleanInput, + DateInput, + Edit, + Labeled, + SimpleForm, + TextInput, +} from 'react-admin'; +import { Box, Card, CardContent, CardHeader, Stack } from "@mui/material"; + +export const PersonEdit = () => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/src/admin-components/resources/person/index.ts b/src/admin-components/resources/person/index.ts index 747170b..72e63bf 100644 --- a/src/admin-components/resources/person/index.ts +++ b/src/admin-components/resources/person/index.ts @@ -1,3 +1,4 @@ export { PersonList } from './list.tsx'; export { PersonShow } from './show.tsx'; +export { PersonEdit } from './edit.tsx'; export * from './components';