Verified Commit 39c9c9ac authored by Korko's avatar Korko
Browse files

Fix participants exclusions reactivity + loc for Redo button

parent 9e8e6a80
Pipeline #369395 failed with stages
in 1 minute and 47 seconds
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,7 +28,7 @@
<span>{{ $t(`common.email.status.${delivery_status}`) }} <i :class="[icon, delivery_status]"></i></span>
<button :disabled="delivery_status === 'created' || disabled" type="button" class="btn btn-outline-secondary" @click="$emit('redo')">
<i class="fas fa-redo" />
Redo
{{ $t(`common.email.redo`) }}
</button>
</div>
</template>
......
......@@ -22,8 +22,8 @@
type: Array,
default: () => []
},
names: {
type: Object,
all: {
type: Array,
required: true
},
required: {
......@@ -40,8 +40,10 @@
}
},
computed: {
otherNames() {
return Object.values(this.names).filter(name => name !== this.name);
otherParticipants() {
var participants = this.all.map((participant, idx) => {participant.idx = idx; return participant;});
participants.splice(this.idx, 1);
return participants;
}
},
created: function() {
......@@ -107,7 +109,9 @@
</td>
<td class="border-right text-left participant-exclusions-wrapper align-middle">
<multiselect
:options="otherNames"
:options="otherParticipants"
label="name"
track-by="idx"
:value="exclusions"
:placeholder="$t('form.participant.exclusions.placeholder')"
:multiple="true"
......@@ -127,10 +131,10 @@
<select style="display:none" :name="'participants[' + idx + '][exclusions][]'" multiple>
<option
v-for="exclusion in exclusions"
:key="exclusion"
:value="Object.keys(names).find(idx => names[idx] === exclusion)"
:key="exclusion.idx"
:value="exclusion.idx"
selected
>{{ exclusions }}</option>
>{{ exclusion.idx }}</option>
</select>
</td>
<td class="participant-remove-wrapper align-middle">
......
......@@ -89,18 +89,6 @@
}
},
computed: {
participantNames() {
var names = {};
this.participants.forEach((participant, idx) => {
if (participant.name) {
names[idx] = participant.name;
}
});
return names;
}
},
watch: {
sent(newVal) {
// If sent is a success, scroll to the message
......@@ -284,7 +272,7 @@
:name="participant.name"
:email="participant.email"
:exclusions="participant.exclusions"
:names="participantNames"
:all="participants"
:required="idx < 3 && participants.length <= 3"
:field-error="fieldError"
:$v="$v.participants.$each[idx]"
......
This diff is collapsed.
......@@ -20,6 +20,7 @@ return [
],
'email' => [
'redo' => 'Ré-envoyer',
'status' => [
'created' => 'En attente d\'envoi',
'sending' => 'Envoi en cours',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment