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:
@@ -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
|
||||
)
|
||||
|
Reference in New Issue
Block a user