Merge pull request #16457 from backstage/freben/update-rr
update react-router
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-playlist': patch
|
||||
---
|
||||
|
||||
Internal update to work with newer versions of react-router
|
||||
@@ -102,12 +102,16 @@ export const AddEntitiesDrawer = ({
|
||||
const entityRoute = useRouteRef(entityRouteRef);
|
||||
const entityLocationRegex = useMemo(() => {
|
||||
const forwardSlashRegex = new RegExp('/', 'g');
|
||||
// We need to do this in two steps, since entityRoute will ruin some special chars, like question marks
|
||||
const locationRegex = entityRoute({
|
||||
namespace: '(?<namespace>.+?)',
|
||||
kind: '(?<kind>.+?)',
|
||||
name: '(?<name>.+?)',
|
||||
}).replace(forwardSlashRegex, '\\/');
|
||||
|
||||
namespace: '__REPLACE_WITH_NAMESPACE__',
|
||||
kind: '__REPLACE_WITH_KIND__',
|
||||
name: '__REPLACE_WITH_NAME__',
|
||||
})
|
||||
.replace('__REPLACE_WITH_NAMESPACE__', '(?<namespace>.+?)')
|
||||
.replace('__REPLACE_WITH_KIND__', '(?<kind>.+?)')
|
||||
.replace('__REPLACE_WITH_NAME__', '(?<name>.+?)')
|
||||
.replace(forwardSlashRegex, '\\/');
|
||||
return new RegExp(`${locationRegex}$`);
|
||||
}, [entityRoute]);
|
||||
|
||||
@@ -127,12 +131,12 @@ export const AddEntitiesDrawer = ({
|
||||
|
||||
const addEntity = useCallback(
|
||||
entityResult => {
|
||||
// TODO (kuangp): this parsing of the location is not great. Ideally `CatalogEntityDocument`
|
||||
// TODO(kuangp): this parsing of the location is not great. Ideally `CatalogEntityDocument`
|
||||
// contains the `metadata.name` field so we can derive the full ref and we only fall back to
|
||||
// parsing location if it's missing (ie. for older versions)
|
||||
const { groups } = entityResult.location.match(entityLocationRegex);
|
||||
if (groups) {
|
||||
onAdd(stringifyEntityRef(groups));
|
||||
const match = entityResult.location.match(entityLocationRegex);
|
||||
if (match?.groups) {
|
||||
onAdd(stringifyEntityRef(match?.groups));
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
|
||||
@@ -12812,10 +12812,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@remix-run/router@npm:1.2.1":
|
||||
version: 1.2.1
|
||||
resolution: "@remix-run/router@npm:1.2.1"
|
||||
checksum: 71c947f83e130bf006226332aca395f626ad599b6d35dfe936f6a8f139cf37278bc1b36bce38c30f6062724402358296329f31c385b11ae59b13b76a2716d701
|
||||
"@remix-run/router@npm:1.3.2":
|
||||
version: 1.3.2
|
||||
resolution: "@remix-run/router@npm:1.3.2"
|
||||
checksum: ee2108b87d4a1241cdea137dd7e1741ee679228bd33fd81e22a6bb2940f81186cefe9a85e26d60cc49bbcc1bdbc57d1954b7d4d62f8a51ef69feddfc899f55fa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -33378,26 +33378,26 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"react-router-dom-stable@npm:react-router-dom@^6.3.0, react-router-dom@npm:^6.3.0":
|
||||
version: 6.6.2
|
||||
resolution: "react-router-dom@npm:6.6.2"
|
||||
version: 6.8.1
|
||||
resolution: "react-router-dom@npm:6.8.1"
|
||||
dependencies:
|
||||
"@remix-run/router": 1.2.1
|
||||
react-router: 6.6.2
|
||||
"@remix-run/router": 1.3.2
|
||||
react-router: 6.8.1
|
||||
peerDependencies:
|
||||
react: ">=16.8"
|
||||
react-dom: ">=16.8"
|
||||
checksum: e0ee89a2b3768d2eb406ecefedfa24b55428145359b4138f6d38b8a99b60a4f275418910f4cdb12c069ed0237711acced3787b0c7febfa6568d7ea9cd624ff3b
|
||||
checksum: fb1a9f5c7e4c83536ee7e6493f3c13f6abda66da69f9191fb8b087ab188ecc18a3a32575813a280cbeca67bcb8b0dcb6dbcef7ed599e03f38a44d694f4abcf14
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"react-router-stable@npm:react-router@^6.3.0, react-router@npm:6.6.2":
|
||||
version: 6.6.2
|
||||
resolution: "react-router@npm:6.6.2"
|
||||
"react-router-stable@npm:react-router@^6.3.0, react-router@npm:6.8.1":
|
||||
version: 6.8.1
|
||||
resolution: "react-router@npm:6.8.1"
|
||||
dependencies:
|
||||
"@remix-run/router": 1.2.1
|
||||
"@remix-run/router": 1.3.2
|
||||
peerDependencies:
|
||||
react: ">=16.8"
|
||||
checksum: 5960d774bb3a8f697a57ee2e82a3eb0a300b7186a62b27e02773c94f1682e59435bd876d6162a08cc8daf27cac72aaab66d348fcc4d8f59240a63a911cf0050b
|
||||
checksum: 8e7cc7a516adeb6060911861af99d9b512893c15ec732cbf8574872919be4f3fe439ffa8c0876d1bcbced880d081bfeda3c01cb505b5a243565d10500ee0ac36
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user