Skip to content

Commit

Permalink
chore(workbench): remove deprecated workbench modules
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removing deprecated workbench modules introduced the following breaking changes.

The following APIs have been removed:
 - `WorkbenchModule.forRoot` => register SCION Workbench providers using `provideWorkbench` function and import standalone components and directives instead;
 - `WorkbenchModule.forChild` => no replacement; import standalone workbench components and directives instead;
 - `WorkbenchTestingModule.forTest` => no replacement; use `provideWorkbench` instead;
 - `provideWorkbenchForTest` => no replacement; use `provideWorkbench` instead;
  • Loading branch information
k-genov authored and danielwiehl committed Dec 13, 2024
1 parent e3f358f commit df3eb4e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 235 deletions.
2 changes: 0 additions & 2 deletions projects/scion/workbench/src/lib/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

export {WorkbenchConfig, MenuItemConfig, ViewMenuItemsConfig} from './workbench-config';
export {WorkbenchModule, WorkbenchModuleConfig} from './workbench.module';
export {provideWorkbench} from './workbench.provider';
export {WorkbenchService} from './workbench.service';
export {WORKBENCH_ID} from './workbench-id';
Expand All @@ -31,4 +30,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';
12 changes: 0 additions & 12 deletions projects/scion/workbench/src/lib/testing/public_api.ts

This file was deleted.

This file was deleted.

31 changes: 19 additions & 12 deletions projects/scion/workbench/src/lib/testing/workbench.provider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2018-2024 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
*/

import {WorkbenchConfig} from '../workbench-config';
import {ENVIRONMENT_INITIALIZER, EnvironmentProviders, inject, Injectable, makeEnvironmentProviders} from '@angular/core';
import {provideWorkbench} from '../workbench.provider';
Expand All @@ -8,7 +18,7 @@ import {ComponentFixtureAutoDetect} from '@angular/core/testing';
import {Router} from '@angular/router';

/**
* Returns the set of dependency-injection providers to enable and configure the SCION Workbench in tests.
* Enables and configures the SCION Workbench in tests., returning a set of dependency-injection providers to be registered in Angular.
*
* Does the following:
* - provides the workbench with given config
Expand All @@ -18,18 +28,15 @@ import {Router} from '@angular/router';
* - disables animations
* - performs the initial navigation
*
* ### Usage
* ---
* Usage:
*
* ```
* beforeEach(() => {
* TestBed.configureTestingModule({
* imports: [
* WorkbenchTestingModule.forTest(),
* RouterTestingModule.withRoutes([
* {path: 'test-view', component: TestComponent},
* ]),
* ],
* });
* ```ts
* TestBed.configureTestingModule({
* providers: [
* provideWorkbenchForTest(),
* provideRouter([])
* ],
* });
* ```
*/
Expand Down
64 changes: 0 additions & 64 deletions projects/scion/workbench/src/lib/workbench.module.spec.ts

This file was deleted.

100 changes: 0 additions & 100 deletions projects/scion/workbench/src/lib/workbench.module.ts

This file was deleted.

0 comments on commit df3eb4e

Please sign in to comment.