Skip to content

Commit 05ab1dd

Browse files
JeanMecheatscott
authored andcommitted
docs(docs-infra): pull version picker info from shared versions.json
fixes #64842
1 parent b2c7979 commit 05ab1dd

File tree

11 files changed

+368
-330
lines changed

11 files changed

+368
-330
lines changed

adev/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ TEST_FILES = APPLICATION_FILES + [
3737

3838
APPLICATION_ASSETS = [
3939
"//adev/src/assets/images",
40+
"//adev/src/assets/others",
4041
"//adev/src/assets/previews",
4142
"//adev/src/assets:tutorials",
4243
"//adev/src/assets/icons",

adev/src/app/app.component.spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {AppComponent} from './app.component';
1111
import {provideRouter, withComponentInputBinding} from '@angular/router';
1212
import {routes} from './routes';
1313
import {Search, WINDOW} from '@angular/docs';
14-
import {CURRENT_MAJOR_VERSION} from './core/providers/current-version';
1514

1615
describe('AppComponent', () => {
1716
const fakeSearch = {};
@@ -30,10 +29,6 @@ describe('AppComponent', () => {
3029
provide: Search,
3130
useValue: fakeSearch,
3231
},
33-
{
34-
provide: CURRENT_MAJOR_VERSION,
35-
useValue: fakeCurrentMajorVersion,
36-
},
3732
],
3833
});
3934
const fixture = TestBed.createComponent(AppComponent);

adev/src/app/app.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {CustomErrorHandler} from './core/services/errors-handling/error-handler'
4545
import {ExampleContentLoader} from './core/services/example-content-loader.service';
4646
import {ReuseTutorialsRouteStrategy} from './features/tutorial/tutorials-route-reuse-strategy';
4747
import {routes} from './routes';
48-
import {CURRENT_MAJOR_VERSION} from './core/providers/current-version';
4948
import {AppScroller} from './app-scroller';
5049

5150
export const appConfig: ApplicationConfig = {
@@ -78,10 +77,6 @@ export const appConfig: ApplicationConfig = {
7877
provideEnvironmentInitializer(() => inject(AppScroller)),
7978
provideEnvironmentInitializer(() => inject(AnalyticsService)),
8079
provideAlgoliaSearchClient(environment),
81-
{
82-
provide: CURRENT_MAJOR_VERSION,
83-
useValue: Number(VERSION.major),
84-
},
8580
{provide: ENVIRONMENT, useValue: environment},
8681
{provide: ErrorHandler, useClass: CustomErrorHandler},
8782
{provide: PREVIEWS_COMPONENTS, useValue: PREVIEWS_COMPONENTS_MAP},

adev/src/app/core/constants/versions.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

adev/src/app/core/layout/navigation/navigation.component.html

Lines changed: 117 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
<nav
6363
class="adev-nav-primary docs-scroll-hide"
6464
[class.adev-nav-primary--open]="isMobileNavigationOpened()"
65-
[class.adev-nav-primary--rc]="currentDocsVersionMode === 'rc'"
66-
[class.adev-nav-primary--next]="currentDocsVersionMode === 'next'"
67-
[class.adev-nav-primary--deprecated]="currentDocsVersionMode === 'deprecated'"
65+
[class.adev-nav-primary--rc]="currentDocsVersionMode() === 'rc'"
66+
[class.adev-nav-primary--next]="currentDocsVersionMode() === 'next'"
67+
[class.adev-nav-primary--deprecated]="currentDocsVersionMode() === 'deprecated'"
6868
>
6969
<button
7070
type="button"
@@ -83,58 +83,65 @@
8383
>
8484
<a aria-label="Angular homepage" routerLink="/">
8585
<!-- Logo Symbol -->
86-
@if(!isUwu) {
87-
<svg class="angular-logo" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 223 236" width="32">
88-
<g clip-path="url(#a)">
89-
<path
90-
fill="url(#b)"
91-
d="m222.077 39.192-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
92-
/>
93-
<path
94-
fill="url(#c)"
95-
d="m222.077 39.192-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
96-
/>
97-
</g>
98-
<defs>
99-
<linearGradient
100-
id="b"
101-
x1="49.009"
102-
x2="225.829"
103-
y1="213.75"
104-
y2="129.722"
105-
gradientUnits="userSpaceOnUse"
106-
>
107-
<stop stop-color="#E40035" />
108-
<stop offset=".24" stop-color="#F60A48" />
109-
<stop offset=".352" stop-color="#F20755" />
110-
<stop offset=".494" stop-color="#DC087D" />
111-
<stop offset=".745" stop-color="#9717E7" />
112-
<stop offset="1" stop-color="#6C00F5" />
113-
</linearGradient>
114-
<linearGradient
115-
id="c"
116-
x1="41.025"
117-
x2="156.741"
118-
y1="28.344"
119-
y2="160.344"
120-
gradientUnits="userSpaceOnUse"
121-
>
122-
<stop stop-color="#FF31D9" />
123-
<stop offset="1" stop-color="#FF5BE1" stop-opacity="0" />
124-
</linearGradient>
125-
<clipPath id="a">
126-
<path fill="#fff" d="M0 0h223v236H0z" />
127-
</clipPath>
128-
</defs>
129-
</svg>
130-
} @else {
131-
<img
132-
src="assets/images/uwu.png"
133-
style="width: auto; margin: 0"
134-
class="uwu-logo"
135-
alt="Angular logo"
136-
height="34"/>
137-
}
86+
@if (!isUwu) {
87+
<svg
88+
class="angular-logo"
89+
xmlns="http://www.w3.org/2000/svg"
90+
fill="none"
91+
viewBox="0 0 223 236"
92+
width="32"
93+
>
94+
<g clip-path="url(#a)">
95+
<path
96+
fill="url(#b)"
97+
d="m222.077 39.192-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
98+
/>
99+
<path
100+
fill="url(#c)"
101+
d="m222.077 39.192-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
102+
/>
103+
</g>
104+
<defs>
105+
<linearGradient
106+
id="b"
107+
x1="49.009"
108+
x2="225.829"
109+
y1="213.75"
110+
y2="129.722"
111+
gradientUnits="userSpaceOnUse"
112+
>
113+
<stop stop-color="#E40035" />
114+
<stop offset=".24" stop-color="#F60A48" />
115+
<stop offset=".352" stop-color="#F20755" />
116+
<stop offset=".494" stop-color="#DC087D" />
117+
<stop offset=".745" stop-color="#9717E7" />
118+
<stop offset="1" stop-color="#6C00F5" />
119+
</linearGradient>
120+
<linearGradient
121+
id="c"
122+
x1="41.025"
123+
x2="156.741"
124+
y1="28.344"
125+
y2="160.344"
126+
gradientUnits="userSpaceOnUse"
127+
>
128+
<stop stop-color="#FF31D9" />
129+
<stop offset="1" stop-color="#FF5BE1" stop-opacity="0" />
130+
</linearGradient>
131+
<clipPath id="a">
132+
<path fill="#fff" d="M0 0h223v236H0z" />
133+
</clipPath>
134+
</defs>
135+
</svg>
136+
} @else {
137+
<img
138+
src="assets/images/uwu.png"
139+
style="width: auto; margin: 0"
140+
class="uwu-logo"
141+
alt="Angular logo"
142+
height="34"
143+
/>
144+
}
138145
</a>
139146

140147
<!-- Version picker for v18+ -->
@@ -150,7 +157,7 @@
150157
(cdkMenuClosed)="closeMenu()"
151158
(click)="openVersionMenu($event)"
152159
>
153-
{{ currentDocsVersion()?.displayName }}
160+
{{ currentDocsVersion().displayName }}
154161
<svg
155162
xmlns="http://www.w3.org/2000/svg"
156163
height="15"
@@ -165,16 +172,16 @@
165172
<ng-template #docsVersionMiniMenu>
166173
<ul class="adev-mini-menu adev-version-picker" cdkMenu>
167174
@for (item of versions(); track item) {
168-
<li>
169-
<a
170-
type="button"
171-
cdkMenuItem
172-
[href]="item.url"
173-
[attr.aria-label]="item.displayName"
174-
>
175-
<span>{{ item.displayName }}</span>
176-
</a>
177-
</li>
175+
<li>
176+
<a
177+
type="button"
178+
cdkMenuItem
179+
[href]="item.url"
180+
[attr.aria-label]="item.displayName"
181+
>
182+
<span>{{ item.displayName }}</span>
183+
</a>
184+
</li>
178185
}
179186
</ul>
180187
</ng-template>
@@ -363,8 +370,9 @@
363370
fill="none"
364371
xmlns="http://www.w3.org/2000/svg"
365372
>
366-
<path
367-
d="M3.468 1.948C5.303 3.325 7.276 6.118 8 7.616c.725-1.498 2.697-4.29 4.532-5.668C13.855.955 16 .186 16 2.632c0 .489-.28 4.105-.444 4.692-.572 2.04-2.653 2.561-4.504 2.246 3.236.551 4.06 2.375 2.281 4.2-3.376 3.464-4.852-.87-5.23-1.98-.07-.204-.103-.3-.103-.218 0-.081-.033.014-.102.218-.379 1.11-1.855 5.444-5.231 1.98-1.778-1.825-.955-3.65 2.28-4.2-1.85.315-3.932-.205-4.503-2.246C.28 6.737 0 3.12 0 2.632 0 .186 2.145.955 3.468 1.948Z"></path>
373+
<path
374+
d="M3.468 1.948C5.303 3.325 7.276 6.118 8 7.616c.725-1.498 2.697-4.29 4.532-5.668C13.855.955 16 .186 16 2.632c0 .489-.28 4.105-.444 4.692-.572 2.04-2.653 2.561-4.504 2.246 3.236.551 4.06 2.375 2.281 4.2-3.376 3.464-4.852-.87-5.23-1.98-.07-.204-.103-.3-.103-.218 0-.081-.033.014-.102.218-.379 1.11-1.855 5.444-5.231 1.98-1.778-1.825-.955-3.65 2.28-4.2-1.85.315-3.932-.205-4.503-2.246C.28 6.737 0 3.12 0 2.632 0 .186 2.145.955 3.468 1.948Z"
375+
></path>
368376
</svg>
369377
</a>
370378
</li>
@@ -403,21 +411,27 @@
403411
</a>
404412
</li>
405413
<li>
406-
<a [href]="DISCORD" cdkMenuItem title="Angular Discord" target="_blank" rel="noopener">
414+
<a
415+
[href]="DISCORD"
416+
cdkMenuItem
417+
title="Angular Discord"
418+
target="_blank"
419+
rel="noopener"
420+
>
407421
<!-- Discord Icon -->
408422
<svg
409-
xmlns="http://www.w3.org/2000/svg"
410-
viewBox="0 0 127.14 96.36"
411-
width="20"
412-
height="20"
413-
fill="none"
414-
>
415-
<path
416-
fill-rule="evenodd"
417-
clip-rule="evenodd"
418-
d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,110.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"
419-
/>
420-
</svg>
423+
xmlns="http://www.w3.org/2000/svg"
424+
viewBox="0 0 127.14 96.36"
425+
width="20"
426+
height="20"
427+
fill="none"
428+
>
429+
<path
430+
fill-rule="evenodd"
431+
clip-rule="evenodd"
432+
d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,110.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"
433+
/>
434+
</svg>
421435
</a>
422436
</li>
423437
</ul>
@@ -434,13 +448,17 @@
434448
(cdkMenuOpened)="openMenu('theme-picker')"
435449
>
436450
<docs-icon role="presentation">
437-
@switch (theme()) { @case ('light') {
438-
{{ 'light_mode' }}
439-
} @case ('dark') {
440-
{{ 'dark_mode' }}
441-
} @case ('auto') {
442-
{{ 'routine' }}
443-
} }
451+
@switch (theme()) {
452+
@case ('light') {
453+
{{ 'light_mode' }}
454+
}
455+
@case ('dark') {
456+
{{ 'dark_mode' }}
457+
}
458+
@case ('auto') {
459+
{{ 'routine' }}
460+
}
461+
}
444462
</docs-icon>
445463
</button>
446464

@@ -487,15 +505,16 @@
487505

488506
<!-- Tablet: Second horizontal nav layer which opens the secondary nav -->
489507
@if (activeRouteItem() === DOCS_ROUTE || activeRouteItem() === REFERENCE_ROUTE) {
490-
<div class="adev-secondary-tablet-bar">
491-
<button type="button" (click)="openMobileNav($event)">
492-
<docs-icon class="docs-icon_high-contrast">menu</docs-icon>
493-
@if (activeRouteItem() === DOCS_ROUTE) {
494-
<span>Docs</span>
495-
} @if (activeRouteItem() === REFERENCE_ROUTE) {
496-
<span>API</span>
497-
}
498-
</button>
499-
</div>
508+
<div class="adev-secondary-tablet-bar">
509+
<button type="button" (click)="openMobileNav($event)">
510+
<docs-icon class="docs-icon_high-contrast">menu</docs-icon>
511+
@if (activeRouteItem() === DOCS_ROUTE) {
512+
<span>Docs</span>
513+
}
514+
@if (activeRouteItem() === REFERENCE_ROUTE) {
515+
<span>API</span>
516+
}
517+
</button>
518+
</div>
500519
}
501520
</div>

0 commit comments

Comments
 (0)