diff --git a/CHANGELOG_WORKBENCH_CLIENT.md b/CHANGELOG_WORKBENCH_CLIENT.md index af235c354..f25c6e3f1 100644 --- a/CHANGELOG_WORKBENCH_CLIENT.md +++ b/CHANGELOG_WORKBENCH_CLIENT.md @@ -1,3 +1,50 @@ +# [1.0.0-beta.28](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.27...workbench-client-1.0.0-beta.28) (2024-11-25) + + +### Features + +* **workbench-client/view:** add functional `CanClose` guard, deprecate class-based guard ([ecd52b3](https://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/ecd52b3afe82c0e1353cf96be550f925e76a72d5)) + + +### Deprecations + +* **workbench-client/view:** The class-based `CanClose` guard has been deprecated in favor of a functional guard that can be registered on `WorkbenchView.canClose`. + + Migrate by registering a callback on `WorkbenchView.canClose` instead of implementing the `CanClose` interface. + + **Before migration:** + ```ts + 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:** + ```ts + import {WorkbenchView} from '@scion/workbench-client'; + import {Beans} from '@scion/toolkit/bean-manager'; + + export class ViewComponent { + + constructor() { + Beans.get(WorkbenchView).canClose(() => { + return true; + }); + } + } + ``` + + # [1.0.0-beta.27](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.26...workbench-client-1.0.0-beta.27) (2024-10-11) diff --git a/CHANGELOG_WORKBENCH_CLIENT_LATEST.md b/CHANGELOG_WORKBENCH_CLIENT_LATEST.md index 704e201ce..c5da51672 100644 --- a/CHANGELOG_WORKBENCH_CLIENT_LATEST.md +++ b/CHANGELOG_WORKBENCH_CLIENT_LATEST.md @@ -1,9 +1,45 @@ -# [1.0.0-beta.27](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.26...workbench-client-1.0.0-beta.27) (2024-10-11) +# [1.0.0-beta.28](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.27...workbench-client-1.0.0-beta.28) (2024-11-25) -### Bug Fixes +### Features -* **workbench-client:** position document root as required by `@scion/toolkit` ([007e9c3](https://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/007e9c396dff4c2dde11c62d810b5997c034eca2)) +* **workbench-client/view:** add functional `CanClose` guard, deprecate class-based guard ([ecd52b3](https://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/ecd52b3afe82c0e1353cf96be550f925e76a72d5)) +### Deprecations +* **workbench-client/view:** The class-based `CanClose` guard has been deprecated in favor of a functional guard that can be registered on `WorkbenchView.canClose`. + + Migrate by registering a callback on `WorkbenchView.canClose` instead of implementing the `CanClose` interface. + + **Before migration:** + ```ts + 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:** + ```ts + import {WorkbenchView} from '@scion/workbench-client'; + import {Beans} from '@scion/toolkit/bean-manager'; + + export class ViewComponent { + + constructor() { + Beans.get(WorkbenchView).canClose(() => { + return true; + }); + } + } + ``` diff --git a/docs/site/changelog-workbench-client/changelog.md b/docs/site/changelog-workbench-client/changelog.md index fc6a60602..2e73f0ebb 100644 --- a/docs/site/changelog-workbench-client/changelog.md +++ b/docs/site/changelog-workbench-client/changelog.md @@ -6,6 +6,53 @@ ## [Changelog][menu-changelog] > Workbench Client (@scion/workbench-client) +# [1.0.0-beta.28](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.27...workbench-client-1.0.0-beta.28) (2024-11-25) + + +### Features + +* **workbench-client/view:** add functional `CanClose` guard, deprecate class-based guard ([ecd52b3](https://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/ecd52b3afe82c0e1353cf96be550f925e76a72d5)) + + +### Deprecations + +* **workbench-client/view:** The class-based `CanClose` guard has been deprecated in favor of a functional guard that can be registered on `WorkbenchView.canClose`. + + Migrate by registering a callback on `WorkbenchView.canClose` instead of implementing the `CanClose` interface. + + **Before migration:** + ```ts + 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:** + ```ts + import {WorkbenchView} from '@scion/workbench-client'; + import {Beans} from '@scion/toolkit/bean-manager'; + + export class ViewComponent { + + constructor() { + Beans.get(WorkbenchView).canClose(() => { + return true; + }); + } + } + ``` + + # [1.0.0-beta.27](https://github.com/SchweizerischeBundesbahnen/scion-workbench/compare/workbench-client-1.0.0-beta.26...workbench-client-1.0.0-beta.27) (2024-10-11) diff --git a/projects/scion/workbench-client/package.json b/projects/scion/workbench-client/package.json index a7ab344dd..729494940 100644 --- a/projects/scion/workbench-client/package.json +++ b/projects/scion/workbench-client/package.json @@ -1,6 +1,6 @@ { "name": "@scion/workbench-client", - "version": "1.0.0-beta.27", + "version": "1.0.0-beta.28", "description": "SCION Workbench Client provides core API for a web app to interact with SCION Workbench and other microfrontends. It is a pure TypeScript library based on the framework-agnostic `@scion/microfrontend-platform` library and can be used with any web stack.", "license": "EPL-2.0", "private": false,