Skip to content

Commit

Permalink
Update installed charts number according to filter (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronahk authored Nov 28, 2022
1 parent 8de7941 commit fa4819b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/dashboard/static/list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function loadChartsList() {
reportError("Failed to get list of charts", xhr)
}).done(function (data) {
chartsCards.empty().hide()
$("#installedList .header h2 span").text(data.length)
const usedNS = {}
data.forEach(function (elm) {
let card = buildChartCard(elm);
Expand Down
10 changes: 8 additions & 2 deletions pkg/dashboard/static/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,17 @@ function filterInstalledList(list) {
let filterStr = $("#installedSearch").val().toLowerCase();
let filteredNamespaces = getHashParam("filteredNamespace")
let anyShown = false;
let installedCount = 0;

list.each(function (ix, card) {
anyShown |= showHideInstalledRelease($(card), filteredNamespaces, filterStr)
anyShown = showHideInstalledRelease($(card), filteredNamespaces, filterStr)
if (anyShown) {
installedCount++;
}
})

if (list.length && !anyShown) {
$("#installedList .header h2 span").text(installedCount)
if (list.length && !installedCount) {
warnMsg.show()
}
}
Expand Down

0 comments on commit fa4819b

Please sign in to comment.