Simplify the app grid filter to basic dropdowns for now

This commit is contained in:
Johannes Zellner
2019-04-15 14:31:12 +02:00
parent 0b8e5a75f1
commit 07d4d5051a
4 changed files with 75 additions and 99 deletions

View File

@@ -209,6 +209,36 @@ app.filter('shortAppMessage', function () {
};
});
app.filter('selectedTagFilter', function () {
return function selectedTagFilter(apps, selectedTags) {
return apps.filter(function (app) {
if (selectedTags.length === 0) return true;
return !!selectedTags.find(function (tag) {
return !app.tags ? false : (app.tags.indexOf(tag) !== -1);
});
});
};
});
app.filter('selectedDomainFilter', function () {
return function selectedDomainFilter(apps, selectedDomains) {
return apps.filter(function (app) {
if (selectedDomains.length === 0) return true;
return !!selectedDomains.find(function (domain) {
return app.domain === domain.domain;
});
});
};
});
app.filter('prettyDomains', function () {
return function prettyDomains(domains) {
return domains.map(function (d) { return d.domain; }).join(', ');
};
});
app.filter('prettyMemory', function () {
return function (memory) {
// Adjust the default memory limit if it changes