task-ep.1.6
This commit is contained in:
37
src/features/crm/calendar/components/calendar-adapter.ts
Normal file
37
src/features/crm/calendar/components/calendar-adapter.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { BigCalendarEvent, CalendarProjectionItem } from '../api/types';
|
||||
|
||||
export function mapCalendarProjectionToBigCalendarEvent(
|
||||
item: CalendarProjectionItem
|
||||
): BigCalendarEvent {
|
||||
const activityEditable = item.editable && !item.milestone && item.activityId !== null;
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
start: item.startAt,
|
||||
end: item.endAt,
|
||||
allDay: item.allDay,
|
||||
editable: activityEditable,
|
||||
draggable: activityEditable,
|
||||
resizable: activityEditable,
|
||||
category: item.category,
|
||||
priority: item.priority,
|
||||
source: {
|
||||
entityType: item.entityType,
|
||||
entityId: item.entityId,
|
||||
activityId: item.activityId,
|
||||
customerId: item.customerId,
|
||||
leadId: item.leadId,
|
||||
opportunityId: item.opportunityId,
|
||||
quotationId: item.quotationId,
|
||||
approvalId: item.approvalId
|
||||
},
|
||||
display: {
|
||||
summary: item.summary,
|
||||
location: item.location,
|
||||
overdue: item.overdue,
|
||||
hotProject: item.hotProject,
|
||||
milestone: item.milestone
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user