Skip to content

Commit 9bc455e

Browse files
committed
Add t_units and t_sections to column filter
1 parent 687448e commit 9bc455e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

pages/columns/+Page.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,18 @@ function ColumnGroup({ data, linkPrefix }) {
371371
}
372372

373373
function ColumnItem({ data, linkPrefix = "/" }) {
374-
const { col_id, col_name, units } = data;
374+
const { col_id, col_name, t_units, t_sections } = data;
375375

376-
const unitsText = units?.length > 0 ? `${units?.length} units` : "empty";
376+
const unitsText = t_units > 0 ? `${t_units} units` : "no units";
377+
378+
let gbpTag = null;
379+
if (t_sections > 0) {
380+
gbpTag = h(
381+
Tag,
382+
{ minimal: true, color: "goldenrod", size: "small" },
383+
`${t_sections} packages`
384+
);
385+
}
377386

378387
const href = linkPrefix + `columns/${col_id}`;
379388
return h(
@@ -393,13 +402,13 @@ function ColumnItem({ data, linkPrefix = "/" }) {
393402
{ minimal: true, color: "lightgreen", size: "small" },
394403
"in process"
395404
),
396-
" ",
405+
gbpTag,
397406
h(
398407
Tag,
399408
{
400409
minimal: true,
401410
size: "small",
402-
color: units?.length === 0 ? "orange" : "dodgerblue",
411+
color: t_units == 0 ? "orange" : "dodgerblue",
403412
},
404413
unitsText
405414
),

pages/columns/grouped-cols.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ interface ColumnResponseShort {
1212
col_area: number;
1313
col_type: "column" | "section";
1414
refs: number[];
15+
t_units: number;
16+
t_sections: number;
1517
}
1618

1719
export interface ColumnGroup {

0 commit comments

Comments
 (0)