mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: allow reaching the license page while in archive mode
Fixes #66332
This commit is contained in:
committed by
Kirill Cherkashin
parent
fc6e55ba18
commit
faba1a6967
@@ -877,6 +877,12 @@ describe('AppComponent', () => {
|
||||
testCurrentNodes.next({SideNav: {url: 'foo', view: 'SideNav', nodes: []}});
|
||||
verifyNoRedirection();
|
||||
|
||||
testCurrentNodes.next({'': {url: 'license', view: '', nodes: []}});
|
||||
verifyNoRedirection();
|
||||
|
||||
testCurrentNodes.next({'': {url: 'community', view: '', nodes: []}});
|
||||
verifyPossibleRedirection();
|
||||
|
||||
testCurrentNodes.next({NoSideNav: {url: 'bar', view: 'SideNav', nodes: []}});
|
||||
verifyPossibleRedirection();
|
||||
|
||||
|
||||
@@ -168,7 +168,15 @@ export class AppComponent implements OnInit {
|
||||
|
||||
// Redirect to docs if we are in archive mode and are not hitting a docs page
|
||||
// (i.e. we have arrived at a marketing page)
|
||||
if (this.deployment.mode === 'archive' && !currentNodes[sideNavView]) {
|
||||
if (this.deployment.mode === 'archive') {
|
||||
// We allow visiting the license page.
|
||||
if (currentNodes['']?.url === 'license') {
|
||||
return;
|
||||
}
|
||||
// We allow visiting anything that we know to be a docs page.
|
||||
if (currentNodes[sideNavView] !== undefined) {
|
||||
return;
|
||||
}
|
||||
this.locationService.replace('docs');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user