Skip to content
Snippets Groups Projects

Add possibility to use Favorites

Merged CaTasTrOOf requested to merge CaTasTrOOf/wotwizard-ui:favourites-filter into master
1 file
+ 13
22
Compare changes
  • Side-by-side
  • Inline
+ 13
22
@@ -146,6 +146,11 @@ export default {
if (this.adhesion) return member.limitDate
if (this.certif) return member.received_certifications.limit
return Math.min(member.limitDate, member.received_certifications.limit)
},
sort(a, b, order) {
if (a < b) return -1 * order
if (a > b) return 1 * order
return 0
}
},
computed: {
@@ -156,30 +161,18 @@ export default {
let modifier = this.currentSortDir === "desc" ? -1 : 1
if (this.currentSort == "uid") {
if (a["uid"].toLowerCase() < b["uid"].toLowerCase())
return -1 * modifier
if (a["uid"].toLowerCase() > b["uid"].toLowerCase())
return 1 * modifier
sort(a["uid"].toLowerCase(), b["uid"].toLowerCase(), modifier)
} else if (this.currentSort == "pubkey") {
if (a["pubkey"].toLowerCase() < b["pubkey"].toLowerCase())
return -1 * modifier
if (a["pubkey"].toLowerCase() > b["pubkey"].toLowerCase())
return 1 * modifier
sort(a["pubkey"].toLowerCase(), b["pubkey"].toLowerCase(), modifier)
} else if (this.currentSort == "date_sortie") {
if (this.adhesion) {
if (a["limitDate"] < b["limitDate"]) return -1 * modifier
if (a["limitDate"] > b["limitDate"]) return 1 * modifier
sort(a["limitDate"], b["limitDate"], modifier)
} else if (this.certif) {
if (
a["received_certifications"]["limit"] <
b["received_certifications"]["limit"]
sort(
a["received_certifications"]["limit"],
b["received_certifications"]["limit"],
modifier
)
return -1 * modifier
if (
a["received_certifications"]["limit"] >
b["received_certifications"]["limit"]
)
return 1 * modifier
} else {
let minA = Math.min(
a["limitDate"],
@@ -189,11 +182,9 @@ export default {
b["limitDate"],
b["received_certifications"]["limit"]
)
if (minA < minB) return -1 * modifier
if (minA > minB) return 1 * modifier
sort(minA, minB, modifier)
}
}
return 0
})
.filter((row, index) => {
Loading