oblique-bit / oblique

An Angular front-end framework Tailored for your swiss branded business web application, Oblique provides a standardized corporate design look and feel as well as a collection of ready-to-use Angular components. Oblique, through its fully customizable master layout, takes care of the application's structure, letting you focus on the content.
https://oblique.bit.admin.ch
MIT License
54 stars 13 forks source link

Allow to control "Unsaved changes" / ObUnsavedChangesService globaly #123

Closed WeslleyDeSouza closed 4 months ago

WeslleyDeSouza commented 7 months ago

Description

If the application has an auto-signoff feature due to session expiration, inactivity, the user should be automatically redirected to the login page. However, currently, if the user is on an open form with an active "Unsaved changes" directive, the redirection is prevented until they confirm leaving. This creates a situation where the user can remain on the page even though their session is no longer valid, potentially leading to issues.

image

image

Proposed solution


Not sure if this is provided in root but:

if non root instance then a global emitter to all ObUnsavedChangesService instances to disable or enable all of them at once.
If only 1 instance, then a function to disable or enable all at once.

We have some workaround ideas, but it would be great if "Unsaved changes" itself could offer this functionality.

Thanks alot

nina-egger commented 5 months ago

Hello @WeslleyDeSouza

I added this feature request to our board so the PO can evaluate it. The issue number is OUI-2988.

Regards Nina

nina-egger commented 5 months ago

Feature request has been accepted. Task is OUI-3010.

nina-egger commented 5 months ago

Issue here will now be closed.

nina-egger commented 4 months ago

I closed the wrong issue this one should be kept open. Sorry for the confusion

swiss-design-system commented 4 months ago

We target release 11.1.0 for oui-3010

gillerr commented 4 months ago

Hi @WeslleyDeSouza

This is actually a duplicate of https://github.com/oblique-bit/oblique/issues/13.

You can already deactivate the feature by injecting the ObUnsavedChangesService and setting its isActive property to false.