Skip to content

Commit 2815802

Browse files
authored
remove journey article nav components (#58124)
1 parent 1377b38 commit 2815802

4 files changed

Lines changed: 6 additions & 58 deletions

File tree

src/fixtures/tests/playwright-rendering.spec.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,22 +1138,6 @@ test.describe('Journey Tracks', () => {
11381138
expect(trackContent).not.toContain('{%')
11391139
expect(trackContent).not.toContain('%}')
11401140
})
1141-
1142-
test('journey navigation components show on article pages', async ({ page }) => {
1143-
// go to an article that's part of a journey track
1144-
await page.goto('/get-started/start-your-journey/hello-world?feature=journey-navigation')
1145-
1146-
// journey next/prev nav components should rende
1147-
const journeyCard = page.locator('[data-testid="journey-track-card"]')
1148-
if (await journeyCard.isVisible()) {
1149-
await expect(journeyCard).toBeVisible()
1150-
}
1151-
1152-
const journeyNav = page.locator('[data-testid="journey-track-nav"]')
1153-
if (await journeyNav.isVisible()) {
1154-
await expect(journeyNav).toBeVisible()
1155-
}
1156-
})
11571141
})
11581142

11591143
test.describe('LandingArticleGridWithFilter component', () => {

src/frame/components/article/ArticlePage.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { DefaultLayout } from '@/frame/components/DefaultLayout'
77
import { ArticleTitle } from '@/frame/components/article/ArticleTitle'
88
import { useArticleContext } from '@/frame/components/context/ArticleContext'
99
import { LearningTrackNav } from '@/learning-track/components/article/LearningTrackNav'
10-
import { JourneyTrackNav } from '@/journeys/components/JourneyTrackNav'
11-
import { JourneyTrackCard } from '@/journeys/components/JourneyTrackCard'
1210
import { MarkdownContent } from '@/frame/components/ui/MarkdownContent'
1311
import { Lead } from '@/frame/components/ui/Lead'
1412
import { PermissionsStatement } from '@/frame/components/ui/PermissionsStatement'
@@ -44,14 +42,10 @@ export const ArticlePage = () => {
4442
productVideoUrl,
4543
miniTocItems,
4644
currentLearningTrack,
47-
currentJourneyTrack,
4845
supportPortalVaIframeProps,
4946
currentLayout,
5047
} = useArticleContext()
5148
const isLearningPath = !!currentLearningTrack?.trackName
52-
const isJourneyPath = !!currentJourneyTrack?.trackId
53-
// Only show journey track components when feature flag is enabled
54-
const showJourneyTracks = isJourneyPath && router.query?.feature === 'journey-navigation'
5549
const { t } = useTranslation(['pages'])
5650

5751
const introProp = (
@@ -78,7 +72,6 @@ export const ArticlePage = () => {
7872
const toc = (
7973
<>
8074
{isLearningPath && <LearningTrackCard track={currentLearningTrack} />}
81-
{showJourneyTracks && <JourneyTrackCard journey={currentJourneyTrack} />}
8275
{miniTocItems.length > 1 && <MiniTocs miniTocItems={miniTocItems} />}
8376
</>
8477
)
@@ -129,11 +122,6 @@ export const ArticlePage = () => {
129122
<LearningTrackNav track={currentLearningTrack} />
130123
</div>
131124
) : null}
132-
{showJourneyTracks ? (
133-
<div className="container-lg mt-4 px-3">
134-
<JourneyTrackNav context={currentJourneyTrack} />
135-
</div>
136-
) : null}
137125
</>
138126
) : (
139127
<div className="container-xl px-3 px-md-6 my-4">
@@ -160,12 +148,6 @@ export const ArticlePage = () => {
160148
<LearningTrackNav track={currentLearningTrack} />
161149
</div>
162150
) : null}
163-
164-
{showJourneyTracks ? (
165-
<div className="mt-4">
166-
<JourneyTrackNav context={currentJourneyTrack} />
167-
</div>
168-
) : null}
169151
</div>
170152
)}
171153
</DefaultLayout>

src/journeys/lib/journey-path-resolver.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,6 @@ function normalizeGuidePath(path: string): string {
8383
: `/${withoutLanguage || path}`
8484
}
8585

86-
/**
87-
* Helper function to append the journey-navigation feature flag to URLs
88-
*/
89-
function appendJourneyFeatureFlag(href: string): string {
90-
if (!href) return href
91-
92-
try {
93-
// we have to pass some URL here, we just throw it away though
94-
const url = new URL(href, 'https://docs.github.com')
95-
url.searchParams.set('feature', 'journey-navigation')
96-
return url.pathname + url.search
97-
} catch {
98-
// fallback if URL parsing fails
99-
const separator = href.includes('?') ? '&' : '?'
100-
return `${href}${separator}feature=journey-navigation`
101-
}
102-
}
103-
10486
/**
10587
* Resolves the journey context for a given article path.
10688
*
@@ -189,7 +171,7 @@ export async function resolveJourneyContext(
189171
if (resultData && resultData.length > 0) {
190172
const linkResult = resultData[0]
191173
result.prevGuide = {
192-
href: appendJourneyFeatureFlag(linkResult.href),
174+
href: linkResult.href,
193175
title: linkResult.title || '',
194176
}
195177
}
@@ -210,7 +192,7 @@ export async function resolveJourneyContext(
210192
if (resultData && resultData.length > 0) {
211193
const linkResult = resultData[0]
212194
result.nextGuide = {
213-
href: appendJourneyFeatureFlag(linkResult.href),
195+
href: linkResult.href,
214196
title: linkResult.title || '',
215197
}
216198
}
@@ -251,7 +233,7 @@ export async function resolveJourneyTracks(
251233
const linkData = await getLinkData(guidePath, context, { title: true })
252234
const baseHref = linkData?.[0]?.href || guidePath
253235
return {
254-
href: appendJourneyFeatureFlag(baseHref),
236+
href: baseHref,
255237
title: linkData?.[0]?.title || 'Untitled Guide',
256238
}
257239
}),

src/journeys/tests/journey-path-resolver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('journey-path-resolver', () => {
8282
)
8383

8484
expect(result?.prevGuide).toEqual({
85-
href: '/en/enterprise-cloud@latest/enterprise-onboarding/setup?feature=journey-navigation',
85+
href: '/en/enterprise-cloud@latest/enterprise-onboarding/setup',
8686
title: 'Mock Title for /enterprise-onboarding/setup',
8787
})
8888
})
@@ -95,7 +95,7 @@ describe('journey-path-resolver', () => {
9595
)
9696

9797
expect(result?.nextGuide).toEqual({
98-
href: '/en/enterprise-cloud@latest/enterprise-onboarding/deploy?feature=journey-navigation',
98+
href: '/en/enterprise-cloud@latest/enterprise-onboarding/deploy',
9999
title: 'Mock Title for /enterprise-onboarding/deploy',
100100
})
101101
})
@@ -184,7 +184,7 @@ describe('journey-path-resolver', () => {
184184

185185
expect(result[0].guides).toHaveLength(2)
186186
expect(result[0].guides[0]).toEqual({
187-
href: '/en/enterprise-cloud@latest/enterprise-onboarding/setup?feature=journey-navigation',
187+
href: '/en/enterprise-cloud@latest/enterprise-onboarding/setup',
188188
title: 'Mock Title for /enterprise-onboarding/setup',
189189
})
190190
})

0 commit comments

Comments
 (0)