Add 17 features: My Work view, card copy/numbering, calendar, bulk ops, custom fields, automations, webhooks, invites, import/export, and more
Features implemented across 6 batches: - Batch A: Fix ColorPicker gradient sync, tenant custom logo, unarchive cards, board backgrounds - Batch B: My Work view, card copy/duplicate, card numbering (BOARD-123) - Batch C: Due date reminders (cron), card watching with notifications - Batch D: Bulk card operations, column sorting, calendar view - Batch E: Invite by link, board import/export (Pounce + Trello JSON) - Batch F: Webhooks with HMAC signing, custom fields, automation rules engine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types.js';
|
||||
import { withTenant } from '$lib/server/rls.js';
|
||||
import { requireBoardView } from '$lib/server/guards.js';
|
||||
import { canEditBoard } from '$lib/server/permissions.js';
|
||||
|
||||
export const load: PageServerLoad = async ({ params, locals }) => {
|
||||
const tenant = locals.tenant;
|
||||
if (!tenant) throw error(400, 'Unknown tenant');
|
||||
|
||||
const board = await withTenant(tenant.id, async (tx) => {
|
||||
return requireBoardView(tx, locals.user, params.boardId, tenant.id);
|
||||
});
|
||||
|
||||
// Filter to cards with due dates
|
||||
const cardsWithDue = board.columns.flatMap((col: any) =>
|
||||
col.cards
|
||||
.filter((c: any) => c.dueDate)
|
||||
.map((c: any) => ({
|
||||
...c,
|
||||
columnTitle: col.title,
|
||||
columnId: col.id
|
||||
}))
|
||||
);
|
||||
|
||||
return {
|
||||
board: {
|
||||
id: board.id,
|
||||
title: board.title,
|
||||
cardPrefix: (board as any).cardPrefix
|
||||
},
|
||||
cards: cardsWithDue,
|
||||
canEdit: canEditBoard(locals.user, board.members)
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user