From b3669b38e42c2a7525de0d2088e83f1420667aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 6 Mar 2024 12:07:12 +0100 Subject: [PATCH 1/3] fix: themes provider deprecations --- src/AdminGuesser.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/AdminGuesser.tsx b/src/AdminGuesser.tsx index ac30a401..c92ca6c0 100644 --- a/src/AdminGuesser.tsx +++ b/src/AdminGuesser.tsx @@ -6,6 +6,7 @@ import { I18nContextProvider, Loading, ThemeProvider, + ThemesContext, defaultI18nProvider, } from 'react-admin'; import { createHashHistory, createMemoryHistory } from 'history'; @@ -231,11 +232,17 @@ const AdminGuesserWithError = ({ return ( - - - - - + + + + + + + ); }; From 76fd093c08ebc60116786815186fcf528e0e9786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 6 Mar 2024 14:01:37 +0100 Subject: [PATCH 2/3] fix: ToggleThemeButton deprecation --- CONTRIBUTING.md | 40 ++++++++++++++++++++++++++++++++++++++++ src/layout/AppBar.tsx | 3 +-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5f70424..f0feafe3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,6 +24,46 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll Please base your changes on the `master` branch. + +### Testing Changes With the Distribution + +Start your project: + +```console +docker compose up --wait +``` + +Clone the API Platform Admin repository: + +```console +git clone https://github.com/api-platform/admin.git +``` + +Start your distribution-based project: + +```console +cd +docker compose up --wait +``` + +Change the entrypoint of the API to use the one served by Docker in `pwa/pages/admin/index.tsx`: + +```patch +- setDynamicAdmin(); ++ setDynamicAdmin(); +``` + +Link your local version of API Plarform Admin and start the PWA locally (outside Docker): + +```console +cd pwa/ +pnpm link ../../admin +pnpm run dev +``` + + + + ### Installing the Source Version To install the source version of API Platform Admin in your project and contribute a patch, follow the instructions below. diff --git a/src/layout/AppBar.tsx b/src/layout/AppBar.tsx index 0f2cafdd..3dc83d50 100644 --- a/src/layout/AppBar.tsx +++ b/src/layout/AppBar.tsx @@ -9,7 +9,6 @@ import type { AppBarProps } from 'react-admin'; import { Box, Typography } from '@mui/material'; import Logo from './Logo.js'; -import { darkTheme, lightTheme } from './themes.js'; const CustomAppBar = ({ classes, userMenu, ...props }: AppBarProps) => { const authProvider = useAuthProvider(); @@ -24,7 +23,7 @@ const CustomAppBar = ({ classes, userMenu, ...props }: AppBarProps) => { /> - + ); }; From ba147bd193dfad6dacb01a5ff9c08fd43805ce63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 6 Mar 2024 14:24:24 +0100 Subject: [PATCH 3/3] revert changes in CONTRIBUTING.md --- CONTRIBUTING.md | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0feafe3..c5f70424 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,46 +24,6 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll Please base your changes on the `master` branch. - -### Testing Changes With the Distribution - -Start your project: - -```console -docker compose up --wait -``` - -Clone the API Platform Admin repository: - -```console -git clone https://github.com/api-platform/admin.git -``` - -Start your distribution-based project: - -```console -cd -docker compose up --wait -``` - -Change the entrypoint of the API to use the one served by Docker in `pwa/pages/admin/index.tsx`: - -```patch -- setDynamicAdmin(); -+ setDynamicAdmin(); -``` - -Link your local version of API Plarform Admin and start the PWA locally (outside Docker): - -```console -cd pwa/ -pnpm link ../../admin -pnpm run dev -``` - - - - ### Installing the Source Version To install the source version of API Platform Admin in your project and contribute a patch, follow the instructions below.