mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
Merge branch 'features/household-validation' into features/household-edit-members-forms-improve-household
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { ShowHide } from 'ShowHide/show_hide.js';
|
||||
|
||||
let
|
||||
k = document.getElementById('waitingForBirthContainer'),
|
||||
waitingForBirthDate = document.getElementById('waitingForBirthDateContainer')
|
||||
;
|
||||
|
||||
console.log(k );
|
||||
|
||||
new ShowHide({
|
||||
'container': [waitingForBirthDate],
|
||||
'froms': [k ],
|
||||
'event_name': 'input',
|
||||
'debug': true,
|
||||
'test': function(froms, event) {
|
||||
for (let f of froms.values()) {
|
||||
console.log(f);
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
return input.checked;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
@@ -16,32 +16,13 @@ const householdMove = (payload) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw Error('Error with testing move');
|
||||
});
|
||||
};
|
||||
|
||||
const householdMoveTest = (payload) => {
|
||||
const url = `/api/1.0/person/household/members/move/test.json`;
|
||||
return fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
.then(response => {
|
||||
if (response.status === 422) {
|
||||
return response.json();
|
||||
}
|
||||
if (response.ok) {
|
||||
// return an empty array if ok
|
||||
return new Promise((resolve, reject) => resolve({ violations: [] }) );
|
||||
}
|
||||
throw Error('Error with testing move');
|
||||
});
|
||||
};
|
||||
|
||||
export {
|
||||
householdMove,
|
||||
householdMoveTest
|
||||
};
|
||||
|
@@ -30,7 +30,7 @@
|
||||
<img src="~ChillMainAssets/img/draggable.svg" class="drag-icon" />
|
||||
<person :person="conc.person"></person>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="conc.person.birthdate !== null">
|
||||
{{ $t('person.born', {'gender': conc.person.gender} ) }}
|
||||
{{ $d(conc.person.birthdate.datetime, 'short') }}
|
||||
</div>
|
||||
|
@@ -12,6 +12,9 @@
|
||||
<li v-for="(msg, index) in warnings">
|
||||
{{ $t(msg.m, msg.a) }}
|
||||
</li>
|
||||
<li v-for="msg in errors">
|
||||
{{ msg }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
@@ -34,8 +37,9 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
warnings: (state) => state.warnings,
|
||||
hasNoWarnings: (state) => state.warnings.length === 0,
|
||||
hasWarnings: (state) => state.warnings.length > 0,
|
||||
errors: (state) => state.errors,
|
||||
hasNoWarnings: (state) => state.warnings.length === 0 && state.errors.length === 0,
|
||||
hasWarnings: (state) => state.warnings.length > 0 || state.errors.length > 0,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
{{ $t('household_members_editor.holder') }}
|
||||
</span>
|
||||
</div>
|
||||
<div>{{ $t('person.born', {'gender': conc.person.gender} ) }}</div>
|
||||
<div v-if="conc.person.birthdate !== null">{{ $t('person.born', {'gender': conc.person.gender} ) }}</div>
|
||||
</div>
|
||||
<div class="item-col box-where">
|
||||
<ul class="list-content fa-ul">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<span class="chill-entity chill-entity__person">
|
||||
<span class="chill-entity__person__text">
|
||||
<span class="chill-entity__person__text chill_denomination">
|
||||
{{ person.text }}
|
||||
</span>
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user