Skip to content

Commit

Permalink
🐛 Fixed links in History (#19551)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ronaldlangeveld committed Jan 23, 2024
1 parent db5d2d0 commit e2a4724
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/admin-x-framework/src/api/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down

0 comments on commit e2a4724

Please sign in to comment.