From a1045c8786dde255440e44655c65e1d7e8b456e7 Mon Sep 17 00:00:00 2001 From: k-genov Date: Tue, 26 Nov 2024 17:23:53 +0100 Subject: [PATCH] remove deprecated testing module --- .../scion/workbench/src/lib/public_api.ts | 1 - .../workbench/src/lib/testing/public_api.ts | 12 ----- .../lib/testing/workbench-testing.module.ts | 45 ------------------- .../src/lib/testing/workbench.provider.ts | 14 ------ .../view-tab-drag-image-renderer.service.ts | 6 +-- 5 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 projects/scion/workbench/src/lib/testing/public_api.ts delete mode 100644 projects/scion/workbench/src/lib/testing/workbench-testing.module.ts diff --git a/projects/scion/workbench/src/lib/public_api.ts b/projects/scion/workbench/src/lib/public_api.ts index 6075ecdce..f322dc689 100644 --- a/projects/scion/workbench/src/lib/public_api.ts +++ b/projects/scion/workbench/src/lib/public_api.ts @@ -31,4 +31,3 @@ export * from './microfrontend-platform/public_api'; export * from './startup/public_api'; export * from './logging/public_api'; export * from './storage/public_api'; -export * from './testing/public_api'; diff --git a/projects/scion/workbench/src/lib/testing/public_api.ts b/projects/scion/workbench/src/lib/testing/public_api.ts deleted file mode 100644 index 1b71da788..000000000 --- a/projects/scion/workbench/src/lib/testing/public_api.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2018-2023 Swiss Federal Railways - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - */ - -export {WorkbenchTestingModule} from './workbench-testing.module'; -export {provideWorkbenchForTest} from './workbench.provider'; diff --git a/projects/scion/workbench/src/lib/testing/workbench-testing.module.ts b/projects/scion/workbench/src/lib/testing/workbench-testing.module.ts deleted file mode 100644 index 425584b5d..000000000 --- a/projects/scion/workbench/src/lib/testing/workbench-testing.module.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {ModuleWithProviders, NgModule} from '@angular/core'; -import {WorkbenchConfig} from '../workbench-config'; -import {provideWorkbenchForTest} from './workbench.provider'; - -/** - * Sets up the SCION Workbench to be used for testing. - * - * Does the following: - * - provides the workbench with given config - * - configures the workbench to name the initial part 'main' - * - installs a sequence for activation instants - * - configures the testbed to auto-detect changes - * - disables animations - * - performs the initial navigation - * - * ### Usage - * - * ``` - * beforeEach(() => { - * TestBed.configureTestingModule({ - * imports: [ - * WorkbenchTestingModule.forTest(), - * RouterTestingModule.withRoutes([ - * {path: 'test-view', component: TestComponent}, - * ]), - * ], - * }); - * }); - * ``` - * - * @deprecated since version 17.0.0-beta.8; Register SCION Workbench providers using `provideWorkbench` function instead; API will be removed in a future release; API will be removed in a future release. - */ -@NgModule() -export class WorkbenchTestingModule { - - /** - * Sets up the SCION Workbench to be used for testing. - */ - public static forTest(config?: WorkbenchConfig): ModuleWithProviders { - return { - ngModule: WorkbenchTestingModule, - providers: [provideWorkbenchForTest(config)], - }; - } -} diff --git a/projects/scion/workbench/src/lib/testing/workbench.provider.ts b/projects/scion/workbench/src/lib/testing/workbench.provider.ts index 49ebda687..25dcb3001 100644 --- a/projects/scion/workbench/src/lib/testing/workbench.provider.ts +++ b/projects/scion/workbench/src/lib/testing/workbench.provider.ts @@ -18,20 +18,6 @@ import {Router} from '@angular/router'; * - disables animations * - performs the initial navigation * - * ### Usage - * - * ``` - * beforeEach(() => { - * TestBed.configureTestingModule({ - * imports: [ - * WorkbenchTestingModule.forTest(), - * RouterTestingModule.withRoutes([ - * {path: 'test-view', component: TestComponent}, - * ]), - * ], - * }); - * }); - * ``` */ export function provideWorkbenchForTest(config?: WorkbenchConfig & {mainAreaInitialPartId?: string}): EnvironmentProviders { return makeEnvironmentProviders([ diff --git a/projects/scion/workbench/src/lib/view-dnd/view-tab-drag-image-renderer.service.ts b/projects/scion/workbench/src/lib/view-dnd/view-tab-drag-image-renderer.service.ts index 6b58cb162..cff6847ef 100644 --- a/projects/scion/workbench/src/lib/view-dnd/view-tab-drag-image-renderer.service.ts +++ b/projects/scion/workbench/src/lib/view-dnd/view-tab-drag-image-renderer.service.ts @@ -8,7 +8,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -import {ApplicationRef, ComponentFactoryResolver, computed, Injectable, Injector, NgZone, signal, Signal} from '@angular/core'; +import {ApplicationRef, computed, Injectable, Injector, NgZone, signal, Signal} from '@angular/core'; import {take} from 'rxjs/operators'; import {createElement, setStyle} from '../common/dom.util'; import {ViewDragData, ViewDragService} from './view-drag.service'; @@ -40,8 +40,6 @@ export class ViewTabDragImageRenderer { private _constrainDragImageRectFn: ((rect: ViewDragImageRect) => ViewDragImageRect) | null = null; constructor(private _viewDragService: ViewDragService, - // TODO [Angular 19][https://github.com/angular/components/issues/24334] Alternative constructor (ComponentFactoryResolver is deprecated) - private _componentFactoryResolver: ComponentFactoryResolver, private _applicationRef: ApplicationRef, private _injector: Injector, private _zone: NgZone) { @@ -132,7 +130,7 @@ export class ViewTabDragImageRenderer { height: `${dragPosition.height}px`, }, }); - this._viewDragImagePortalOutlet = new DomPortalOutlet(outletElement, this._componentFactoryResolver, this._applicationRef, this._injector); + this._viewDragImagePortalOutlet = new DomPortalOutlet(outletElement, null, this._applicationRef, this._injector); const componentRef = this._viewDragImagePortalOutlet.attachComponentPortal(new ComponentPortal(ViewTabDragImageComponent, null, Injector.create({ parent: this._injector, providers: [