|
|
|
|
@ -27,7 +27,7 @@
|
|
|
|
|
const groups = data.groups || [];
|
|
|
|
|
let itemsByGroup: Record<string, Task[]> = {};
|
|
|
|
|
for (const [gid, arr] of Object.entries(data.itemsByGroup || {})) {
|
|
|
|
|
itemsByGroup[gid] = Array.isArray(arr as any) ? ([...(arr as any)]) : [];
|
|
|
|
|
itemsByGroup[gid] = Array.isArray(arr as any) ? [...(arr as any)] : [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function buildQuery(params: { unassignedFirst?: boolean }) {
|
|
|
|
|
@ -103,12 +103,21 @@
|
|
|
|
|
queueMicrotask(() => window.scrollTo({ top: y }));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateGroupTask(groupId: string, detail: { id: number; action: string; patch: Partial<Task & { completed?: boolean; completed_at?: string | null }> }) {
|
|
|
|
|
function updateGroupTask(
|
|
|
|
|
groupId: string,
|
|
|
|
|
detail: {
|
|
|
|
|
id: number;
|
|
|
|
|
action: string;
|
|
|
|
|
patch: Partial<
|
|
|
|
|
Task & { completed?: boolean; completed_at?: string | null }
|
|
|
|
|
>;
|
|
|
|
|
},
|
|
|
|
|
) {
|
|
|
|
|
const { id, action, patch } = detail;
|
|
|
|
|
const arr = itemsByGroup[groupId] || [];
|
|
|
|
|
const idx = arr.findIndex((t) => t.id === id);
|
|
|
|
|
|
|
|
|
|
if (action === 'complete') {
|
|
|
|
|
if (action === "complete") {
|
|
|
|
|
if (idx >= 0) {
|
|
|
|
|
maintainScrollWhile(() => {
|
|
|
|
|
arr.splice(idx, 1);
|
|
|
|
|
@ -228,6 +237,8 @@
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
align-self: center;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
.badge.warn {
|
|
|
|
|
border-color: var(--color-warning);
|
|
|
|
|
|