Merge branch 'features/household-validation' into features/household-edit-members-forms-improve-household

This commit is contained in:
2021-06-17 22:46:47 +02:00
42 changed files with 1674 additions and 42 deletions

View File

@@ -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
};

View File

@@ -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>

View File

@@ -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: {

View File

@@ -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">

View File

@@ -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>