Skip to content
Snippets Groups Projects
Commit 52675483 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

add nbPendingCertif on CertifList + correct a duplicated computed property on membre.vue

parent 23ee6d75
No related branches found
No related tags found
No related merge requests found
......@@ -9,9 +9,11 @@
{{
isDispo
? $t("membre.dispo")
: $t("membre.nodispo") +
" > " +
$d(new Date(dateDispo * 1000), "short")
: "⏱ " +
nbPendingCertifs +
" ( " +
$d(new Date(dateDispo * 1000), "short") +
")"
}}
</span>
</small>
......@@ -26,6 +28,16 @@ export default {
},
dateDispo: {
type: Number
},
certifs: {
type: Array
}
},
computed: {
nbPendingCertifs() {
return this.certifs.filter((el) => {
return el.pending == true
}).length
}
}
}
......
......@@ -30,6 +30,7 @@
<BadgeDispo
:isDispo="certif.minDatePassed"
:dateDispo="certif.minDate"
:certifs="certif.sent_certifications"
v-if="certif.status == 'MEMBER'" />
</div>
</th>
......@@ -90,6 +91,7 @@
<BadgeDispo
:isDispo="certif.minDatePassed"
:dateDispo="certif.minDate"
:certifs="certif.sent_certifications"
v-if="certif.status == 'MEMBER'" />
</div>
</th>
......
......@@ -164,6 +164,10 @@ export const SEARCH_MEMBER = gql`
__typename
limit
}
sent_certifications {
__typename
pending
}
}
`
......
......@@ -85,32 +85,6 @@ export default {
error: null
}
},
computed: {
nbCertifsSent() {
return this.idFromHash.sent_certifications.filter((el) => {
return el.pending == false
}).length
},
nbCertifsReceived() {
return this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == false
}
).length
},
nbCertifsPendingSent() {
return this.idFromHash.sent_certifications.filter((el) => {
return el.pending == true
}).length
},
nbCertifsPendingReceived() {
return this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == true
}
).length
}
},
apollo: {
idFromHash: {
query: SEARCH_MEMBER,
......@@ -138,6 +112,30 @@ export default {
this.idFromHash.received_certifications.limit
) == "warning"
}
},
nbCertifsSent() {
return this.idFromHash.sent_certifications.filter((el) => {
return el.pending == false
}).length
},
nbCertifsReceived() {
return this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == false
}
).length
},
nbCertifsPendingSent() {
return this.idFromHash.sent_certifications.filter((el) => {
return el.pending == true
}).length
},
nbCertifsPendingReceived() {
return this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == false
}
).length
}
},
mounted() {
......
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