Skip to content
Snippets Groups Projects
Commit 2159f267 authored by Emmanuel Salomon's avatar Emmanuel Salomon :fist:
Browse files

Remove neighbor method

parent d4ae1931
No related branches found
No related tags found
No related merge requests found
...@@ -6,31 +6,31 @@ ...@@ -6,31 +6,31 @@
<tbody> <tbody>
<tr <tr
v-for="certif in certifsPending" v-for="certif in certifsPending"
:key="getNeighbor(certif).uid + certif.expires_on" :key="certif.uid + certif.expires_on"
@click=" @click="
$router.push( $router.push(
localePath({ localePath({
name: 'membres-hash', name: 'membres-hash',
params: { hash: getNeighbor(certif).hash } params: { hash: certif.hash }
}) })
) )
"> ">
<th scope="row" class="py-1"> <th scope="row" class="py-1">
<div> <div>
{{ getNeighbor(certif).uid }} {{ certif.uid }}
<BadgeDanger <BadgeDanger
:limitDate="getNeighbor(certif).received_certifications.limit" :limitDate="certif.received_certifications.limit"
:memberStatus="getNeighbor(certif).status" /> :memberStatus="certif.status" />
<BadgeQuality <BadgeQuality
:quality="getNeighbor(certif).quality.ratio" :quality="certif.quality.ratio"
v-if="getNeighbor(certif).status != 'REVOKED'" /> v-if="certif.status != 'REVOKED'" />
</div> </div>
<div> <div>
<BadgeStatus :membre="getNeighbor(certif)" /> <BadgeStatus :membre="certif" />
<BadgeDispo <BadgeDispo
:isDispo="getNeighbor(certif).minDatePassed" :isDispo="certif.minDatePassed"
:dateDispo="getNeighbor(certif).minDate" :dateDispo="certif.minDate"
v-if="getNeighbor(certif).status == 'MEMBER'" /> v-if="certif.status == 'MEMBER'" />
</div> </div>
</th> </th>
<td class="text-right py-1"> <td class="text-right py-1">
...@@ -105,32 +105,32 @@ ...@@ -105,32 +105,32 @@
<tbody> <tbody>
<tr <tr
v-for="certif in certifsTriees" v-for="certif in certifsTriees"
:key="getNeighbor(certif).uid + certif.expires_on" :key="certif.uid + certif.expires_on"
@click=" @click="
$router.push( $router.push(
localePath({ localePath({
name: 'membres-hash', name: 'membres-hash',
params: { hash: getNeighbor(certif).hash } params: { hash: certif.hash }
}) })
) )
"> ">
<th scope="row" class="py-1"> <th scope="row" class="py-1">
<div> <div>
<span v-if="$isFavourite(getNeighbor(certif).uid)">&nbsp;</span> <span v-if="$isFavourite(certif.uid)">&nbsp;</span>
{{ getNeighbor(certif).uid }} {{ certif.uid }}
<BadgeDanger <BadgeDanger
:limitDate="getNeighbor(certif).received_certifications.limit" :limitDate="certif.received_certifications.limit"
:memberStatus="getNeighbor(certif).status" /> :memberStatus="certif.status" />
<BadgeQuality <BadgeQuality
:quality="getNeighbor(certif).quality.ratio" :quality="certif.quality.ratio"
v-if="getNeighbor(certif).status != 'REVOKED'" /> v-if="certif.status != 'REVOKED'" />
</div> </div>
<div> <div>
<BadgeStatus :membre="getNeighbor(certif)" /> <BadgeStatus :membre="certif" />
<BadgeDispo <BadgeDispo
:isDispo="getNeighbor(certif).minDatePassed" :isDispo="certif.minDatePassed"
:dateDispo="getNeighbor(certif).minDate" :dateDispo="certif.minDate"
v-if="getNeighbor(certif).status == 'MEMBER'" /> v-if="certif.status == 'MEMBER'" />
</div> </div>
</th> </th>
<td class="text-right py-1"> <td class="text-right py-1">
...@@ -170,9 +170,6 @@ export default { ...@@ -170,9 +170,6 @@ export default {
} }
}, },
methods: { methods: {
getNeighbor(certif) {
return this.type == "received" ? certif.from : certif.to
},
sort(s) { sort(s) {
if (s === this.currentSort) { if (s === this.currentSort) {
this.currentSortDir = this.currentSortDir === "asc" ? "desc" : "asc" this.currentSortDir = this.currentSortDir === "asc" ? "desc" : "asc"
...@@ -183,7 +180,6 @@ export default { ...@@ -183,7 +180,6 @@ export default {
computed: { computed: {
certifsTriees() { certifsTriees() {
return this.certifs return this.certifs
.slice()
.sort((a, b) => { .sort((a, b) => {
let modifier = this.currentSortDir === "desc" ? -1 : 1 let modifier = this.currentSortDir === "desc" ? -1 : 1
let sens = this.type == "received" ? "from" : "to" let sens = this.type == "received" ? "from" : "to"
...@@ -200,17 +196,20 @@ export default { ...@@ -200,17 +196,20 @@ export default {
return 0 return 0
}) })
.filter((el) => { .filter((el) => el.pending == false)
return el.pending == false .map(certif => ({
}) ...certif,
...(this.type === 'received' ? certif.from : certif.to)
}))
}, },
certifsPending() { certifsPending() {
return this.certifs return this.certifs
.slice()
.sort((a, b) => a.expires_on - b.expires_on) .sort((a, b) => a.expires_on - b.expires_on)
.filter((el) => { .filter((el) => el.pending == true)
return el.pending == true .map(certif => ({
}) ...certif,
...(this.type === 'received' ? certif.from : certif.to)
}))
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment