We're updating the issue view to help you get more done. 

Item locking does not work properly yet

Description

There are currently two problems:
• When the back-button or navigation is used, the article keeps locked while the user left the page.
• When the article is edited and the user clicks another item in the navigation, the changes are lost.

We need jQuery based javascript to solve this:
• The script needs to monitor if changed have been made to the form.
• When a user tries to leave the page with a href link on the page outside of the form:
o When changes have been made to the form: a Bootstrap model dialog (http://getbootstrap.com/javascript/#modals) must be shown with the question “You have unsaved changes. When you leave this page your changes will be lost.

Are you sure you want to leave this page?”
• To leave the page the href action must be canceled, the href URL must be added to the form in a hidden form field named “returnurl” and the cancel button must be fired. This releases the lock and after that the user will be redirected.

• When a user tries to leave the page with the back button we want the same behavior as the href link, if possible (without setting return URL is also OK if that’s not available). Otherwise please disable the back button completely.

• When a user tries to leave the page by typing another URL AND the form had changes please add a browser beforeunload window: “You have unsaved changes. When you leave this page your changes will be lost.

Are you sure you want to leave this page?” (http://stackoverflow.com/questions/1102618/how-to-prevent-the-user-to-change-page-with-jquery). I think it’s not possible to release the lock in this case.

Environment

None

Deployment actions

None

Technical tasks

None

Status

Assignee

Unassigned

Reporter

Marcel van Oene

Labels

None

Client

None

External issue ID

None

Follow up date

None

Code reviewer

Ger Jan van den Bosch

Developer

None

Plan date

None

Max. hours

None

Error message

None

Min. hours

None

Product owner

None

Refiner

None

Switches

None

Dev hour estimate

None

Fix versions

Priority