From bf7dda2def34bdcaf2a083f79cd9894fd1caab55 Mon Sep 17 00:00:00 2001
From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com>
Date: Wed, 13 Nov 2024 02:00:31 +0545
Subject: [PATCH] fix(mapper): task comment events for mapper frontend (#1871)
* fix(activitiesPanel): optional chaining add
* fix(events): commentTask func add for commenting tasks
* fix(editor): ts types add, import path fix
* fix(activities): replace dynamic data with static
* fix(comment): replace dynamic data with static
* fix(+page): comment eventCard and uncomment more component
* fix(more): props fix, filter taskEvents & comments into seperate variable
* fix(more/editor): style fix
* fix(activities): zoomToTask functionality add
* fix(types): TaskEventType type add
* fix: ts types add
* fix(comment): add comment editor if task selected only
* fix(main): taskLayer opacity decrease, geojson property key change to state
* fix(editor): uplift state of editor if setEditorRef present
* fix(comment): clear editor content functionality add
* fix(more): if no events i.e.activities or comments then show a message
---
.../ProjectDetailsV2/ActivitiesPanel.tsx | 2 +-
.../lib/components/dialog-task-actions.svelte | 2 +-
.../src/lib/components/editor/editor.svelte | 26 +++--
src/mapper/src/lib/components/map/main.svelte | 16 ++-
.../src/lib/components/more/activities.svelte | 52 +++++++--
.../src/lib/components/more/comment.svelte | 101 +++++++++++++-----
.../src/lib/components/more/index.svelte | 52 +++++++--
src/mapper/src/lib/db/events.ts | 7 +-
src/mapper/src/lib/types.ts | 12 +++
.../src/routes/[projectId]/+page.svelte | 36 +++----
src/mapper/src/store/tasks.svelte.ts | 7 +-
11 files changed, 228 insertions(+), 85 deletions(-)
diff --git a/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx b/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx
index 33b598a500..55e59d318d 100644
--- a/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx
+++ b/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx
@@ -32,7 +32,7 @@ const ActivitiesPanel = ({ defaultTheme, state, params, map }: activitiesPanelTy
setAllActivities(projectTaskActivityList.length);
let finalTaskEvents: projectTaskActivity[] = taskHistories.filter((task) => {
- return task.username.replace(/\s+/g, '').toString().includes(searchText.toString());
+ return task?.username?.replace(/\s+/g, '')?.toString().includes(searchText.toString());
});
if (searchText != '') {
setTaskHistories(finalTaskEvents);
diff --git a/src/mapper/src/lib/components/dialog-task-actions.svelte b/src/mapper/src/lib/components/dialog-task-actions.svelte
index f17a2a8638..577c47d6c0 100644
--- a/src/mapper/src/lib/components/dialog-task-actions.svelte
+++ b/src/mapper/src/lib/components/dialog-task-actions.svelte
@@ -4,7 +4,7 @@
type Props = {
isTaskActionModalOpen: boolean;
- toggleTaskActionModal: (value: boolean) => {};
+ toggleTaskActionModal: (value: boolean) => void;
selectedTab: string;
projectId: number;
};
diff --git a/src/mapper/src/lib/components/editor/editor.svelte b/src/mapper/src/lib/components/editor/editor.svelte
index 97e8dce2ac..ee18e2f922 100644
--- a/src/mapper/src/lib/components/editor/editor.svelte
+++ b/src/mapper/src/lib/components/editor/editor.svelte
@@ -1,14 +1,21 @@
-
@@ -38,7 +46,7 @@
+ {taskStore?.selectedTaskId ? `No activities yet on task ${taskStore?.selectedTaskId}` : 'No activities yet'} +
+Localadmin
+{event?.username}
#2
+#{event?.task_id}
2024-10-21 11:42
++ + {event?.created_at?.split(' ')[0]} + + + {event?.created_at?.split(' ')[1]?.split('.')[0]} + +
- svcfmtm updated status to MAPPED + {event?.username} updated status to {event?.state}
-+ {taskStore?.selectedTaskId ? `No comments yet on task ${taskStore?.selectedTaskId}` : 'No comments yet'} +
+Localadmin
+{comment?.username}
#2
+#{comment?.task_id}
2024-10-21 11:42
++ + {comment?.created_at?.split(' ')[0]} + + + {comment?.created_at?.split(' ')[1]?.split('.')[0]} + +