mirror of
https://github.com/TryGhost/Ghost.git
synced 2023-12-13 21:00:40 +01:00
Updated AdminX routing to work with and without a leading slash (#19312)
no issue
This commit is contained in:
parent
d65a95836b
commit
9ff482f985
3 changed files with 5 additions and 2 deletions
|
@ -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 a new issue