feat(deals): plan activities on the deal and create them from the board

Show related activities on deal detail, prefill dealId on activity create, and add a side-panel quick create from pipeline cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-11 15:06:20 +03:30
co-authored by Cursor
parent 4f08ffae36
commit ec9a7cf9c9
6 changed files with 845 additions and 32 deletions
+9 -2
View File
@@ -20,6 +20,8 @@ export type PipelineDeal = {
assigneeNames?: string[];
ownerId?: string | null;
assigneeIds?: string[];
personId?: string | null;
companyId?: string | null;
/** متن‌های قابل جستجو (مشتری، شرکت، یادداشت، مسئولان …) */
searchFields?: Array<string | null | undefined>;
/** اولویت فعالیت؛ فقط روی کارت فعالیت نشان داده می‌شود */
@@ -36,6 +38,8 @@ export type PipelineUiCopy = {
hideAmount?: boolean;
/** کارت فعالیت: پرچم کنار عنوان و پنجرهٔ خلاصه به‌جای ورود مستقیم به جزئیات */
quickView?: boolean;
/** گوشه کارت: ایجاد سریع فعالیت برای معامله */
quickActivity?: boolean;
};
export const DEAL_BOARD_COPY: PipelineUiCopy = {
@@ -45,6 +49,7 @@ export const DEAL_BOARD_COPY: PipelineUiCopy = {
addItemAria: 'افزودن معامله به این مرحله',
itemMenuAria: 'گزینه‌های معامله',
listColTitle: 'معامله',
quickActivity: true,
};
export const PROJECT_BOARD_COPY: PipelineUiCopy = {
@@ -185,8 +190,8 @@ export function mapBoardToStages(
expectedCloseAt: string | null;
createdAt: string;
promotedFromPriorAt: string | null;
person: { fullName: string } | null;
company: { name: string } | null;
person: { id?: string; fullName: string } | null;
company: { id?: string; name: string } | null;
owner?: { id: string; fullName: string } | null;
assignees?: Array<{ id: string; fullName: string }>;
}>;
@@ -239,6 +244,8 @@ export function mapBoardToStages(
assigneeNames,
ownerId: deal.owner?.id ?? null,
assigneeIds: (deal.assignees ?? []).map((a) => a.id),
personId: deal.person?.id ?? null,
companyId: deal.company?.id ?? null,
searchFields: [
deal.notes,
deal.company?.name,