Skip to content

Commit adc8391

Browse files
committed
Update draft order presentation
1 parent adb456a commit adc8391

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

src/Teams.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -94,37 +94,19 @@ const currentPeriod = teamInfo.availablePeriods.length;
9494
</div>
9595

9696
<div id="draft-order-tab" class="tab-content">
97-
<h3>Round 1 Draft Order</h3>
98-
${Inputs.table(draftOrder.round1, {
99-
columns: ["order", "pick", "pickName", "owner", "ownerName"],
97+
${Inputs.table(draftOrder.combined, {
98+
columns: ["order", "r1pick", "r1", "r2pick", ...draftOrder.otherRoundNumbers.map(r => `r${r}`)],
10099
header: {
101100
order: "Pick #",
102-
pick: "Original Team",
103-
pickName: "Team Name",
104-
owner: "Held By",
105-
ownerName: "Holder Name"
101+
r1pick: "R1 Original Team",
102+
r1: "R1 Held By",
103+
r2pick: "R2-4 Original Team",
104+
...Object.fromEntries(draftOrder.otherRoundNumbers.map(r => [`r${r}`, `R${r} Held By`]))
106105
},
107106
width: {
108-
order: 70,
109-
pick: 80,
110-
owner: 100
111-
},
112-
rows: 32,
113-
select: false
114-
})}
115-
<h3>Rounds 2–4 Draft Order</h3>
116-
${Inputs.table(draftOrder.otherRounds, {
117-
columns: ["order", "pick", "pickName", ...draftOrder.otherRoundNumbers.map(r => `r${r}`), ...draftOrder.otherRoundNumbers.map(r => `r${r}Name`)],
118-
header: {
119-
order: "Pick #",
120-
pick: "Original Team",
121-
pickName: "Team Name",
122-
...Object.fromEntries(draftOrder.otherRoundNumbers.map(r => [`r${r}`, `R${r} Held By`])),
123-
...Object.fromEntries(draftOrder.otherRoundNumbers.map(r => [`r${r}Name`, `R${r} Holder`]))
124-
},
125-
width: {
126-
order: 70,
127-
pick: 80
107+
order: 65,
108+
r1pick: 130,
109+
r2pick: 145
128110
},
129111
rows: 32,
130112
select: false

src/data/draftOrder.json.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,26 @@ const otherRoundsRows = draftOrder
5454
return entry;
5555
});
5656

57+
// Combined rows: zip R1 and R2-4 by position order
58+
const maxRows = Math.max(round1Rows.length, otherRoundsRows.length);
59+
const combinedRows = Array.from({length: maxRows}, (_, i) => {
60+
const r1Row = round1Rows[i] || {};
61+
const otherRow = otherRoundsRows[i] || {};
62+
const combined = {
63+
order: i + 1,
64+
r1pick: r1Row.pick || "—",
65+
r1: r1Row.owner || "—",
66+
r2pick: otherRow.pick || "—"
67+
};
68+
for (const r of otherRounds) {
69+
combined[`r${r}`] = otherRow[`r${r}`] || "—";
70+
}
71+
return combined;
72+
});
73+
5774
process.stdout.write(JSON.stringify({
5875
round1: round1Rows,
5976
otherRounds: otherRoundsRows,
60-
otherRoundNumbers: otherRounds
77+
otherRoundNumbers: otherRounds,
78+
combined: combinedRows
6179
}));

0 commit comments

Comments
 (0)