Skip to content

Commit

Permalink
Hack alumni list as well #2371.
Browse files Browse the repository at this point in the history
  • Loading branch information
knirirr committed Jul 30, 2024
1 parent 193b88d commit 2b2b7b7
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 38 deletions.
101 changes: 67 additions & 34 deletions src/data/communityCurationCohorts.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"linkedin" : "kylecopas",
"mastodon" : "scicomm.xyz/@kylecopas",
"logo": "kyle_copas.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Annie Elkjær Ørum-Kristensen",
Expand All @@ -38,7 +39,8 @@
"linkedin" : "anniekristensen",
"mastodon" : "",
"logo": "annie_kristensen.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Joe Miller",
Expand All @@ -58,7 +60,8 @@
"linkedin" : "joe-miller-biodiversity",
"mastodon" : "",
"logo": "joe_miller.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Lindsey Anderson",
Expand All @@ -79,6 +82,7 @@
"mastodon" : "fediscience.org/@lnanderscience",
"logo": "lindseyanderson.jpg",
"year_active": ["2022", "2023", "2024"],
"active": true,
"curator_expert" : true
},
{
Expand All @@ -99,7 +103,8 @@
"linkedin" : "malinsandstrom",
"mastodon" : "fediscience.org/@msandstr",
"logo": "malin.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Gabriel Pelletier",
Expand Down Expand Up @@ -129,7 +134,8 @@
"linkedin" : "gabrielpelletier",
"mastodon" : "mastodon.online/@neuropelletier",
"logo": "gabriel_pelletier.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Daniel Pereira Costa",
Expand All @@ -149,7 +155,8 @@
"linkedin" : "daniel-costa-64a54a1a3",
"mastodon" : "",
"logo": "danielpereiracosta.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Deborah Thorpe",
Expand All @@ -169,7 +176,8 @@
"linkedin" : "deborah-thorpe-0245a392",
"mastodon" : "hcommons.social/@debsethorpe",
"logo": "deborah_thorpe.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Enrique Wulff",
Expand All @@ -189,7 +197,8 @@
"linkedin" : "enrique-wulff-01814398",
"mastodon" : "",
"logo": "enrique_wulff.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Geneviève Michaud",
Expand Down Expand Up @@ -218,7 +227,8 @@
"linkedin" : "geneviève-michaud-12223746",
"mastodon" : "mastodon.zaclys.com/@GenevievMichaud",
"logo": "genevievemichaud.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Lars Vilhuber",
Expand All @@ -241,7 +251,8 @@
"linkedin" : "lars-vilhuber",
"mastodon" : "",
"logo": "lars_vilhuber.jpg",
"year_active": ["2022"]
"year_active": ["2022"],
"active": false
},
{
"name": "Guillaume Gay",
Expand All @@ -265,7 +276,8 @@
"linkedin" : "guillaume-gay-492a2227",
"mastodon" : "biologists.social/@glyg",
"logo": "guillaumegay.jpg",
"year_active": ["2022"]
"year_active": ["2022"],
"active": false
},
{
"name": "Maja Dolinar",
Expand All @@ -285,7 +297,8 @@
"linkedin" : "majadolinar",
"mastodon" : "",
"logo": "maja_dolinar.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Mitrea Geta",
Expand All @@ -305,7 +318,8 @@
"linkedin" : "geta-mitrea",
"mastodon" : "",
"logo": "getamitrea.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Sara Espinoza",
Expand All @@ -325,7 +339,8 @@
"linkedin" : "sara-espinoza",
"mastodon" : "",
"logo": "sara_espinoza.jpg",
"year_active": ["2022", "2023"]
"year_active": ["2022", "2023"],
"active": false
},
{
"name": "Stephen Serjeant",
Expand All @@ -350,7 +365,8 @@
"linkedin" : "stephenserjeant",
"mastodon" : "mas.to/@stephenserjeant",
"logo": "stephen_serjeant.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Kay Burrows",
Expand All @@ -370,7 +386,8 @@
"linkedin" : "kayeburrows",
"mastodon" : "",
"logo": "kay_burrows.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Francis P. Crawley",
Expand All @@ -390,7 +407,8 @@
"linkedin" : "francispcrawley",
"mastodon" : "",
"logo": "francis_crawley.jpg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Debora Drucker",
Expand All @@ -410,7 +428,8 @@
"linkedin" : "debora-drucker",
"mastodon" : "",
"logo": "debora_druker.jpeg",
"year_active": ["2022", "2023", "2024"]
"year_active": ["2022", "2023", "2024"],
"active": true
},
{
"name": "Yuhe Liang",
Expand All @@ -430,7 +449,8 @@
"linkedin" : "yu-he-liang-66650033",
"mastodon" : "",
"logo": "yuhen.jpg",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Adam Partridge",
Expand All @@ -453,7 +473,8 @@
"linkedin" : "",
"mastodon" : "",
"logo": "adam_partridge.jpg",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Kelly Cobey",
Expand All @@ -473,7 +494,7 @@
"mastodon" : "",
"logo": "k_cobey.jpg",
"year_active": ["2023", "2024"],
"hidden": true
"active": false
},
{
"name": "Yojana Gadiya",
Expand All @@ -492,7 +513,8 @@
"linkedin" : "yojana-gadiya-477739113",
"mastodon" : "",
"logo": "y_gadiya.jpg",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Joy Davidson",
Expand All @@ -512,7 +534,8 @@
"linkedin" : "joy-davidson",
"mastodon" : "",
"logo": "Joy-Davidson.jpg",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Richard Acton",
Expand All @@ -533,7 +556,7 @@
"mastodon" : "fosstodon.org/@RichardJActon",
"logo": "r_acton.png",
"year_active": ["2023", "2024"],
"hidden": true
"active": false
},
{
"name": "David Tomkins",
Expand All @@ -553,7 +576,8 @@
"linkedin" : "david-tomkins-83b92534",
"mastodon" : "",
"logo": "d_tomkins.jpeg",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Lyndon Zass",
Expand All @@ -576,7 +600,8 @@
"linkedin" : "lyndon-zass-10b731145",
"mastodon" : "",
"logo": "l_zass.png",
"year_active": ["2023", "2024"]
"year_active": ["2023", "2024"],
"active": true
},
{
"name": "Christian Bonatto Minella",
Expand All @@ -595,7 +620,8 @@
"linkedin" : "christian-bonatto-minella-780b7710",
"mastodon" : "",
"logo": "christian_bonatto.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Priyadarshini Thirunavukkarasu",
Expand All @@ -614,7 +640,8 @@
"linkedin" : "priyadarshini-thirunavukkarasu-53107a25",
"mastodon" : "",
"logo": "priyadarshini_large.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Alex Fraser",
Expand All @@ -633,7 +660,8 @@
"linkedin" : "",
"mastodon" : "",
"logo": "alex_fraser.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Laurence Brown",
Expand All @@ -652,7 +680,8 @@
"linkedin" : "laurence-a-brown",
"mastodon" : "",
"logo": "laurence_brown.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Tim Gamble-Turner",
Expand All @@ -671,7 +700,8 @@
"linkedin" : "",
"mastodon" : "",
"logo": "tim_gamble_turner.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Hugh Shanahan",
Expand All @@ -690,7 +720,8 @@
"linkedin" : "hugh-shanahan-340b343/",
"mastodon" : "mastodon.ie/@HughShanahan",
"logo": "hugh_shanahan.jpeg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Clara Boavida",
Expand All @@ -709,7 +740,8 @@
"linkedin" : "claraparenteboavida",
"mastodon" : "",
"logo": "clara_boavida.jpg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
},
{
"name": "Timothée Aubourg",
Expand All @@ -728,7 +760,8 @@
"linkedin" : "timothee-aubourg",
"mastodon" : "",
"logo": "timothee-aubourg.jpeg",
"year_active": ["2024"]
"year_active": ["2024"],
"active": true
}
],
"quotes": [
Expand Down
13 changes: 11 additions & 2 deletions src/views/Static/CommunityCuration/CuratorCohorts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,15 @@ export default {
methods: {
getCuratorsList(yearSelected) {
if (Object.keys(this.communityCurationCohorts).length) {
/*
* Due to https://github.com/FAIRsharing/fairsharing.github.io/issues/2371 (i.e. a change in requirements
* after building) this has become unnecessarily complex. Curators will need to both set a champion's active
* years and an active boolean to have them appear in the correction place. The options are:
* -> current year + active => current
* -> current year + !active => alumnus
* -> previous year + active => invisible
* -> previous year + !active => alumnus
*/
this.alumniCurator = false
this.error = false;
const yearsActiveList = this.communityCurationCohorts.data.map(el => el.year_active)
Expand All @@ -368,7 +377,7 @@ export default {
this.communityCurationCohorts.data = this.communityCurationCohorts.data.sort((a, b) => a.name.localeCompare(b.name))
this.currentCohort = this.communityCurationCohorts.data.filter(curator => {
return curator.year_active.includes(yearSelected.toString()) && !curator.hidden
return curator.year_active.includes(yearSelected.toString()) && curator.active
})
}
else {
Expand All @@ -382,7 +391,7 @@ export default {
this.alumniCurator = !this.alumniCurator
if(this.alumniCurator) {
this.currentCohort = this.communityCurationCohorts.data.filter(curator => {
return curator.year_active.every(el => el < new Date().getFullYear())
return curator.year_active.every(el => el < new Date().getFullYear()) || !curator.active
})
this.year = null;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("CuratorCohorts.vue", function(){
expect(wrapper.vm.$options.name).toMatch("CuratorCohorts");
expect(wrapper.vm.communityCurationCohorts.data).toStrictEqual(realData.data);
let currentCuratorsList = realData.data.filter(curator => {
return curator.year_active.includes(new Date().getFullYear().toString()) && !curator.hidden
return curator.year_active.includes(new Date().getFullYear().toString()) && curator.active
})
expect(wrapper.vm.currentCohort).toStrictEqual(currentCuratorsList);
expect(wrapper.vm.year).toBe(new Date().getFullYear());
Expand All @@ -38,7 +38,7 @@ describe("CuratorCohorts.vue", function(){
wrapper.vm.listAlumni()
expect(wrapper.vm.alumniCurator).toBe(true)
let currentCuratorsList = realData.data.filter(curator => {
return curator.year_active.every(el => el < new Date().getFullYear())
return curator.year_active.every(el => el < new Date().getFullYear()) || !curator.active
})
expect(wrapper.vm.currentCohort).toStrictEqual(currentCuratorsList);
expect(wrapper.vm.year).toBe(null);
Expand Down

0 comments on commit 2b2b7b7

Please sign in to comment.