From 87e3c59da8b2594cdc40a784c3a038db4b3d9eee Mon Sep 17 00:00:00 2001 From: niestrow Date: Fri, 29 Nov 2024 17:24:40 +0100 Subject: [PATCH] FIx sharing project not saving --- frontend-v2/src/features/projects/Project.tsx | 35 ++++++++++++------- .../src/features/projects/UserAccess.tsx | 10 +++++- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/frontend-v2/src/features/projects/Project.tsx b/frontend-v2/src/features/projects/Project.tsx index 7ac934c8..7db9a7fe 100644 --- a/frontend-v2/src/features/projects/Project.tsx +++ b/frontend-v2/src/features/projects/Project.tsx @@ -160,7 +160,6 @@ const ProjectRow: FC = ({ () => dispatch(decrementDirtyCount()), ); } - console.log('project', project, data.project) if (JSON.stringify(project) !== JSON.stringify(data.project)) { dispatch(incrementDirtyCount()); updateProject({ id: project.id, project: data.project }).then(() => @@ -173,9 +172,15 @@ const ProjectRow: FC = ({ ); const onCancel = () => { - setValue('project.description', project.description); + setValue("project.description", project.description); }; + const onShareCanel = () => { + setValue("project.user_access", project.user_access); + setUserAccessOpen(false); + setIsEditMode(false); + } + if (isLoading) { return
Loading...
; } @@ -341,7 +346,10 @@ const ProjectRow: FC = ({ setUserAccessOpen(true)} + onClick={() => { + setIsEditMode(true); + setUserAccessOpen(true); + }} disabled={isSharedWithMe} > @@ -352,15 +360,6 @@ const ProjectRow: FC = ({ - {isSharedWithMe && (
@@ -402,6 +401,16 @@ const ProjectRow: FC = ({ )} + {isDescriptionModalOpen && ( = ({ project={project} > void; remove: (index: number) => void; + onCancel: () => void; control: Control; onClose: () => void; } @@ -41,7 +42,7 @@ const UserAccess: FC = ({ userAccess, append, remove, - control, + onCancel, onClose, }) => { const { data: users } = useUserListQuery(); @@ -122,6 +123,13 @@ const UserAccess: FC = ({ margin: ".5rem", }} > +