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

@@ -1,3 +1,4 @@
from flask_wtf import FlaskForm
from wtforms.fields import FormField, FieldList, HiddenField, BooleanField
from .forms import BaseForm
@@ -8,13 +9,18 @@ from atst.domain.permission_sets import PermissionSets
from atst.utils.localization import translate
class EnvironmentForm(BaseForm):
class EnvironmentForm(FlaskForm):
environment_id = HiddenField()
environment_name = HiddenField()
role = SelectField(environment_name, choices=ENV_ROLES, default=None)
role = SelectField(
environment_name,
choices=ENV_ROLES,
default=None,
filters=[lambda x: None if x == "None" else x],
)
class PermissionsForm(BaseForm):
class PermissionsForm(FlaskForm):
perms_env_mgmt = BooleanField(
translate("portfolios.applications.members.new.manage_envs"), default=False
)