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

adaptations for new version of API graphQL

parent 379da13d
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<div class="text-truncate">{{ certif.uid }}</div> <div class="text-truncate">{{ certif.uid }}</div>
&nbsp; &nbsp;
<BadgeDanger <BadgeDanger
:limitDate="certif.received_certifications.limit" :limitDate="certif.certsLimit"
:memberStatus="certif.status" /> :memberStatus="certif.status" />
</div> </div>
<BadgeStatus :membre="certif" /> <BadgeStatus :membre="certif" />
......
...@@ -90,16 +90,9 @@ ...@@ -90,16 +90,9 @@
<td <td
:class=" :class="
'list-group-item-' + 'list-group-item-' +
$options.filters.dateStatus( $options.filters.dateStatus(hash.certsLimit)
hash.received_certifications.limit
)
"> ">
{{ {{ $d(new Date(hash.certsLimit * 1000), "long") }}
$d(
new Date(hash.received_certifications.limit * 1000),
"long"
)
}}
</td> </td>
</tr> </tr>
<tr v-if="hash.status == 'MEMBER'"> <tr v-if="hash.status == 'MEMBER'">
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<div class="text-truncate">{{ member.uid }}</div> <div class="text-truncate">{{ member.uid }}</div>
&nbsp; &nbsp;
<BadgeDanger <BadgeDanger
:limitDate="member.received_certifications.limit" :limitDate="member.certsLimit"
:memberStatus="member.status" /> :memberStatus="member.status" />
</div> </div>
<div v-if="['adhesion', 'certif'].includes(type)" class="d-sm-none"> <div v-if="['adhesion', 'certif'].includes(type)" class="d-sm-none">
...@@ -108,9 +108,7 @@ ...@@ -108,9 +108,7 @@
}" }"
v-if="['certif', 'favoris'].includes(type)" v-if="['certif', 'favoris'].includes(type)"
@click="redirect(member.hash)"> @click="redirect(member.hash)">
<BadgeDate <BadgeDate :date="member.certsLimit" styleDate="short" />
:date="member.received_certifications.limit"
styleDate="short" />
</td> </td>
<td class="py-1" v-if="type == 'favoris'" style="width: 60px"> <td class="py-1" v-if="type == 'favoris'" style="width: 60px">
<button <button
...@@ -178,8 +176,8 @@ export default { ...@@ -178,8 +176,8 @@ export default {
}, },
getDate(member) { getDate(member) {
if (this.type == "adhesion") return member.limitDate if (this.type == "adhesion") return member.limitDate
if (this.type == "certif") return member.received_certifications.limit if (this.type == "certif") return member.certsLimit
return Math.min(member.limitDate, member.received_certifications.limit) return Math.min(member.limitDate, member.certsLimit)
}, },
getOrder(a, b, order) { getOrder(a, b, order) {
if (a < b) return -1 * order if (a < b) return -1 * order
...@@ -208,11 +206,7 @@ export default { ...@@ -208,11 +206,7 @@ export default {
} else if (this.currentSort == "date_membership") { } else if (this.currentSort == "date_membership") {
return this.getOrder(a["limitDate"], b["limitDate"], modifier) return this.getOrder(a["limitDate"], b["limitDate"], modifier)
} else if (this.currentSort == "date_certs") { } else if (this.currentSort == "date_certs") {
return this.getOrder( return this.getOrder(a["certsLimit"], b["certsLimit"], modifier)
a["received_certifications"]["limit"],
b["received_certifications"]["limit"],
modifier
)
} }
return 0 return 0
}) })
......
...@@ -31,6 +31,7 @@ export const LAST_EVENTS = gql` ...@@ -31,6 +31,7 @@ export const LAST_EVENTS = gql`
hash hash
minDatePassed minDatePassed
minDate minDate
certsLimit
limitDate limitDate
quality { quality {
__typename __typename
...@@ -44,10 +45,6 @@ export const LAST_EVENTS = gql` ...@@ -44,10 +45,6 @@ export const LAST_EVENTS = gql`
number number
} }
} }
received_certifications {
__typename
limit
}
sent_certifications { sent_certifications {
__typename __typename
pending pending
...@@ -79,11 +76,8 @@ export const NEWCOMERS = gql` ...@@ -79,11 +76,8 @@ export const NEWCOMERS = gql`
uid uid
status status
hash hash
certsLimit
limitDate limitDate
received_certifications {
__typename
limit
}
} }
date date
after after
...@@ -106,15 +100,12 @@ export const SEARCH_MEMBERS = gql` ...@@ -106,15 +100,12 @@ export const SEARCH_MEMBERS = gql`
minDate minDate
minDatePassed minDatePassed
hash hash
certsLimit
limitDate limitDate
quality { quality {
__typename __typename
ratio ratio
} }
received_certifications {
__typename
limit
}
sent_certifications { sent_certifications {
__typename __typename
pending pending
...@@ -151,14 +142,11 @@ export const SEARCH_MEMBER = gql` ...@@ -151,14 +142,11 @@ export const SEARCH_MEMBER = gql`
} }
received_certifications { received_certifications {
__typename __typename
certifications { from {
__typename ...attr
from {
...attr
}
expires_on
pending
} }
expires_on
pending
} }
sent_certifications { sent_certifications {
__typename __typename
...@@ -175,6 +163,7 @@ export const SEARCH_MEMBER = gql` ...@@ -175,6 +163,7 @@ export const SEARCH_MEMBER = gql`
uid uid
hash hash
status status
certsLimit
limitDate limitDate
minDate minDate
minDatePassed minDatePassed
...@@ -182,10 +171,6 @@ export const SEARCH_MEMBER = gql` ...@@ -182,10 +171,6 @@ export const SEARCH_MEMBER = gql`
__typename __typename
ratio ratio
} }
received_certifications {
__typename
limit
}
sent_certifications { sent_certifications {
__typename __typename
pending pending
...@@ -229,6 +214,7 @@ export const FAVORIS = gql` ...@@ -229,6 +214,7 @@ export const FAVORIS = gql`
uid uid
status status
hash hash
certsLimit
limitDate limitDate
minDatePassed minDatePassed
minDate minDate
...@@ -236,10 +222,6 @@ export const FAVORIS = gql` ...@@ -236,10 +222,6 @@ export const FAVORIS = gql`
__typename __typename
ratio ratio
} }
received_certifications {
__typename
limit
}
sent_certifications { sent_certifications {
__typename __typename
pending pending
...@@ -258,15 +240,12 @@ export const NEXT_EXITS = gql` ...@@ -258,15 +240,12 @@ export const NEXT_EXITS = gql`
hash hash
minDatePassed minDatePassed
minDate minDate
certsLimit
limitDate limitDate
quality { quality {
__typename __typename
ratio ratio
} }
received_certifications {
__typename
limit
}
sent_certifications { sent_certifications {
__typename __typename
pending pending
...@@ -288,29 +267,23 @@ export const NEXT_LOOSE_CERTS = gql` ...@@ -288,29 +267,23 @@ export const NEXT_LOOSE_CERTS = gql`
period: $period period: $period
missingIncluded: $missingIncluded missingIncluded: $missingIncluded
) { ) {
id { __typename
pubkey
uid
status
hash
minDatePassed
minDate
certsLimit
limitDate
quality {
__typename __typename
pubkey ratio
uid }
status sent_certifications {
hash __typename
minDatePassed pending
minDate
limitDate
quality {
__typename
ratio
}
received_certifications {
__typename
limit
}
sent_certifications {
__typename
pending
}
} }
date
} }
} }
` `
{ {
"name": "wotwizard-ui", "name": "wotwizard-ui",
"version": "0.23.0", "version": "0.24.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "nuxt", "dev": "nuxt",
......
...@@ -21,11 +21,10 @@ ...@@ -21,11 +21,10 @@
:class="{ :class="{
'text-success': 'text-success':
['NEWCOMER', 'MISSING'].includes(idFromHash.status) && ['NEWCOMER', 'MISSING'].includes(idFromHash.status) &&
idFromHash.received_certifications.certifications.length >= idFromHash.received_certifications.length >= 5,
5,
'text-danger': 'text-danger':
['NEWCOMER', 'MISSING'].includes(idFromHash.status) && ['NEWCOMER', 'MISSING'].includes(idFromHash.status) &&
idFromHash.received_certifications.certifications.length < 5 idFromHash.received_certifications.length < 5
}"> }">
{{ $t("certification.recues") }} ({{ nbCertifsReceived {{ $t("certification.recues") }} ({{ nbCertifsReceived
}}<span v-if="nbCertifsPendingReceived != 0">{{ }}<span v-if="nbCertifsPendingReceived != 0">{{
...@@ -33,11 +32,11 @@ ...@@ -33,11 +32,11 @@
}}</span }}</span
>) >)
<BadgeDanger <BadgeDanger
:limitDate="idFromHash.received_certifications.limit" :limitDate="idFromHash.certsLimit"
:memberStatus="idFromHash.status" /> :memberStatus="idFromHash.status" />
</h3> </h3>
<CertifGroup <CertifGroup
:certifs="idFromHash.received_certifications.certifications" :certifs="idFromHash.received_certifications"
type="received" /> type="received" />
</div> </div>
<div <div
...@@ -106,11 +105,10 @@ export default { ...@@ -106,11 +105,10 @@ export default {
computed: { computed: {
classWarning() { classWarning() {
return { return {
"text-danger": !this.idFromHash.received_certifications.limit, "text-danger": !this.idFromHash.certsLimit,
"text-warning": "text-warning":
this.$options.filters.dateStatus( this.$options.filters.dateStatus(this.idFromHash.certsLimit) ==
this.idFromHash.received_certifications.limit "warning"
) == "warning"
} }
}, },
nbCertifsSent() { nbCertifsSent() {
...@@ -119,11 +117,9 @@ export default { ...@@ -119,11 +117,9 @@ export default {
}).length }).length
}, },
nbCertifsReceived() { nbCertifsReceived() {
return this.idFromHash.received_certifications.certifications.filter( return this.idFromHash.received_certifications.filter((el) => {
(el) => { return el.pending == false
return el.pending == false }).length
}
).length
}, },
nbCertifsPendingSent() { nbCertifsPendingSent() {
return this.idFromHash.sent_certifications.filter((el) => { return this.idFromHash.sent_certifications.filter((el) => {
...@@ -131,11 +127,9 @@ export default { ...@@ -131,11 +127,9 @@ export default {
}).length }).length
}, },
nbCertifsPendingReceived() { nbCertifsPendingReceived() {
return this.idFromHash.received_certifications.certifications.filter( return this.idFromHash.received_certifications.filter((el) => {
(el) => { return el.pending == true
return el.pending == true }).length
}
).length
} }
}, },
mounted() { mounted() {
......
...@@ -96,9 +96,6 @@ export default { ...@@ -96,9 +96,6 @@ export default {
variables() { variables() {
return this.getParams return this.getParams
}, },
update(data) {
return data.certEnds.map((item) => item.id)
},
error(err) { error(err) {
this.error = err.message this.error = err.message
} }
......
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