Skip to content

Commit 1b4eadf

Browse files
authored
docs: redirect testing, drag-drop docs to adev (angular#31845)
1 parent c21dfa3 commit 1b4eadf

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

docs/src/app/routes.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
import {Routes} from '@angular/router';
1010
import {CanActivateComponentSidenav} from './pages/component-sidenav/component-sidenav-can-load-guard';
1111

12+
function externalRedirect(target: string) {
13+
return () => {
14+
window.location.href = target;
15+
return ''; // unused due to redirect above
16+
};
17+
}
18+
1219
export const MATERIAL_DOCS_ROUTES: Routes = [
1320
{
1421
path: '',
@@ -25,6 +32,31 @@ export const MATERIAL_DOCS_ROUTES: Routes = [
2532
// Since https://github.com/angular/components/pull/9574, the cdk-table guide became the overview
2633
// document for the cdk table. To avoid any dead / broken links, we redirect to the new location.
2734
{path: 'guide/cdk-table', redirectTo: '/cdk/table/overview'},
35+
// Component harness, drag & drop docs have moved to angular.dev
36+
{
37+
path: 'cdk/testing',
38+
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
39+
},
40+
{
41+
path: 'cdk/testing/api',
42+
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_testing'),
43+
},
44+
{
45+
path: 'cdk/testing/:tab',
46+
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
47+
},
48+
{
49+
path: 'cdk/drag-drop',
50+
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
51+
},
52+
{
53+
path: 'cdk/drag-drop/api',
54+
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_drag-drop'),
55+
},
56+
{
57+
path: 'cdk/drag-drop/:tab',
58+
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
59+
},
2860
// In v19, the theming system became based on system variables and the mat.theme mixin.
2961
// The following guides were consolidated into the main theming guide, which redirects
3062
// users to v18 docs if they are looking for this content.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"build-docs-content": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-docs-content-main.mts",
2222
"build-and-check-release-output": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/build-and-check-release-output.mts",
2323
"dev-app": "ibazel run //src/dev-app:devserver",
24+
"docs-app": "ibazel run //docs:serve",
2425
"universal-app": "bazel run //src/universal-app:server",
2526
"test": "node ./scripts/run-component-tests.js",
2627
"test-local": "pnpm -s test --local",

0 commit comments

Comments
 (0)