Portfolio manager invite updates:

- Update the form to use BooleanFields for the permissions and make the
form more similar to the Application Members form
- Use MemberFormTemplate macro in the portfolio settings template
- fix tests affected by the form changes
This commit is contained in:
leigh-mil
2020-01-03 16:03:32 -05:00
parent 4d2a175136
commit 79b2773852
10 changed files with 106 additions and 133 deletions

View File

@@ -1,7 +1,10 @@
{% from "components/icon.html" import Icon %}
{% from 'components/save_button.html' import SaveButton %}
{% from "components/modal.html" import Modal %}
{% from "components/alert.html" import Alert %}
{% from "components/icon.html" import Icon %}
{% import "components/member_form_template.html" as member_form %}
{% from "components/modal.html" import Modal %}
{% from "components/multi_step_modal_form.html" import MultiStepModalForm %}
{% from 'components/save_button.html' import SaveButton %}
{% import "portfolios/fragments/add_new_portfolio_member.html" as member_form_fields %}
<h3>Portfolio Managers</h3>
<div class="panel">
@@ -43,7 +46,30 @@
</section>
{% if user_can(permissions.CREATE_PORTFOLIO_USERS) %}
<a href="#" class="usa-button usa-button-secondary add-new-button">Add Portfolio Manager</a>
{% include "portfolios/fragments/add_new_portfolio_member.html" %}
{% set new_manager_modal = "add-portfolio-manager" %}
<a class="usa-button usa-button-secondary add-new-button" v-on:click="openModal('{{ new_manager_modal }}')">
Add Portfolio Manager
</a>
{{ MultiStepModalForm(
name=new_manager_modal,
form=new_manager_form,
form_action=url_for("portfolios.invite_member", portfolio_id=portfolio.id),
steps=[
member_form.BasicStep(
title="Add Manager",
form=member_form_fields.InfoFields(new_manager_form.user_data),
next_button_text="Next: Permissions",
previous=False,
modal=new_manager_modal_name,
),
member_form.SubmitStep(
name=new_manager_modal,
form=member_form_fields.PermsFields(new_manager_form),
submit_text="Invite member",
modal=new_manager_modal_name,
)
],
) }}
{% endif %}
</div>