IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

feat: new go_to action argument: dismiss_on_return #2134

Closed jfmcquade closed 10 months ago

jfmcquade commented 10 months ago

PR Checklist

Description

Offers a workaround for #2120. Please see this comment on that issue for context.

Adds a parameter to the go_to action, dismiss_on_return, to be used in the specific case of using a go_to from an active pop-up. If this parameter is passed true, then on returning to the parent template from which the pop-up was launched, the pop-up will be closed.

Whilst the dismiss_on_return action arg does what it says on the tin and so is potentially a legitimate feature, it is a workaround/hack for our current use case and doesn't fully demonstrate the desired functionality. The intermediary template (the pop-up) will dismiss on return to the parent template regardless of how the user navigates there. This is to say, it will not only dismiss when a completed/uncompleted action has been emitted by the child template, it will also dismiss, for example, when the user navigates back from the child template using the back button. A true fix for #2120 would pass information back from the child template and only dismiss the intermediary template in the case of a completed/uncompleted emission from the child template (see the comment on the issue).

Git Issues

On merge, #2120 should probably be closed and a new issue should be made to capture the desired nav/pop-up functionality

Screenshots/Videos

Updated debug_pop_up_return template:

Screenshot 2023-11-06 at 16 58 18

Demo

https://github.com/IDEMSInternational/parenting-app-ui/assets/64838927/f5987ee5-d419-4fae-9e32-6ad04ce3c86a