Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h1>Good First Issues</h1>
let currentSearch = "";
let currentLanguage = "";
let sortMode = 0;
let colIdx = {};
/*
0 = DEFAULT
1 = DESCENDING
Expand Down Expand Up @@ -118,17 +119,17 @@ <h1>Good First Issues</h1>

if (currentLanguage !== "") {
rows = rows.filter(row => {
return row[1] === currentLanguage
return row[colIdx.language] === currentLanguage
});
}

if (sortMode === 1) {
rows.sort(
(a,b) => Number(b[4]) - Number(a[4])
(a,b) => Number(b[colIdx.comments]) - Number(a[colIdx.comments])
);
} else if (sortMode === 2) {
rows.sort(
(a,b) => Number(a[4]) - Number(b[4])
(a,b) => Number(a[colIdx.comments]) - Number(b[colIdx.comments])
);
}

Expand Down Expand Up @@ -174,10 +175,15 @@ <h1>Good First Issues</h1>
skipEmptyLines: true,
complete: function(results) {
issuesData = results.data;
const header = issuesData[0];
colIdx = {
language: header.indexOf("language"),
comments: header.indexOf("comments")
};

const languages = [
...new Set(
issuesData.slice(1).map(row => row[1])
issuesData.slice(1).map(row => row[colIdx.language])
)
];

Expand Down