From c1f1a4c7606b10de740cc771d0b8c5c21a2601d6 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 25 Mar 2022 17:11:49 +0100 Subject: [PATCH] app,create-app: migrate to relative tab routes Signed-off-by: Patrik Oldsberg --- .changeset/flat-walls-kiss.md | 27 +++++++ .../components/catalog/EntityPage.test.tsx | 2 +- .../app/src/components/catalog/EntityPage.tsx | 78 +++++++++---------- .../app/src/components/catalog/EntityPage.tsx | 36 ++++----- 4 files changed, 85 insertions(+), 58 deletions(-) create mode 100644 .changeset/flat-walls-kiss.md diff --git a/.changeset/flat-walls-kiss.md b/.changeset/flat-walls-kiss.md new file mode 100644 index 0000000000..3e7c42e838 --- /dev/null +++ b/.changeset/flat-walls-kiss.md @@ -0,0 +1,27 @@ +--- +'@backstage/create-app': patch +--- + +Updated the entity page routes to use relative routes rather than absolute ones. This change is required to be able to upgrade to `react-router` v6 stable in the future. + +To apply this change to an existing app, update the path prop of `EntityLayout.Route`s to be relative. For example: + +```diff + +- ++ + {overviewContent} + + +- ++ + {cicdContent} + + +- ++ + {errorsContent} + +``` + +This change should also be applied to any other usage of `TabbedLayout`. diff --git a/packages/app/src/components/catalog/EntityPage.test.tsx b/packages/app/src/components/catalog/EntityPage.test.tsx index f9d23247c6..0ef355a2cd 100644 --- a/packages/app/src/components/catalog/EntityPage.test.tsx +++ b/packages/app/src/components/catalog/EntityPage.test.tsx @@ -64,7 +64,7 @@ describe('EntityPage Test', () => { > - + {cicdContent} diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index e15df4bc6c..7986146d16 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -388,19 +388,19 @@ const overviewContent = ( const serviceEntityPage = ( - + {overviewContent} - + {cicdContent} - + {errorsContent} - + @@ -411,7 +411,7 @@ const serviceEntityPage = ( - + @@ -422,31 +422,31 @@ const serviceEntityPage = ( - + {techdocsContent} - + - + {pullRequestsContent} - + - + - + - + - + @@ -488,23 +488,23 @@ const serviceEntityPage = ( const websiteEntityPage = ( - + {overviewContent} - + {cicdContent} - + - + {errorsContent} - + @@ -515,24 +515,24 @@ const websiteEntityPage = ( - + {techdocsContent} - + @@ -541,25 +541,25 @@ const websiteEntityPage = ( - + {pullRequestsContent} - + - + - + @@ -567,15 +567,15 @@ const websiteEntityPage = ( const defaultEntityPage = ( - + {overviewContent} - + {techdocsContent} - + @@ -597,7 +597,7 @@ const componentPage = ( const apiPage = ( - + {entityWarningContent} @@ -619,7 +619,7 @@ const apiPage = ( - + @@ -631,7 +631,7 @@ const apiPage = ( const userPage = ( - + {entityWarningContent} @@ -650,7 +650,7 @@ const userPage = ( const groupPage = ( - + {entityWarningContent} @@ -672,7 +672,7 @@ const groupPage = ( const systemPage = ( - + {entityWarningContent} @@ -692,7 +692,7 @@ const systemPage = ( - + - + {entityWarningContent} diff --git a/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx b/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx index d98153f660..f6825b1b6c 100644 --- a/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx @@ -147,15 +147,15 @@ const overviewContent = ( const serviceEntityPage = ( - + {overviewContent} - + {cicdContent} - + @@ -166,7 +166,7 @@ const serviceEntityPage = ( - + @@ -177,7 +177,7 @@ const serviceEntityPage = ( - + {techdocsContent} @@ -185,15 +185,15 @@ const serviceEntityPage = ( const websiteEntityPage = ( - + {overviewContent} - + {cicdContent} - + @@ -204,7 +204,7 @@ const websiteEntityPage = ( - + {techdocsContent} @@ -219,11 +219,11 @@ const websiteEntityPage = ( const defaultEntityPage = ( - + {overviewContent} - + {techdocsContent} @@ -245,7 +245,7 @@ const componentPage = ( const apiPage = ( - + {entityWarningContent} @@ -268,7 +268,7 @@ const apiPage = ( - + @@ -280,7 +280,7 @@ const apiPage = ( const userPage = ( - + {entityWarningContent} @@ -296,7 +296,7 @@ const userPage = ( const groupPage = ( - + {entityWarningContent} @@ -315,7 +315,7 @@ const groupPage = ( const systemPage = ( - + {entityWarningContent} @@ -338,7 +338,7 @@ const systemPage = ( - + - + {entityWarningContent}