Detangle the MultiStepModalForm modal-open link from the modal.
In order to place modal forms in other places on the page (so that forms are not nested) it's necessary to move MultiStepModalForm links out of the component. They just need to refer to the correct modal. This PR also makes changes to ensure that the active modal is being unset everywhere correctly when a modal is closed.
This commit is contained in:
@@ -80,6 +80,4 @@
|
||||
member_form,
|
||||
url_for("portfolios.create_member", portfolio_id=portfolio.id),
|
||||
[step_one, step_two],
|
||||
button_text=("portfolios.admin.add_new_member" | translate),
|
||||
button_icon="plus",
|
||||
) }}
|
||||
|
@@ -69,14 +69,15 @@
|
||||
{% endset %}
|
||||
|
||||
<div class="flex-reverse-row">
|
||||
<a class="usa-button-primary" v-on:click="openModal('change-ppoc-form')">
|
||||
{{ "fragments.ppoc.update_btn" | translate }}
|
||||
</a>
|
||||
{{
|
||||
MultiStepModalForm(
|
||||
'change-ppoc-form',
|
||||
assign_ppoc_form,
|
||||
form_action=url_for("portfolios.update_ppoc", portfolio_id=portfolio.id),
|
||||
steps=[step_one, step_two],
|
||||
button_text=("fragments.ppoc.update_btn" | translate),
|
||||
link_classes="usa-button-primary"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
|
@@ -66,6 +66,11 @@
|
||||
|
||||
{% if user_can(permissions.CREATE_PORTFOLIO_USERS) %}
|
||||
{% include "fragments/admin/add_new_portfolio_member.html" %}
|
||||
<a class="icon-link modal-link" v-on:click="openModal('add-port-mem')">
|
||||
{{ "portfolios.admin.add_new_member" | translate }}
|
||||
|
||||
{{ Icon("plus") }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,15 +0,0 @@
|
||||
{% from "components/multi_step_modal_form.html" import MultiStepModalForm %}
|
||||
|
||||
{% import "fragments/applications/new_member_modal_content.html" as member_steps %}
|
||||
|
||||
{{ MultiStepModalForm(
|
||||
name='add-app-mem',
|
||||
form=new_member_form,
|
||||
form_action=url_for("applications.create_member", application_id=application.id),
|
||||
steps=[
|
||||
member_steps.MemberStepOne(new_member_form),
|
||||
member_steps.MemberStepTwo(new_member_form, application)
|
||||
],
|
||||
button_text=("portfolios.admin.add_new_member" | translate),
|
||||
button_icon="plus",
|
||||
) }}
|
Reference in New Issue
Block a user