mirror of
https://github.com/godotengine/godot-team-reports.git
synced 2025-12-31 13:48:17 +03:00
Track PRs with no team as well
This commit is contained in:
@@ -104,21 +104,43 @@ function processPulls(pullsRaw) {
|
||||
});
|
||||
|
||||
// Add teams, if available.
|
||||
item.requested_teams.forEach((teamItem) => {
|
||||
if (item.requested_teams.length > 0) {
|
||||
item.requested_teams.forEach((teamItem) => {
|
||||
const team = {
|
||||
"id": teamItem.id,
|
||||
"name": teamItem.name,
|
||||
"avatar": `https://avatars.githubusercontent.com/t/${teamItem.id}?s=40&v=4`,
|
||||
"slug": teamItem.slug,
|
||||
"full_name": teamItem.name,
|
||||
"full_slug": teamItem.slug,
|
||||
"pull_count": 0,
|
||||
};
|
||||
// Include parent data into full name and slug.
|
||||
if (teamItem.parent) {
|
||||
team.full_name = `${teamItem.parent.name}/${team.name}`;
|
||||
team.full_slug = `${teamItem.parent.slug}/${team.slug}`;
|
||||
}
|
||||
|
||||
// Store the team if it hasn't been stored before.
|
||||
if (typeof teams[team.id] == "undefined") {
|
||||
teams[team.id] = team;
|
||||
}
|
||||
teams[team.id].pull_count++;
|
||||
|
||||
// Reference the team.
|
||||
pr.teams.push(team.id);
|
||||
});
|
||||
} else {
|
||||
// If there are no teams, use a fake "empty" team to track those PRs as well.
|
||||
const team = {
|
||||
"id": teamItem.id,
|
||||
"name": teamItem.name,
|
||||
"avatar": `https://avatars.githubusercontent.com/t/${teamItem.id}?s=40&v=4`,
|
||||
"slug": teamItem.slug,
|
||||
"full_name": teamItem.name,
|
||||
"full_slug": teamItem.slug,
|
||||
"id": -1,
|
||||
"name": "No team assigned",
|
||||
"avatar": "",
|
||||
"slug": "_",
|
||||
"full_name": "No team assigned",
|
||||
"full_slug": "_",
|
||||
"pull_count": 0,
|
||||
};
|
||||
// Include parent data into full name and slug.
|
||||
if (teamItem.parent) {
|
||||
team.full_name = `${teamItem.parent.name}/${team.name}`;
|
||||
team.full_slug = `${teamItem.parent.slug}/${team.slug}`;
|
||||
}
|
||||
|
||||
// Store the team if it hasn't been stored before.
|
||||
if (typeof teams[team.id] == "undefined") {
|
||||
@@ -128,7 +150,7 @@ function processPulls(pullsRaw) {
|
||||
|
||||
// Reference the team.
|
||||
pr.teams.push(team.id);
|
||||
});
|
||||
}
|
||||
|
||||
pulls.push(pr);
|
||||
});
|
||||
|
||||
@@ -66,6 +66,9 @@ export default class EntryComponent extends LitElement {
|
||||
|
||||
this._orderedTeams = Object.values(this._teams);
|
||||
this._orderedTeams.sort((a, b) => {
|
||||
if (a.id === -1) return -1;
|
||||
if (b.id === -1) return -1;
|
||||
|
||||
if (a.name > b.name) return 1;
|
||||
if (a.name < b.name) return -1;
|
||||
return 0;
|
||||
@@ -119,13 +122,11 @@ export default class EntryComponent extends LitElement {
|
||||
|
||||
render(){
|
||||
let pulls = [];
|
||||
if (this._selectedTeam >= 0) {
|
||||
this._pulls.forEach((pull) => {
|
||||
if (pull.teams.includes(this._selectedTeam)) {
|
||||
pulls.push(pull);
|
||||
}
|
||||
});
|
||||
}
|
||||
this._pulls.forEach((pull) => {
|
||||
if (pull.teams.includes(this._selectedTeam)) {
|
||||
pulls.push(pull);
|
||||
}
|
||||
});
|
||||
|
||||
return html`
|
||||
<page-content>
|
||||
|
||||
Reference in New Issue
Block a user