Add group update activity event (#504)

This commit is contained in:
Eduard Gert
2025-11-10 10:50:04 +01:00
committed by GitHub
parent 63f4c69eb4
commit e2219aeea0
3 changed files with 16 additions and 1 deletions

View File

@@ -391,6 +391,14 @@ export default function ActivityDescription({ event }: Props) {
</div>
);
if (event.activity_code == "group.update")
return (
<div className={"inline"}>
Group <Value>{event.meta.old_name}</Value> was renamed to{" "}
<Value>{event.meta.new_name}</Value>
</div>
);
/**
* Account
*/

View File

@@ -36,7 +36,7 @@ export const EditGroupNameModal = ({
}, [name, initialName, error]);
const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
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.");

View File

@@ -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<GroupUsage>[] = [
</GroupProvider>
),
},
{
accessorKey: "search",
accessorFn: (row) => removeAllSpaces(row.name),
filterFn: "fuzzy",
},
];
type Props = {
@@ -266,6 +272,7 @@ export default function GroupsTable({ headingTarget }: Readonly<Props>) {
rightSide={() => <AddGroupButton />}
columnVisibility={{
in_use: false,
search: false,
}}
>
{(table) => (