From 537a6a9052ec5e34ff1488cb8e330f65805c9dfc Mon Sep 17 00:00:00 2001 From: Eduard Gert Date: Thu, 6 Nov 2025 17:21:35 +0100 Subject: [PATCH] Add group update activity event --- src/modules/activity/ActivityDescription.tsx | 8 ++++++++ src/modules/groups/EditGroupNameModal.tsx | 2 +- src/modules/groups/table/GroupsTable.tsx | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/activity/ActivityDescription.tsx b/src/modules/activity/ActivityDescription.tsx index a1ee0c19..eb8c21de 100644 --- a/src/modules/activity/ActivityDescription.tsx +++ b/src/modules/activity/ActivityDescription.tsx @@ -391,6 +391,14 @@ export default function ActivityDescription({ event }: Props) { ); + if (event.activity_code == "group.update") + return ( +
+ Group {event.meta.old_name} was renamed to{" "} + {event.meta.new_name} +
+ ); + /** * Account */ diff --git a/src/modules/groups/EditGroupNameModal.tsx b/src/modules/groups/EditGroupNameModal.tsx index e912bcf6..818db781 100644 --- a/src/modules/groups/EditGroupNameModal.tsx +++ b/src/modules/groups/EditGroupNameModal.tsx @@ -36,7 +36,7 @@ export const EditGroupNameModal = ({ }, [name, initialName, error]); const handleNameChange = (e: React.ChangeEvent) => { - const newName = trim(e.target.value); + const newName = e.target.value; const findGroup = groups?.find((g) => g.name === newName); if (findGroup) { setError("This group already exists. Please choose another name."); diff --git a/src/modules/groups/table/GroupsTable.tsx b/src/modules/groups/table/GroupsTable.tsx index e051da92..42521ac3 100644 --- a/src/modules/groups/table/GroupsTable.tsx +++ b/src/modules/groups/table/GroupsTable.tsx @@ -3,6 +3,7 @@ import { DataTable } from "@components/table/DataTable"; import DataTableHeader from "@components/table/DataTableHeader"; import { DataTableRowsPerPage } from "@components/table/DataTableRowsPerPage"; import { ColumnDef, SortingState } from "@tanstack/react-table"; +import { removeAllSpaces } from "@utils/helpers"; import { Layers3Icon } from "lucide-react"; import { usePathname } from "next/navigation"; import React from "react"; @@ -228,6 +229,11 @@ export const GroupsTableColumns: ColumnDef[] = [ ), }, + { + accessorKey: "search", + accessorFn: (row) => removeAllSpaces(row.name), + filterFn: "fuzzy", + }, ]; type Props = { @@ -266,6 +272,7 @@ export default function GroupsTable({ headingTarget }: Readonly) { rightSide={() => } columnVisibility={{ in_use: false, + search: false, }} > {(table) => (