Watch for changes on the options input, which is a grandchild of base-form
This commit is contained in:
parent
5692088837
commit
416ea1de82
@ -1,8 +1,11 @@
|
|||||||
import { emitEvent } from '../lib/emitters'
|
import { emitEvent } from '../lib/emitters'
|
||||||
|
import FormMixin from '../mixins/form'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'optionsinput',
|
name: 'optionsinput',
|
||||||
|
|
||||||
|
mixins: [FormMixin],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
name: String,
|
name: String,
|
||||||
initialErrors: {
|
initialErrors: {
|
||||||
@ -10,6 +13,10 @@ export default {
|
|||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
initialValue: String,
|
initialValue: String,
|
||||||
|
watch: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
@ -27,6 +34,7 @@ export default {
|
|||||||
emitEvent('field-change', this, {
|
emitEvent('field-change', this, {
|
||||||
value: e.target.value,
|
value: e.target.value,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
watch: this.watch,
|
||||||
})
|
})
|
||||||
this.showError = false
|
this.showError = false
|
||||||
this.showValid = true
|
this.showValid = true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import FormMixin from '../mixins/form'
|
import FormMixin from '../mixins/form'
|
||||||
import textinput from './text_input'
|
|
||||||
import optionsinput from './options_input'
|
import optionsinput from './options_input'
|
||||||
|
import textinput from './text_input'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'toggler',
|
name: 'toggler',
|
||||||
|
@ -16,8 +16,7 @@ export default {
|
|||||||
const { name, valid, parent_uid } = event
|
const { name, valid, parent_uid } = event
|
||||||
if (typeof this[name] !== undefined) {
|
if (typeof this[name] !== undefined) {
|
||||||
this.fields[name] = valid
|
this.fields[name] = valid
|
||||||
|
if (event['parent_uid'] === this._uid || event['watch']) {
|
||||||
if (parent_uid === this._uid) {
|
|
||||||
this.changed = true
|
this.changed = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,7 @@ table {
|
|||||||
@include h4;
|
@include h4;
|
||||||
|
|
||||||
font-size: $lead-font-size;
|
font-size: $lead-font-size;
|
||||||
|
justify-content: space-between;
|
||||||
flex: 2;
|
flex: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
{% from "components/tooltip.html" import Tooltip %}
|
{% from "components/tooltip.html" import Tooltip %}
|
||||||
|
|
||||||
{% macro OptionsInput(field, tooltip, inline=False, label=True, disabled=False) -%}
|
{% macro OptionsInput(field, tooltip, inline=False, label=True, disabled=False, watch=False) -%}
|
||||||
<optionsinput
|
<optionsinput
|
||||||
name='{{ field.name }}'
|
name='{{ field.name }}'
|
||||||
inline-template
|
inline-template
|
||||||
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
|
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
|
||||||
{% if field.data and field.data != "None" %}v-bind:initial-value="'{{ field.data }}'"{% endif %}
|
{% if field.data and field.data != "None" %}v-bind:initial-value="'{{ field.data }}'"{% endif %}
|
||||||
key='{{ field.name }}'
|
key='{{ field.name }}'
|
||||||
|
v-bind:watch='{{ watch | string | lower }}'
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
<li class="accordion-table__item">
|
<li class="accordion-table__item">
|
||||||
<div class="accordion-table__item-content row">
|
<div class="accordion-table__item-content row">
|
||||||
<div class="col col--grow">{{ member_form.user_name.data }}</div>
|
<div class="col col--grow">{{ member_form.user_name.data }}</div>
|
||||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_team_mgmt, label=False) }}</div>
|
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_team_mgmt, label=False, watch=True) }}</div>
|
||||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_env_mgmt, label=False) }}</div>
|
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_env_mgmt, label=False, watch=True) }}</div>
|
||||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_del_env, label=False) }}</div>
|
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_del_env, label=False, watch=True) }}</div>
|
||||||
<div class="col col--grow icon-link icon-link--large accordion-table__item__toggler">
|
<div class="col col--grow icon-link icon-link--large accordion-table__item__toggler">
|
||||||
{% set open_html %}
|
{% set open_html %}
|
||||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ environment_roles_form | length }}) {{ Icon('caret_down') }}
|
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ environment_roles_form | length }}) {{ Icon('caret_down') }}
|
||||||
|
@ -32,11 +32,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<header>
|
<header>
|
||||||
<div class="responsive-table-wrapper__header">
|
<div class="responsive-table-wrapper__header">
|
||||||
<div class="responsive-table-wrapper__title">
|
<div class="responsive-table-wrapper__title row">
|
||||||
<div class="h3">
|
<div class="h3">
|
||||||
{{ "portfolios.applications.team_settings.section.title" | translate({ "application_name": application.name }) }}
|
{{ "portfolios.applications.team_settings.section.title" | translate({ "application_name": application.name }) }}
|
||||||
</div>
|
</div>
|
||||||
<a class='icon-link'>
|
<a class="icon-link">
|
||||||
{{ Icon('info') }}
|
{{ Icon('info') }}
|
||||||
{{ "portfolios.admin.settings_info" | translate }}
|
{{ "portfolios.admin.settings_info" | translate }}
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user