Add inline documents and messages to I1 checklist
This commit is contained in:
@@ -3544,6 +3544,12 @@ def _i1_prepare_task_display(
|
||||
task.i1_review_label = _i1_review_label(task)
|
||||
task.i1_approval_blocker = _i1_approval_blocker(tasks, task)
|
||||
task.i1_has_evidence = task_document_counts.get(int(task.id), 0) > 0
|
||||
task.i1_documents = []
|
||||
task.i1_communications = [
|
||||
comment
|
||||
for comment in getattr(task, "comments", [])
|
||||
if not getattr(comment, "is_deleted", False)
|
||||
]
|
||||
task.i1_needs_response = bool(
|
||||
getattr(task, "response_required", False)
|
||||
or (getattr(task, "response_type", "NONE") or "NONE").strip().upper() != "NONE"
|
||||
@@ -3846,12 +3852,19 @@ def get_employee_engagement_work_board(
|
||||
if task_instance_id:
|
||||
task_document_counts[int(task_instance_id)] = task_document_counts.get(int(task_instance_id), 0) + 1
|
||||
|
||||
task_documents: dict[int, list[EngagementDocument]] = {}
|
||||
for document in engagement_documents:
|
||||
task_instance_id = getattr(document, "task_instance_id", None)
|
||||
if task_instance_id:
|
||||
task_documents.setdefault(int(task_instance_id), []).append(document)
|
||||
|
||||
for task in tasks:
|
||||
_i1_prepare_task_display(
|
||||
task,
|
||||
tasks=tasks,
|
||||
task_document_counts=task_document_counts,
|
||||
)
|
||||
task.i1_documents = task_documents.get(int(task.id), [])
|
||||
|
||||
scope_display = _employee_work_scope_display_map(
|
||||
db,
|
||||
@@ -3881,6 +3894,8 @@ def get_employee_engagement_work_board(
|
||||
"documents": engagement_documents,
|
||||
"scope_display": scope_display,
|
||||
"i1_enabled": True,
|
||||
"communication_types": TASK_COMMUNICATION_TYPES,
|
||||
"communication_visibilities": TASK_COMMUNICATION_VISIBILITIES,
|
||||
"today": today,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user