iTop icon indicating copy to clipboard operation
iTop copied to clipboard

🐛 Fix: 'cancel' button redirects to console instead of portal

Open jbostoen opened this issue 2 years ago • 4 comments

Before:

  1. Sign in to the portal, navigate to https://demo.combodo.com/simple/pages/exec.php/object/create/UserRequest?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal , press Cancel.
  2. User with console permissions is redirected to the back end instead of staying in the portal.

After PR: user with console permissions should stay in the portal. Either a simple 'go back 1 page' is executed, or the user is redirected to the portal's home page.

jbostoen avatar Jan 14 '23 11:01 jbostoen

I'm wondering if this now also messes up when the form was created by going to the services browser. As if I do that, clicking cancel on the modal, the modal is closed. If I make the form open as a new page by right clicking on the link, It just closes the window by clicking on cancel (Safari & FF 102) So in this scenario, everything works as expected.

Hipska avatar Jan 16 '23 08:01 Hipska

Accepted during technical review.

Molkobain avatar Feb 13 '23 13:02 Molkobain

Discussed during functional review:

  • Fix of the URL passed to the widget is accepted.
  • Change on the JS to go back to the previous page if any history is available is rejected. I missed it during the technical review, but this is done in the "apply close rule" function which is meant to close the page/form. Any redirection "back" to the previous page should be handle by the "back" redirection rule and is out of scope of this PR.

So long story short, revert the changes on the JS file and the PR will be good to merge :)

Molkobain avatar Feb 14 '23 16:02 Molkobain

Thanks for the feedback!

Well, it doesn't make sense the page would be "closed" at some point.

Image this scenario:

  1. User opens the portal. ( https://demo.combodo.com/simple/pages/exec.php/?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal )
  2. User gets redirected by an extension to the actual URL: https://demo.combodo.com/simple/pages/exec.php/object/create/UserRequest?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal (non-modal).
  3. Window should not be closed, IMHO?

Isn't the current logic only based on the assumption that the above URL is shown in a modal dialog (while this could be much more versatile, I'm using it outside a modal)?

jbostoen avatar Feb 14 '23 16:02 jbostoen