mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed links in History (#19551)
refs https://linear.app/tryghost/issue/PROD-331/post-and-offer-links-404-in-history - Links were using Ember route instead of absolute routes, causing 404s.
This commit is contained in:
parent
181be4ef1b
commit
be619302df
2 changed files with 4 additions and 4 deletions
|
@ -132,7 +132,7 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
route: 'editor.edit',
|
route: `editor/${resourceType}/${action.resource.id}`,
|
||||||
models: [resourceType, action.resource.id]
|
models: [resourceType, action.resource.id]
|
||||||
};
|
};
|
||||||
case 'integration':
|
case 'integration':
|
||||||
|
@ -145,10 +145,10 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
|
||||||
if (!action.resource || !action.resource.id) {
|
if (!action.resource || !action.resource.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// replace with Settings route once Offers X GA is released
|
||||||
return {
|
return {
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
route: 'offer',
|
route: `offers/${action.resource.id}`,
|
||||||
models: [action.resource.id]
|
models: [action.resource.id]
|
||||||
};
|
};
|
||||||
case 'tag':
|
case 'tag':
|
||||||
|
|
|
@ -131,7 +131,7 @@ const HistoryActionDescription: React.FC<{action: Action}> = ({action}) => {
|
||||||
const linkTarget = getLinkTarget(action);
|
const linkTarget = getLinkTarget(action);
|
||||||
|
|
||||||
if (linkTarget) {
|
if (linkTarget) {
|
||||||
return <a className='font-bold' href='#' onClick={(e) => {
|
return <a className='cursor-pointer font-bold' onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
updateRoute(linkTarget);
|
updateRoute(linkTarget);
|
||||||
}}>{action.resource?.title || action.resource?.name}</a>;
|
}}>{action.resource?.title || action.resource?.name}</a>;
|
||||||
|
|
Loading…
Add table
Reference in a new issue