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