mirror of
https://github.com/godotengine/godot-team-reports.git
synced 2026-01-05 14:10:05 +03:00
Improve team and reviewer sorting
This commit is contained in:
@@ -228,9 +228,12 @@ export default class PullRequestItem extends LitElement {
|
|||||||
|
|
||||||
const other_teams = [].concat(this.teams);
|
const other_teams = [].concat(this.teams);
|
||||||
other_teams.sort((a, b) => {
|
other_teams.sort((a, b) => {
|
||||||
if (a > b) return 1;
|
const a_name = a.toLowerCase().replace(/^_/, "");
|
||||||
if (a < b) return -1;
|
const b_name = b.toLowerCase().replace(/^_/, "");
|
||||||
return 0;
|
|
||||||
|
if (a_name > b_name) return 1;
|
||||||
|
if (a_name < b_name) return -1;
|
||||||
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
const authorClassList = [ "pr-author-value" ];
|
const authorClassList = [ "pr-author-value" ];
|
||||||
|
|||||||
@@ -73,15 +73,21 @@ export default class EntryComponent extends LitElement {
|
|||||||
if (a.id === -1) return -1;
|
if (a.id === -1) return -1;
|
||||||
if (b.id === -1) return -1;
|
if (b.id === -1) return -1;
|
||||||
|
|
||||||
if (a.name > b.name) return 1;
|
const a_name = a.name.toLowerCase().replace(/^_/, "");
|
||||||
if (a.name < b.name) return -1;
|
const b_name = b.name.toLowerCase().replace(/^_/, "");
|
||||||
|
|
||||||
|
if (a_name > b_name) return 1;
|
||||||
|
if (a_name < b_name) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
this._orderedReviewers = Object.values(this._reviewers);
|
this._orderedReviewers = Object.values(this._reviewers);
|
||||||
this._orderedReviewers.sort((a, b) => {
|
this._orderedReviewers.sort((a, b) => {
|
||||||
if (a.name > b.name) return 1;
|
const a_name = a.name.toLowerCase();
|
||||||
if (a.name < b.name) return -1;
|
const b_name = b.name.toLowerCase();
|
||||||
|
|
||||||
|
if (a_name > b_name) return 1;
|
||||||
|
if (a_name < b_name) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user