Skip to content
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
5 changes: 5 additions & 0 deletions goosebit/ui/bff/common/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ class RolloutColumns:
searchable=True,
orderable=True,
)
compatibility = DTColumnDescription(
title="Compatibility",
data="software.compatibility",
name="software__compatibility",
)
paused = DTColumnDescription(
title="Paused",
name="paused",
Expand Down
1 change: 1 addition & 0 deletions goosebit/ui/bff/rollouts/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ async def devices_get_columns() -> DTColumns:
RolloutColumns.feed,
RolloutColumns.sw_file,
RolloutColumns.sw_version,
RolloutColumns.compatibility,
RolloutColumns.paused,
RolloutColumns.success_count,
RolloutColumns.failure_count,
Expand Down
13 changes: 13 additions & 0 deletions goosebit/ui/static/js/rollouts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
let dataTable;

const renderFunctions = {
"software.compatibility": (data, type) => {
const result = data.reduce((acc, { model, revision }) => {
if (!acc[model]) {
acc[model] = [];
}
acc[model].push(revision);
return acc;
}, {});

return Object.entries(result)
.map(([model, revision]) => `${model} - ${revision.join(", ")}`)
.join("\n");
},
paused: (data, type) => {
if (type === "display") {
const color = data ? "danger" : "muted";
Expand Down
6 changes: 5 additions & 1 deletion goosebit/ui/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ async function updateSoftwareSelection(devices = null) {
const optionElem = document.createElement("option");
optionElem.value = item.id;
optionElem.textContent = `${item.version}`;
const models = [...new Set(item.compatibility.map((item) => item.model))];
const models = [
...new Set(
item.compatibility.map((item) => (item.revision ? `${item.model} - ${item.revision}` : item.model)),
),
];
optionElem.textContent = `${item.version} (${models})`;
selectElem.appendChild(optionElem);
}
Expand Down
Loading