Merge remote-tracking branch 'origin/issue433_email_addPerson' into issue345_internal_thirdparty_contact

This commit is contained in:
2022-02-04 11:09:51 +01:00
11 changed files with 88 additions and 50 deletions

View File

@@ -70,7 +70,7 @@
:buttonText="$t('onthefly.create.button', {q: query})"
action="create"
@saveFormOnTheFly="saveFormOnTheFly"
:canCloseModal="canCloseOnTheFlyModal">
ref="onTheFly">
</on-the-fly>
</div>
@@ -122,7 +122,6 @@ export default {
selected: [],
priorSuggestion: {}
},
canCloseOnTheFlyModal: false
}
},
computed: {
@@ -272,7 +271,7 @@ export default {
makeFetch('POST', '/api/1.0/person/person.json', data)
.then(response => {
this.newPriorSuggestion(response);
this.canCloseOnTheFlyModal = true;
this.$refs.onTheFly.closeModal();
})
.catch((error) => {
if (error.name === 'ValidationException') {
@@ -288,7 +287,7 @@ export default {
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
.then(response => {
this.newPriorSuggestion(response);
this.canCloseOnTheFlyModal = true;
this.$refs.onTheFly.closeModal();
})
.catch((error) => {
if (error.name === 'ValidationException') {
@@ -300,7 +299,6 @@ export default {
}
})
}
this.canCloseOnTheFlyModal = false;
}
},
}

View File

@@ -43,10 +43,11 @@
<label for="firstname">{{ $t('person.firstname') }}</label>
</div>
<div v-for="(a) in config.altNames" :key="a.key" class="form-floating mb-3">
<div v-for="(a, i) in config.altNames" :key="a.key" class="form-floating mb-3">
<input
class="form-control form-control-lg"
:id="a.key"
:value="personAltNamesLabels[i]"
@input="onAltNameInput"
/>
<label :for="a.key">{{ a.labels.fr }}</label>
@@ -199,6 +200,9 @@ export default {
},
feminized() {
return (this.person.gender === 'woman')? 'e' : '';
},
personAltNamesLabels() {
return this.person.altNames.map(a => a ? a.label : '');
}
},
mounted() {