Skip to content

Commit a71b129

Browse files
committed
fix: version selector shows v21 instead of next in dev mode
The version-manager.service was returning 'next' when VERSION.major was '0' (development mode). Updated the patch to return 'v21' for Angular.jp in dev mode. Also updated versions.json to point v21 to angular.jp instead of v20.
1 parent 0602285 commit a71b129

1 file changed

Lines changed: 29 additions & 14 deletions

File tree

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
diff --git a/adev/src/assets/others/versions.json b/adev/src/assets/others/versions.json
2-
index 44dad0e1ef..610fdab042 100644
3-
--- a/adev/src/assets/others/versions.json
4-
+++ b/adev/src/assets/others/versions.json
5-
@@ -5,7 +5,7 @@
6-
},
7-
{
8-
"version": "v20",
9-
- "url": "https://v20.angular.dev/overview"
10-
+ "url": "https://angular.jp/overview"
11-
},
12-
{
13-
"version": "v19",
141
diff --git a/adev/src/app/core/services/version-manager.service.ts b/adev/src/app/core/services/version-manager.service.ts
15-
index d4e9fb86ea..eaf7969333 100644
2+
index bf0af31c22..56890e8586 100644
163
--- a/adev/src/app/core/services/version-manager.service.ts
174
+++ b/adev/src/app/core/services/version-manager.service.ts
185
@@ -62,7 +62,7 @@ export class VersionManager {
@@ -24,3 +11,31 @@ index d4e9fb86ea..eaf7969333 100644
2411
transferCache: false,
2512
cache: 'no-cache',
2613
}),
14+
@@ -94,8 +94,12 @@ export class VersionManager {
15+
);
16+
17+
readonly currentDocsVersion = computed(() => {
18+
- // In devmode the version is 0, so we'll target next (which is first on the list)
19+
- if (VERSION.major === '0' || VERSION.patch.includes('next')) {
20+
+ // For Angular.jp, always target the stable version (v21)
21+
+ if (VERSION.major === '0') {
22+
+ return this.versions().find((v) => v.displayName === 'v21') ?? this.versions()[0];
23+
+ }
24+
+
25+
+ if (VERSION.patch.includes('next')) {
26+
return this.versions()[0];
27+
}
28+
29+
diff --git a/adev/src/assets/others/versions.json b/adev/src/assets/others/versions.json
30+
index 52ec12a661..07e1c78a5b 100644
31+
--- a/adev/src/assets/others/versions.json
32+
+++ b/adev/src/assets/others/versions.json
33+
@@ -5,7 +5,7 @@
34+
},
35+
{
36+
"version": "v21",
37+
- "url": "https://v21.angular.dev/overview"
38+
+ "url": "https://angular.jp/overview"
39+
},
40+
{
41+
"version": "v20",

0 commit comments

Comments
 (0)