Updated AdminX routing to work with and without a leading slash (#19312)
no issue
This commit is contained in:
parent
d65a95836b
commit
9ff482f985
@ -111,7 +111,7 @@ const RoutingProvider: React.FC<RoutingProviderProps> = ({basePath, modals, chil
|
||||
return;
|
||||
}
|
||||
|
||||
const newPath = options.route;
|
||||
const newPath = options.route.replace(/^\//, '');
|
||||
|
||||
if (newPath === route) {
|
||||
// No change
|
||||
|
@ -42,7 +42,7 @@ const IntegrationItem: React.FC<IntegrationItemProps> = ({
|
||||
|
||||
const handleClick = () => {
|
||||
if (disabled) {
|
||||
updateRoute({route: 'pro'});
|
||||
updateRoute({route: 'pro', isExternal: true});
|
||||
} else {
|
||||
action();
|
||||
}
|
||||
|
@ -220,6 +220,9 @@ export default class AdminXComponent extends Component {
|
||||
};
|
||||
|
||||
externalNavigate = ({route, models = []}) => {
|
||||
if (!route.startsWith('/')) {
|
||||
route = `/${route}`;
|
||||
}
|
||||
this.router.transitionTo(route, ...models);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user