Update edit app member form so the save button becomes active on change
This commit is contained in:
parent
e341a73dd1
commit
6de02e874b
@ -6,6 +6,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
name: String,
|
name: String,
|
||||||
initialChecked: Boolean,
|
initialChecked: Boolean,
|
||||||
|
optional: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
@ -18,7 +19,7 @@ export default {
|
|||||||
emitEvent('field-mount', this, {
|
emitEvent('field-mount', this, {
|
||||||
optional: this.optional,
|
optional: this.optional,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
valid: this.isChecked,
|
valid: this.optional || this.isChecked,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ export default {
|
|||||||
emitEvent('field-change', this, {
|
emitEvent('field-change', this, {
|
||||||
value: e.target.checked,
|
value: e.target.checked,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
valid: this.isChecked,
|
valid: this.optional || this.isChecked,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -4,12 +4,14 @@
|
|||||||
inline=False,
|
inline=False,
|
||||||
classes="",
|
classes="",
|
||||||
key=field.name,
|
key=field.name,
|
||||||
id=field.name) -%}
|
id=field.name,
|
||||||
|
optional=False) -%}
|
||||||
<checkboxinput
|
<checkboxinput
|
||||||
name='{{ field.name }}'
|
name='{{ field.name }}'
|
||||||
inline-template
|
inline-template
|
||||||
key='{{ key }}'
|
key='{{ key }}'
|
||||||
v-bind:initial-checked='{{ field.data|string|lower }}'
|
v-bind:initial-checked='{{ field.data|string|lower }}'
|
||||||
|
v-bind:optional={{ optional|lower }}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class='usa-input {{ classes }} {% if field.errors %}usa-input--error{% endif %}' v-bind:class="[{ 'checked': isChecked }]">
|
<div class='usa-input {{ classes }} {% if field.errors %}usa-input--error{% endif %}' v-bind:class="[{ 'checked': isChecked }]">
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
{% set del_env = "perms_del_env-{}".format(member_role_id) %}
|
{% set del_env = "perms_del_env-{}".format(member_role_id) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ CheckboxInput(app_perms_form.perms_team_mgmt, classes="input__inline-fields", key=team_mgmt, id=team_mgmt) }}
|
{{ CheckboxInput(app_perms_form.perms_team_mgmt, classes="input__inline-fields", key=team_mgmt, id=team_mgmt, optional=True) }}
|
||||||
{{ CheckboxInput(app_perms_form.perms_env_mgmt, classes="input__inline-fields", key=env_mgmt, id=env_mgmt) }}
|
{{ CheckboxInput(app_perms_form.perms_env_mgmt, classes="input__inline-fields", key=env_mgmt, id=env_mgmt, optional=True) }}
|
||||||
{{ CheckboxInput(app_perms_form.perms_del_env, classes="input__inline-fields", key=del_env, id=del_env) }}
|
{{ CheckboxInput(app_perms_form.perms_del_env, classes="input__inline-fields", key=del_env, id=del_env, optional=True) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="environment_roles environment-roles-new">
|
<div class="environment_roles environment-roles-new">
|
||||||
<h4>{{ "portfolios.applications.members.form.env_access" | translate }}</h4>
|
<h4>{{ "portfolios.applications.members.form.env_access" | translate }}</h4>
|
||||||
@ -25,9 +25,10 @@
|
|||||||
<optionsinput inline-template
|
<optionsinput inline-template
|
||||||
v-bind:initial-value="'{{ environment_data.role.data | string }}'"
|
v-bind:initial-value="'{{ environment_data.role.data | string }}'"
|
||||||
v-bind:name="'{{ environment_data.name | string }}'"
|
v-bind:name="'{{ environment_data.name | string }}'"
|
||||||
v-bind:optional="true">
|
v-bind:optional="true"
|
||||||
|
v-bind:watch="true">
|
||||||
<div class="usa-input">
|
<div class="usa-input">
|
||||||
<fieldset data-ally-disabled="true" class="usa-input__choices">
|
<fieldset data-ally-disabled="true" v-on:change="onInput" class="usa-input__choices">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-col form-col--two-thirds">
|
<div class="form-col form-col--two-thirds">
|
||||||
<legend>
|
<legend>
|
||||||
|
@ -127,17 +127,16 @@
|
|||||||
<h1>{{ Icon('avatar') }} {{ member.user_name }}</h1>
|
<h1>{{ Icon('avatar') }} {{ member.user_name }}</h1>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<form id='{{ modal_name }}' method="POST" action="{{ url_for('applications.update_member', application_id=application.id, application_role_id=member.role_id) }}">
|
<base-form inline-template>
|
||||||
{{ member.form.csrf_token }}
|
<form id='{{ modal_name }}' method="POST" action="{{ url_for('applications.update_member', application_id=application.id, application_role_id=member.role_id) }}">
|
||||||
{{ MemberPermsFields(app_perms_form=member.form, env_roles_form=member.form.environment_roles, member_role_id=member.role_id) }}
|
{{ member.form.csrf_token }}
|
||||||
<div class="action-group">
|
{{ MemberPermsFields(app_perms_form=member.form, env_roles_form=member.form.environment_roles, member_role_id=member.role_id) }}
|
||||||
<input
|
<div class="action-group">
|
||||||
type="submit"
|
{{ SaveButton(text='Update', element='input', additional_classes='action-group__action') }}
|
||||||
class='action-group__action usa-button'
|
<a class='action-group__action usa-button usa-button-secondary' v-on:click="closeModal('{{ modal_name }}')">{{ "common.cancel" | translate }}</a>
|
||||||
value='Update'>
|
</div>
|
||||||
<a class='action-group__action usa-button usa-button-secondary' v-on:click="closeModal('{{ modal_name }}')">{{ "common.cancel" | translate }}</a>
|
</form>
|
||||||
</div>
|
</base-form>
|
||||||
</form>
|
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<table>
|
<table>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user