feat(web): add prior archive promote actions
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,7 +41,7 @@ const emit = defineEmits<{
|
||||
stagesChanged: [];
|
||||
add: [stageId: string];
|
||||
error: [message: string];
|
||||
menuDeal: [activityId: string];
|
||||
menuDeal: [activity: ActivityDto];
|
||||
toggleSelect: [activityId: string];
|
||||
bulkDelete: [];
|
||||
}>();
|
||||
@@ -115,6 +115,8 @@ function toCard(item: ActivityDto, stageId: string): PipelineDeal {
|
||||
date: dateText(item),
|
||||
initials: initialsFromTitle(party || item.title),
|
||||
stageId,
|
||||
createdAt: item.createdAt,
|
||||
promotedFromPriorAt: item.promotedFromPriorAt ?? null,
|
||||
assigneeNames,
|
||||
ownerId: item.assignee?.id ?? null,
|
||||
assigneeIds: (item.assignees ?? []).map((a) => a.id),
|
||||
@@ -205,6 +207,19 @@ function findStageOf(id: string) {
|
||||
return Object.entries(columns.value).find(([, col]) => col.items.some((i) => i.id === id))?.[0];
|
||||
}
|
||||
|
||||
function findActivity(id: string) {
|
||||
for (const col of Object.values(columns.value)) {
|
||||
const item = col.items.find((i) => i.id === id);
|
||||
if (item) return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function onMenuActivity(id: string) {
|
||||
const item = findActivity(id);
|
||||
if (item) emit('menuDeal', item);
|
||||
}
|
||||
|
||||
function onDragStart(deal: PipelineDeal, event: DragEvent) {
|
||||
draggingId.value = deal.id;
|
||||
overlayDeal.value = deal;
|
||||
@@ -397,7 +412,7 @@ function openActivity(id: string) {
|
||||
@drop="onDrop"
|
||||
@add-deal="emit('add', $event)"
|
||||
@open-deal="openActivity"
|
||||
@menu-deal="emit('menuDeal', $event)"
|
||||
@menu-deal="onMenuActivity"
|
||||
@toggle-select="emit('toggleSelect', $event)"
|
||||
@bulk-delete="emit('bulkDelete')"
|
||||
@rename-stage="onRenameStage"
|
||||
|
||||
Reference in New Issue
Block a user