From 9e54ecb607f2033b2a72ca42cd9ea0b3b26ccb79 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Wed, 10 Jan 2024 10:32:11 -0500 Subject: [PATCH 1/3] fix: Pass membership status when updating membership --- src/group/membership/components/GroupMembers.js | 1 + src/group/membership/components/GroupMembers.test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/group/membership/components/GroupMembers.js b/src/group/membership/components/GroupMembers.js index 573885d49..60bcb1c8c 100644 --- a/src/group/membership/components/GroupMembers.js +++ b/src/group/membership/components/GroupMembers.js @@ -70,6 +70,7 @@ const GroupMembers = () => { groupSlug: group.slug, userEmails: [membership.user.email], userRole: newRole, + membershipStatus: MEMBERSHIP_STATUS_APPROVED, }) ); }, diff --git a/src/group/membership/components/GroupMembers.test.js b/src/group/membership/components/GroupMembers.test.js index 46dd58556..ab702d097 100644 --- a/src/group/membership/components/GroupMembers.test.js +++ b/src/group/membership/components/GroupMembers.test.js @@ -388,6 +388,7 @@ test('GroupMembers: Manager actions', async () => { userEmails: ['email2@email.com'], groupSlug: 'test-group-slug', userRole: 'manager', + membershipStatus: 'APPROVED', }, } ); From 42f6d807b254274692fa4d92a0b71fba88523e59 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Wed, 10 Jan 2024 10:58:38 -0500 Subject: [PATCH 2/3] fix: Redirect to map page after publish --- .../components/GroupSharedDataVisualizationConfig.js | 2 +- .../components/VisualizationConfigForm/index.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/group/components/GroupSharedDataVisualizationConfig.js b/src/group/components/GroupSharedDataVisualizationConfig.js index ce7a5d25f..cd9c613aa 100644 --- a/src/group/components/GroupSharedDataVisualizationConfig.js +++ b/src/group/components/GroupSharedDataVisualizationConfig.js @@ -56,7 +56,7 @@ const GroupSharedDataVisualizationConfig = () => { const onCompleteSuccess = useCallback( configSlug => { - navigate(`/groups/${slug}/map/${configSlug}`); + navigate(`/groups/${slug}/map/${configSlug}`, { replace: true }); }, [navigate, slug] ); diff --git a/src/sharedData/visualization/components/VisualizationConfigForm/index.js b/src/sharedData/visualization/components/VisualizationConfigForm/index.js index 050033093..e6cb727a6 100644 --- a/src/sharedData/visualization/components/VisualizationConfigForm/index.js +++ b/src/sharedData/visualization/components/VisualizationConfigForm/index.js @@ -171,10 +171,13 @@ const VisualizationConfigForm = props => { setIsDirty(true); }, []); - const onCompleteSuccessWrapper = useCallback(() => { - onCompleteSuccess(visualizationConfig); - setIsDirty(false); - }, [onCompleteSuccess, visualizationConfig]); + const onCompleteSuccessWrapper = useCallback( + mapSlug => { + onCompleteSuccess(mapSlug); + setIsDirty(false); + }, + [onCompleteSuccess] + ); return ( <> From 0f6739f51424c501f93c164da7babb1d88ce6d41 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Wed, 10 Jan 2024 11:56:15 -0500 Subject: [PATCH 3/3] fix: Check if fetching account membership in membership card --- src/collaboration/components/MembershipCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collaboration/components/MembershipCard.js b/src/collaboration/components/MembershipCard.js index 547143630..f14cfdae4 100644 --- a/src/collaboration/components/MembershipCard.js +++ b/src/collaboration/components/MembershipCard.js @@ -84,7 +84,7 @@ const Content = props => { ); } - if (!accountMembership && closedGroup) { + if ((!accountMembership || accountMembership.fetching) && closedGroup) { return (