Skip to content

Commit ba70322

Browse files
committed
docs: redirect testing, drag-drop docs to adev
1 parent c21dfa3 commit ba70322

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

docs/src/app/external-redirect.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
export function externalRedirect(target: string) {
10+
return () => {
11+
window.location.href = target;
12+
return ''; // unused due to redirect above
13+
};
14+
}

docs/src/app/routes.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import {Routes} from '@angular/router';
10+
import {externalRedirect} from './external-redirect';
1011
import {CanActivateComponentSidenav} from './pages/component-sidenav/component-sidenav-can-load-guard';
1112

1213
export const MATERIAL_DOCS_ROUTES: Routes = [
@@ -25,6 +26,31 @@ export const MATERIAL_DOCS_ROUTES: Routes = [
2526
// Since https://github.com/angular/components/pull/9574, the cdk-table guide became the overview
2627
// document for the cdk table. To avoid any dead / broken links, we redirect to the new location.
2728
{path: 'guide/cdk-table', redirectTo: '/cdk/table/overview'},
29+
// Component harness, drag & drop docs have moved to angular.dev
30+
{
31+
path: 'cdk/testing',
32+
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
33+
},
34+
{
35+
path: 'cdk/testing/api',
36+
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_testing'),
37+
},
38+
{
39+
path: 'cdk/testing/:tab',
40+
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
41+
},
42+
{
43+
path: 'cdk/drag-drop',
44+
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
45+
},
46+
{
47+
path: 'cdk/drag-drop/api',
48+
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_drag-drop'),
49+
},
50+
{
51+
path: 'cdk/drag-drop/:tab',
52+
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
53+
},
2854
// In v19, the theming system became based on system variables and the mat.theme mixin.
2955
// The following guides were consolidated into the main theming guide, which redirects
3056
// 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)