diff --git a/projects/demo/src/modules/app/app.component.ts b/projects/demo/src/modules/app/app.component.ts index 468ba43f08b4..6b2ab5b46e49 100644 --- a/projects/demo/src/modules/app/app.component.ts +++ b/projects/demo/src/modules/app/app.component.ts @@ -10,10 +10,7 @@ import {distinctUntilChanged, filter, map, takeUntil} from 'rxjs/operators'; import {AbstractDemoComponent, DEMO_PAGE_LOADED_PROVIDER} from './abstract.app'; import {YaMetrikaService} from './metrika/metrika.service'; -import { - TUI_SELECTED_VERSION_META, - TUI_VERSION_MANAGER_PROVIDERS, -} from './version-manager/version-manager.providers'; +import {TUI_SELECTED_VERSION_META} from './version-manager/version-manager.providers'; import {TuiVersionMeta} from './version-manager/versions.constants'; @Component({ @@ -22,12 +19,7 @@ import {TuiVersionMeta} from './version-manager/versions.constants'; styleUrls: ['./app.style.less'], encapsulation: ViewEncapsulation.None, changeDetection, - providers: [ - TuiResizeService, - TuiDestroyService, - DEMO_PAGE_LOADED_PROVIDER, - TUI_VERSION_MANAGER_PROVIDERS, - ], + providers: [TuiResizeService, TuiDestroyService, DEMO_PAGE_LOADED_PROVIDER], }) export class AppComponent extends AbstractDemoComponent implements OnInit { readonly isLanding$ = this.router.events.pipe( diff --git a/projects/demo/src/modules/app/version-manager/version-manager.providers.ts b/projects/demo/src/modules/app/version-manager/version-manager.providers.ts index 44887e77800c..26484513d331 100644 --- a/projects/demo/src/modules/app/version-manager/version-manager.providers.ts +++ b/projects/demo/src/modules/app/version-manager/version-manager.providers.ts @@ -1,23 +1,10 @@ -import {DOCUMENT} from '@angular/common'; -import {InjectionToken, Provider} from '@angular/core'; -import {TUI_BASE_HREF} from '@taiga-ui/cdk'; +import {InjectionToken} from '@angular/core'; import {TUI_VERSIONS_META_MAP, TuiVersionMeta} from './versions.constants'; export const TUI_SELECTED_VERSION_META = new InjectionToken( '[TUI_SELECTED_VERSION_META]: Meta information about selected version of Taiga docs', -); - -export const TUI_VERSION_MANAGER_PROVIDERS: Provider[] = [ { - provide: TUI_SELECTED_VERSION_META, - deps: [TUI_BASE_HREF, DOCUMENT], - useFactory: (baseHref: string, doc: Document): TuiVersionMeta | null => { - const base = baseHref.replace(doc.location.origin, ''); - - return ( - TUI_VERSIONS_META_MAP.get(base) ?? TUI_VERSIONS_META_MAP.get('/') ?? null - ); - }, + factory: () => TUI_VERSIONS_META_MAP.get('/v3/') || null, }, -]; +); diff --git a/projects/demo/src/modules/app/version-manager/versions.constants.ts b/projects/demo/src/modules/app/version-manager/versions.constants.ts index 3756299ea57d..7beec2a1f99f 100644 --- a/projects/demo/src/modules/app/version-manager/versions.constants.ts +++ b/projects/demo/src/modules/app/version-manager/versions.constants.ts @@ -6,18 +6,16 @@ export interface TuiVersionMeta { title: string; } -export const TUI_CURRENT_MAJOR_VERSION = parseInt(TUI_VERSION, 10); - export const TUI_VERSIONS_META: readonly TuiVersionMeta[] = [ { - label: 'next', - baseHref: '/next/', - title: `v${TUI_CURRENT_MAJOR_VERSION}.next`, + label: 'v4', + baseHref: '/', + title: 'v4', }, { - label: `latest (v${TUI_VERSION})`, - baseHref: '/', - title: `v${TUI_CURRENT_MAJOR_VERSION}`, + label: `v${TUI_VERSION} (lts)`, + baseHref: '/v3/', + title: 'v3', }, { label: 'v2',