add theme count to table

This commit is contained in:
Trent Palmer 2021-08-19 12:28:22 -07:00
parent 8fc0b17f96
commit 6e4c1cc072

View File

@ -101,7 +101,7 @@ function getDiplayState() {
}
let tableColumns = [
{ headingName: "cname", headingText: "theme" },
{ headingName: "cname", headingText: "themes" },
{ headingName: "date", headingText: "date" },
{ headingName: "num_stars", headingText: "stars" },
{ headingName: "commit", headingText: "commit" },
@ -125,14 +125,6 @@ function buildResults() {
resultsTable.appendChild(resultsTableHeadRow);
let selectedColumns = getSelectedColumns();
tableColumns
.filter((y) => selectedColumns.includes(y.headingName))
.forEach((x) => {
let xTH = document.createElement("th");
xTH.innerHTML = x.headingText;
resultsTableHeadRow.appendChild(xTH);
});
let selectedTags = getSelected("tag");
let selectedFeatures = getSelected("feature");
let selectedLicenses = getSelected("license");
@ -154,6 +146,18 @@ function buildResults() {
addThemeTableRow(theme, selectedColumns, selectedTags, selectedFeatures)
);
tableColumns
.filter((y) => selectedColumns.includes(y.headingName))
.forEach((x) => {
let xTH = document.createElement("th");
if (x.headingText === "themes") {
xTH.innerHTML = `${filteredThemes.length}/${themes.length} ${x.headingText}`;
} else {
xTH.innerHTML = x.headingText;
}
resultsTableHeadRow.appendChild(xTH);
});
// from buildSelectionMenu.js
buildSelectionMenu(
tagAndFeatureFilteredThemes,