Adding handling which checks if the current entity (the catalog entity being loaded) has an annotation for an external entity's TechDocs. If it does then we will redirect there rather than allowing a 404 (mic drop). This helps keep older URLs routing to the updated locations.
Adding changesets. Adding test coverage for external TechDocs entitiy redirect. Signed-off-by: Owen Shartle <timeloveinvent+github@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ export function getEntityRootTechDocsPath(entity: Entity): string {
|
||||
|
||||
/**
|
||||
* Build the TechDocs URL for the given entity. This helper should be used anywhere there
|
||||
* is a link to an entities TechDocs.
|
||||
* is a link to an entity's TechDocs.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
@@ -104,7 +104,7 @@ export const buildTechDocsURL = (
|
||||
});
|
||||
|
||||
// Add on the external entity path to the url if one exists. This allows deep linking into another
|
||||
// entities TechDocs.
|
||||
// entity's TechDocs.
|
||||
const path = getEntityRootTechDocsPath(entity);
|
||||
|
||||
return `${url}${path}`;
|
||||
|
||||
Reference in New Issue
Block a user