Releases: SchweizerischeBundesbahnen/scion-workbench
19.0.0-beta.2 (@scion/workbench)
19.0.0-beta.2 (2025-01-31)
Bug Fixes
- workbench/view: prevent cropping the last view tab (6ea7c92)
Features
- workbench/part: enable displaying content in workbench parts (2e9404e)
- workbench/part: align part actions to the right (df309be)
- workbench/part: enable updating part actions (774d59b)
- workbench/view: enable updating view menu items (ff4f83e)
BREAKING CHANGES
-
workbench/part: Default part action alignment is now to the right.
To align an action to the left, set its alignment to
start
. -
workbench/part: The registration of part actions via
WorkbenchService.registerPartAction
method has changed. The declarative contribution of part actions viawbPartAction
directive has not changed.To migrate:
-
Part actions now require a
ComponentType
orTemplateRef
instead of a CDK portal. Pass data through input properties or a custom injector. See examples below. -
The signature of
WorkbenchService.registerPartAction
has changed. Register the action using a factory function. Previously, no factory function was required.inject(WorkbenchService).registerPartAction(() => ActionComponent);
For more control, return an object literal:
inject(WorkbenchService).registerPartAction(() => { return { content: ActionComponent, align: 'end', }; });
-
WorkbenchService.registerPartAction
runs the passed function in a reactive context. Use Angular'suntracked
function to execute code outside the reactive context. -
WorkbenchPartAction.canMatch
property has been removed. Instead, move the condition to the factory function, returningnull
to not match a part.inject(WorkbenchService).registerPartAction(part => { return part.isInMainArea ? ActionComponent : null; // matches parts in the main area });
Example for passing data via inputs:
inject(WorkbenchService).registerPartAction(() => { return { content: ActionComponent, inputs: { data: 'value', }, }; });
If using a component, inputs are available as input properties.
@Component({...}) class ActionComponent { data = input.required<string>(); }
If using a template, inputs are available for binding via local template let declarations.
<ng-template let-data="data"> ... </ng-template>
Example for passing data via custom injector:
inject(WorkbenchService).registerPartAction(() => { return { content: ActionComponent, injector: Injector.create({ parent: inject(Injector), providers: [ {provide: DI_TOKEN, useValue: 'value'}, ], }), }; });
-
-
workbench/view: The registration of view menu items via
WorkbenchService.registerViewMenuItem
method has changed. The declarative contribution of menu items viawbViewMenuItem
directive has not changed.To migrate:
- Menu items now require a
ComponentType
orTemplateRef
instead of a CDK portal. Pass data through input properties or a custom injector. See examples below. WorkbenchService.registerViewMenuItem
now runs the passed function in a reactive context. Use Angular'suntracked
function to execute code outside the reactive context.WorkbenchMenuItemFactoryFn
has been renamed toWorkbenchViewMenuItemFn
.WorkbenchView.registerMenuItem
has been removed. Use anng-template
with thewbViewMenuItem
directive or register the menu item viaWorkbenchService.registerViewMenuItem
.WorkbenchMenuItem.isDisabled
has been renamed toWorkbenchMenuItem.disabled
and its type changed fromfunction
toboolean
. Update the disabled state using signals.
Example for passing data via inputs:
inject(WorkbenchService).registerViewMenuItem(() => { return { content: MenuItemComponent, inputs: { data: 'value', }, onAction: () => {...}, }; });
If using a component, inputs are available as input properties.
@Component({...}) class MenuItemComponent { data = input.required<string>(); }
If using a template, inputs are available for binding via local template let declarations.
<ng-template let-data="data"> ... </ng-template>
Example for passing data via custom injector:
inject(WorkbenchService).registerViewMenuItem(() => { return { content: MenuItemComponent, onAction: () => {...}, injector: Injector.create({ parent: inject(Injector), providers: [ {provide: DI_TOKEN, useValue: 'value'}, ], }), }; });
- Menu items now require a
Deprecations
-
workbench: The configuration for displaying a start page in the workbench has changed.
-
For layouts with a main area:
The main area must now be navigated. Previously, no navigation was required and the component associated with the empty path route was used as the start page.Example for navigating the main area:
bootstrapApplication(AppComponent, { providers: [ provideWorkbench({ layout: factory => factory .addPart(MAIN_AREA) .navigatePart(MAIN_AREA, ['path/to/desktop']) }), provideRouter([ { path: 'path/to/desktop', component: DesktopComponent, } ]) ] });
Example for navigating the main area to the empty path route:
bootstrapApplication(AppComponent, { providers: [ provideWorkbench({ layout: factory => factory .addPart(MAIN_AREA) .navigatePart(MAIN_AREA, [], {hint: 'desktop'}) // pass hint to match a specific empty path route }), provideRouter([ { path: '', component: DesktopComponent, canMatch: [canMatchWorkbenchPart('desktop')] // match only if navigating with the specified hint } ]) ], });
-
For layouts without a main area:
Provide a desktop using an<ng-template>
with thewbDesktop
directive. The template content will be used as the desktop content. Previously, the component associated with the empty path route was used as the start page.<wb-workbench> <ng-template wbDesktop> Welcome </ng-template> </wb-workbench>
-
-
workbench: Properties for accessing a view's navigation details have changed.
Migrate as follows:
WorkbenchView.urlSegments
=>WorkbenchView.navigation.path
WorkbenchView.navigationHint
=>WorkbenchView.navigation.hint
WorkbenchView.navigationData
=>WorkbenchView.navigation.data
WorkbenchView.navigationState
=>WorkbenchView.navigation.state
19.0.0-beta.1 (@scion/workbench)
19.0.0-beta.1 (2024-12-13)
Dependencies
- workbench: update @scion/workbench to Angular 19 (e3f358f)
Chore
- workbench: remove deprecated workbench modules (df3eb4e)
BREAKING CHANGES
-
workbench: Updating
@scion/workbench
to Angular 19 introduced a breaking change.To migrate:
- Update your application to Angular 19; for detailed migration instructions, refer to https://v19.angular.dev/update-guide;
-
workbench: Removing deprecated workbench modules introduced the following breaking changes.
The following APIs have been removed:
WorkbenchModule.forRoot
=> register SCION Workbench providers usingprovideWorkbench
function and import standalone components and directives instead;WorkbenchModule.forChild
=> no replacement; import standalone workbench components and directives instead;WorkbenchTestingModule.forTest
=> no replacement; useprovideWorkbench
instead;provideWorkbenchForTest
=> no replacement; useprovideWorkbench
instead;
18.0.0-beta.10 (@scion/workbench)
18.0.0-beta.10 (2024-12-09)
Bug Fixes
- workbench/view: do not scroll the active tab into view when opening or closing an inactive tab (a5d4d7e)
- workbench/view: scroll the active tab into view when navigating the active tab (d10d25b)
Performance Improvements
- workbench: improve drag experience when dragging tabs in the tabbar (0ae78eb)
18.0.0-beta.9 (@scion/workbench)
18.0.0-beta.9 (2024-11-25)
Bug Fixes
- workbench/view: invoke
CanClose
guard in view injection context (07ba936), closes #578 - workbench/view: prevent
CanClose
guard from blocking workbench navigation (12e9e91), closes #558 - workbench/view: prevent closing views with a pending
CanClose
guard (4326a63)
Features
- workbench/view: add functional
CanClose
guard, deprecate class-based guard (c2ee531)
Deprecations
-
workbench/view: The class-based
CanClose
guard has been deprecated in favor of a functional guard that can be registered onWorkbenchView.canClose
.Migrate by registering a callback on
WorkbenchView.canClose
instead of implementing theCanClose
interface.Before migration:
import {CanClose} from '@scion/workbench'; import {Component} from '@angular/core'; @Component({}) export class ViewComponent implements CanClose { public canClose(): boolean { return true; } }
After migration:
import {Component, inject} from '@angular/core'; import {WorkbenchView} from '@scion/workbench'; @Component({}) export class ViewComponent { constructor() { inject(WorkbenchView).canClose(() => { return true; }); } }
1.0.0-beta.28 (@scion/workbench-client)
1.0.0-beta.28 (2024-11-25)
Features
- workbench-client/view: add functional
CanClose
guard, deprecate class-based guard (ecd52b3)
Deprecations
-
workbench-client/view: The class-based
CanClose
guard has been deprecated in favor of a functional guard that can be registered onWorkbenchView.canClose
.Migrate by registering a callback on
WorkbenchView.canClose
instead of implementing theCanClose
interface.Before migration:
import {CanClose, WorkbenchView} from '@scion/workbench-client'; import {Beans} from '@scion/toolkit/bean-manager'; export class ViewComponent implements CanClose { constructor() { Beans.get(WorkbenchView).addCanClose(this); } public canClose(): boolean { return true; } }
After migration:
import {WorkbenchView} from '@scion/workbench-client'; import {Beans} from '@scion/toolkit/bean-manager'; export class ViewComponent { constructor() { Beans.get(WorkbenchView).canClose(() => { return true; }); } }
18.0.0-beta.8 (@scion/workbench)
18.0.0-beta.8 (2024-10-28)
Bug Fixes
- workbench/popup: ensure the popup anchor not leaving view boundaries (c629f49)
- workbench/view: ensure view overlays align with view boundaries when view position changes (2998295)
Features
- workbench: prevent tracking unwanted dependencies in effects (7a7eaf8)
BREAKING CHANGES
-
workbench: SCION Workbench requires
@scion/toolkit
version1.6.0
or later. -
workbench: SCION Workbench requires
@scion/components
version18.1.1
or later. -
workbench: Calling following workbench methods in a reactive (tracking) context (e.g.,
effect
) now throws an error. Migrate by using Angular'suntracked()
function.WorkbenchRouter.navigate
WorkbenchService.registerPerspective
WorkbenchService.switchPerspective
WorkbenchService.resetPerspective
WorkbenchService.closeViews
WorkbenchService.switchTheme
WorkbenchService.registerPartAction
WorkbenchService.registerViewMenuItem
WorkbenchLauncher.launch
WorkbenchDialogService.open
WorkbenchMessageBoxService.open
NotificationService.notify
PopupService.open
WorkbenchPart.activate
WorkbenchView.activate
WorkbenchView.close
WorkbenchView.move
WorkbenchView.registerMenuItem
WorkbenchDialog.close
Popup.close
Migration Example
import {effect, inject, untracked} from '@angular/core'; import {WorkbenchRouter} from '@scion/workbench'; const workbenchRouter = inject(WorkbenchRouter); // Before effect(() => { if (someSignal()) { workbenchRouter.navigate(['path/to/view']); } }); // After effect(() => { if (someSignal()) { untracked(() => workbenchRouter.navigate(['path/to/view'])); } });
18.0.0-beta.7 (@scion/workbench)
18.0.0-beta.7 (2024-10-11)
Bug Fixes
1.0.0-beta.27 (@scion/workbench-client)
1.0.0-beta.27 (2024-10-11)
Bug Fixes
- workbench-client: position document root as required by @scion/toolkit (007e9c3)
18.0.0-beta.6 (@scion/workbench)
18.0.0-beta.6 (2024-09-11)
Bug Fixes
- workbench/messagebox: display message if opened from a
CanClose
guard of a microfrontend view (b0829b3), closes #591 - workbench/view: restore scroll position when switching views (9265951), closes #588
- workbench: disable change detection during navigation to prevent inconsistent layout rendering (68ecca7)
Features
- workbench/popup: support returning result on focus loss (ce5089e)
- workbench/view: enable translation of built-in context menu (9bfdf74)
BREAKING CHANGES
- workbench/popup: The method
closeWithError
has been removed from thePopup
handle. Instead, pass anError
object to theclose
method.
Before migration:
import {inject} from '@angular/core';
import {Popup} from '@scion/workbench';
inject(Popup).closeWithError('some error');
After migration:
import {inject} from '@angular/core';
import {Popup} from '@scion/workbench';
inject(Popup).close(new Error('some error'));
1.0.0-beta.26 (@scion/workbench-client)
1.0.0-beta.26 (2024-09-11)
Features
- workbench-client/popup: support returning result on focus loss (ce5089e)
BREAKING CHANGES
- workbench-client/popup: The method
closeWithError
has been removed from theWorkbenchPopup
handle. Instead, pass anError
object to theclose
method.
Before migration:
import {Beans} from '@scion/toolkit/bean-manager';
import {WorkbenchPopup} from '@scion/workbench-client';
Beans.get(WorkbenchPopup).closeWithError('some error');
After migration:
import {Beans} from '@scion/toolkit/bean-manager';
import {WorkbenchPopup} from '@scion/workbench-client';
Beans.get(WorkbenchPopup).close(new Error('some error'));