🐛 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:
Ronald Langeveld 2024-01-23 11:32:46 +00:00 committed by GitHub
parent db5d2d0329
commit e2a4724792
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
return {
isExternal: true,
route: 'editor.edit',
route: `editor/${resourceType}/${action.resource.id}`,
models: [resourceType, action.resource.id]
};
case 'integration':
@ -145,10 +145,10 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
if (!action.resource || !action.resource.id) {
return;
}
// replace with Settings route once Offers X GA is released
return {
isExternal: true,
route: 'offer',
route: `offers/${action.resource.id}`,
models: [action.resource.id]
};
case 'tag':

View File

@ -131,7 +131,7 @@ const HistoryActionDescription: React.FC<{action: Action}> = ({action}) => {
const linkTarget = getLinkTarget(action);
if (linkTarget) {
return <a className='font-bold' href='#' onClick={(e) => {
return <a className='cursor-pointer font-bold' onClick={(e) => {
e.preventDefault();
updateRoute(linkTarget);
}}>{action.resource?.title || action.resource?.name}</a>;