Activating scoped application "GRC: Policy and Compliance Management" users are able to see the request Extension button on Policy Exception form at the bottom of the form page even after requesting extension, until you refresh the page.
Steps to Reproduce
1. Install Policy and Compliance Plugin
2. Navigate to 'My Policy Exceptions'
3. Click on New
4. Fill in mandatory fields and save
5. Click on 'Request Approval'
6. Fill in mandatory fields (Approver, Risk rating) and Save
7. Click on 'Approve'
8. Click 'Request Extension', set a date for extension and click 'Request'
9. NOTE: Do not refresh the page !!!!
10. Scroll down and you will see that the 'Request Extension' UI action is still available at the bottom of the form (though is not visible at the top of the page)
The user can repeatedly keep clicking the 'Request Extension' UI action at the bottom of the form page over and over again even though a request extension has already been raised.
Once you refresh the page the UI action at the bottom of the form is no longer visible.
On click of request extension button present on the top right of the form, a request extension pop up appears. After entering the valid date and requesting extension, the Request extension button on the top right disappears but the Request extension button at the bottom is still present. This happens because on click of "add_extension" button on the pop up, the UI page calls the addExtension() function which checks whether the date provided is valid or not and if it is valid then the "Request Extension" UI action at the top is hidden, but here the code for hiding the bottom "Request Extension" button is missing. To fix the issue, please follow the below steps:
- Navigate to 'add_extention' UI Page on Policy Exception.
- Replace the below existing piece of code with the modified piece of code in the addExtension() function of the client script.
----------------- EXISTING SCRIPT ------------------
----------------- MODIFIED SCRIPT -----------------
Related Problem: PRB1436834