diff --git a/src/server/db/repository/card.repo.ts b/src/server/db/repository/card.repo.ts index 4970cb0a..90241268 100644 --- a/src/server/db/repository/card.repo.ts +++ b/src/server/db/repository/card.repo.ts @@ -249,11 +249,13 @@ export const getWithListAndMembersByPublicId = async ( toDescription, fromList:list!card_activity_fromListId_list_id_fk ( publicId, - name + name, + index ), toList:list!card_activity_toListId_list_id_fk ( publicId, - name + name, + index ), label!card_activity_labelId_label_id_fk ( publicId, diff --git a/src/views/card/components/ActivityList.tsx b/src/views/card/components/ActivityList.tsx index 71e88bdc..0184d5b6 100644 --- a/src/views/card/components/ActivityList.tsx +++ b/src/views/card/components/ActivityList.tsx @@ -6,6 +6,7 @@ import { HiOutlineUserMinus, HiOutlineArrowRight, HiOutlinePlus, + HiOutlineArrowLeft, } from "react-icons/hi2"; import Avatar from "~/components/Avatar"; @@ -114,14 +115,25 @@ const ACTIVITY_ICON_MAP: Partial> = "card.created": , "card.updated.title": , "card.updated.description": , - "card.updated.list": , "card.updated.label.added": , "card.updated.label.removed": , "card.updated.member.added": , "card.updated.member.removed": , } as const; -const getActivityIcon = (type: ActivityType): React.ReactNode | null => { +const getActivityIcon = ( + type: ActivityType, + fromIndex?: number | null, + toIndex?: number | null, +): React.ReactNode | null => { + console.log({ fromIndex, toIndex }); + if (type === "card.updated.list" && fromIndex != null && toIndex != null) { + return fromIndex > toIndex ? ( + + ) : ( + + ); + } return ACTIVITY_ICON_MAP[type] ?? null; }; @@ -174,7 +186,11 @@ const ActivityList = ({ size="sm" name={activity.user?.name ?? ""} email={activity.user?.email ?? ""} - icon={getActivityIcon(activity.type)} + icon={getActivityIcon( + activity.type, + activity.fromList?.index, + activity.toList?.index, + )} isLoading={isLoading} /> {index !== activities.length - 1 &&