Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Landscape membership list #1262

Closed
wants to merge 31 commits into from

Conversation

josebui
Copy link
Contributor

@josebui josebui commented Nov 1, 2023

Description

Landscape is using a group to handle the user memberships in this PR I changed it to use MembershipList to removing the dependency with Group.

With this PR there is some duplciation added for the components and functions that eventually will be removed when groups are changed to use membership list too.

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Related PRs

Comment on lines +67 to +68
const success = _.get('meta.requestStatus', data) === 'fulfilled';
if (success) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const success = _.get('meta.requestStatus', data) === 'fulfilled';
if (success) {
if (_.get('meta.requestStatus', data) === 'fulfilled') {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like success is only used once. Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulschreiber Yes, it is just used once, I added the separate variable for readibility

Comment on lines 154 to 155
// Get bounding box from nominatim.openstreetmap.org if no areaPolygon data
// AreaPolygon is not present when the user decided to skip it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: please explain in more detail.

Comment on lines 142 to 144
areaPolygon: landscape.areaPolygon
? JSON.parse(landscape.areaPolygon)
: null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questioN: do we need to wrap the parse in a try/catch?

src/landscape/landscapeSlice.js Outdated Show resolved Hide resolved
Comment on lines 509 to 512
if (landscape.slug === slug) {
return valueGenerator(landscape);
}
return landscape;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see note below regarding membership.email.

src/collaboration/components/MembershipJoinLeaveButton.js Outdated Show resolved Hide resolved
src/collaboration/components/MembershipJoinLeaveButton.js Outdated Show resolved Hide resolved
src/collaboration/components/MembershipPendingWarning.js Outdated Show resolved Hide resolved
@@ -0,0 +1,48 @@
import React, { useCallback } from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: add copyright notice.

import {
ALL_PARTNERSHIP_STATUS,
MEMBERSHIP_ROLE_MEMBER,
} from './landscapeConstants';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: do not use relative path.

@josebui josebui force-pushed the refactor/lanscape-group-memberships branch 2 times, most recently from 12e4993 to aefa45e Compare November 10, 2023 16:31
@josebui josebui force-pushed the refactor/lanscape-group-memberships branch from ee9bd4b to 26c74d2 Compare November 16, 2023 20:20
josebui and others added 23 commits November 21, 2023 12:06
@josebui josebui force-pushed the refactor/lanscape-group-memberships branch from 26c74d2 to 472a8f7 Compare November 21, 2023 17:11
@josebui
Copy link
Contributor Author

josebui commented Nov 21, 2023

The final PR is: #1317

@josebui josebui closed this Nov 21, 2023
@josebui josebui deleted the refactor/lanscape-group-memberships branch November 22, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants