Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] adds filter for deprecationStatus and baseversion #16

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions lib/proportions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h

var statusTable;
var fwTable;
var baseTable;
var depTable;
var hwTable;
var geoTable;
var autoTable;
Expand Down Expand Up @@ -96,6 +98,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return d ? 'online' : 'offline';
});
var fwDict = count(nodes, ['firmware', 'release']);
var baseDict = count(nodes, ['firmware', 'base']);
var deprecationDict = count(nodes, ['model'], function (d) {
return config.deprecated && d && config.deprecated.includes(d) ? _.t('yes') : _.t('no');
});
var hwDict = count(nodes, ['model']);
var geoDict = count(nodes, ['location'], function (d) {
return d && d.longitude && d.latitude ? _.t('yes') : _.t('no');
Expand Down Expand Up @@ -124,6 +130,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return b[1] - a[1];
}));
fwTable = fillTable('node.firmware', fwTable, fwDict.sort(versionCompare));
baseTable = fillTable('node.baseversion', baseTable, baseDict.sort(versionCompare));
depTable = fillTable('node.deprecationStatus', depTable, deprecationDict.sort(function (a, b) {
return b[1] - a[1];
}));
hwTable = fillTable('node.hardware', hwTable, hwDict.sort(function (a, b) {
return b[1] - a[1];
}));
Expand All @@ -147,6 +157,8 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
self.render = function render(el) {
self.renderSingle(el, 'node.status', statusTable);
self.renderSingle(el, 'node.firmware', fwTable);
self.renderSingle(el, 'node.baseversion', baseTable);
self.renderSingle(el, 'node.deprecationStatus', depTable);
self.renderSingle(el, 'node.hardware', hwTable);
self.renderSingle(el, 'node.visible', geoTable);
self.renderSingle(el, 'node.update', autoTable);
Expand Down
2 changes: 2 additions & 0 deletions locale/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deaktivováno",
"status": "Stav",
"firmware": "Verze firmwaru",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Model hardwaru",
"visible": "Visible on the map",
"update": "Automatický update",
Expand Down
2 changes: 2 additions & 0 deletions locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deaktiviert",
"status": "Status",
"firmware": "Firmware-Version",
"baseversion": "Base Version",
"deprecationStatus": "Veralterungsstatus",
"hardware": "Geräte-Modell",
"visible": "Auf der Karte sichtbar",
"update": "Auto-Update",
Expand Down
2 changes: 2 additions & 0 deletions locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deactivated",
"status": "Status",
"firmware": "Firmware version",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Hardware model",
"visible": "Visible on the map",
"update": "Auto update",
Expand Down
2 changes: 2 additions & 0 deletions locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "désactivé",
"status": "Statut",
"firmware": "Version firmware",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Modèle matériel",
"visible": "Visible sur la carte",
"update": "Mise à jour automatique",
Expand Down
2 changes: 2 additions & 0 deletions locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "деактивировано",
"status": "Статус",
"firmware": "Версия прошивки",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Тип оборудования",
"visible": "Видно на карте",
"update": "Автообновление",
Expand Down
2 changes: 2 additions & 0 deletions locale/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "devredışı bırakıldı",
"status": "Durum",
"firmware": "Yazılım versiyonu",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Donanım modeli",
"visible": "Harita üzerinde görünür",
"update": "Otomatik güncelleme",
Expand Down