From dfd1041ddffffb4142f0d5cfed45150fe1ef16f1 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Fri, 26 Aug 2022 13:17:54 -0400 Subject: [PATCH] add another early access breadcrumb exception --- middleware/contextualizers/breadcrumbs.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/middleware/contextualizers/breadcrumbs.js b/middleware/contextualizers/breadcrumbs.js index a707cd0a9b1c..ef4195c4c985 100644 --- a/middleware/contextualizers/breadcrumbs.js +++ b/middleware/contextualizers/breadcrumbs.js @@ -17,6 +17,8 @@ export default async function breadcrumbs(req, res, next) { return next() } +const earlyAccessExceptions = ['insights', 'enterprise-importer'] + async function getBreadcrumbs(req, isEarlyAccess = false) { const crumbs = [] const { currentPath, currentVersion } = req.context @@ -30,11 +32,11 @@ async function getBreadcrumbs(req, isEarlyAccess = false) { // top-level like "/github" cutoff++ - // The only exception to this rule is for the - // /{version}/early-access/insights/... URLs because they're a + // There are a few exceptions to this rule for the + // /{version}/early-access//... URLs because they're a // bit different. - // If there are more known exceptions, extend this conditional. - if (!split.includes('insights')) { + // If there are more known exceptions, add them to the array above. + if (!earlyAccessExceptions.some((product) => split.includes(product))) { cutoff++ }