Vue binding for environment role selections.

The environment name will be grayed out until something besides the
default "no access" is selected.

Small changes to the application member subforms:
- filter for "None" as a string
- have nested forms inherit from FlaskForm; each nested form adds its
  own validation error flash otherwise if there are validation problems
This commit is contained in:
dandds
2019-04-25 09:56:37 -04:00
parent 9c84e30172
commit 054d030e15
4 changed files with 34 additions and 18 deletions

View File

@@ -5,7 +5,7 @@
{% set step_one %}
<div class="modal__form--header">
<h1>Invite new portfolio member</h1>
<h1>Invite new member</h1>
</div>
<div class='form-row'>
<div class='form-col form-col--half'>
@@ -62,20 +62,24 @@
</div>
</div>
{% for environment_data in member_form.environment_roles %}
<div class="usa-input">
<fieldset data-ally-disabled="true" class="form-row usa-input__choices">
<div class="form-col form-col--quarter">
<legend>
<div class="usa-input__title-inline">
{{ environment_data.environment_name.data }}
</div>
</legend>
</div>
<div class="form-col form-col--three-quarters">
{{ environment_data.role() }}
</div>
</fieldset>
</div>
<optionsinput inline-template
v-bind:initial-value="'{{ environment_data.role.data | string }}'"
>
<div class="usa-input">
<fieldset data-ally-disabled="true" class="form-row usa-input__choices">
<div class="form-col form-col--quarter">
<legend>
<div v-bind:class='["usa-input__title-inline", {"environment-name--gray": value === "None" }]'>
{{ environment_data.environment_name.data }}
</div>
</legend>
</div>
<div class="form-col form-col--three-quarters">
{{ environment_data.role(**{"v-model": "value"}) }}
</div>
</fieldset>
</div>
</optionsinput>
{{ environment_data.environment_id() }}
{% endfor %}
</div>