This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
forked from chron/squad-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall-wip.11tydata.js
37 lines (36 loc) · 1.57 KB
/
all-wip.11tydata.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module.exports = {
eleventyComputed: {
wipData: (data) => {
const prs = data.githubActive;
return data.users.map((person) => {
const authoredPRs = prs.filter(pr => {
return pr.author.name === person.githubLogin;
});
const reviewingPRs = prs.filter(pr => {
return pr.assigned.some(assignee => assignee.name === person.githubLogin && !assignee.hasReviewed) &&
pr.labels.includes(data.constants.READY_TO_REVIEW);
});
const reviewingOtherPRs = prs.filter(pr => {
return pr.assigned.some(assignee => assignee.name === person.githubLogin && assignee.hasReviewed) &&
pr.labels.includes(data.constants.READY_TO_REVIEW);
});
const testingPRs = prs.filter(pr => {
return pr.assigned.some(assignee => assignee.name === person.githubLogin && assignee.hasReviewed) &&
pr.labels.includes(data.constants.READY_TO_TEST);
});
const allPrs = data.helpers.addProgressStatusToPRs([...authoredPRs, ...reviewingPRs, ...reviewingOtherPRs, ...testingPRs], person);
return {
githubLogin: person.githubLogin,
nickname: person.nickname,
authoredPRs: authoredPRs,
reviewingPRs: reviewingPRs,
reviewingOtherPRs:reviewingOtherPRs,
testingPRs: testingPRs,
allPrs: allPrs,
};
}).filter(person => person.allPrs.length > 0).sort((a, b) => {
return a.nickname.localeCompare(b.nickname);
});
},
},
}