Skip to content

[PROD RELEASE] - Bug fixes #1648

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

Merged
merged 7 commits into from
May 13, 2025
Merged

[PROD RELEASE] - Bug fixes #1648

merged 7 commits into from
May 13, 2025

Conversation

kkartunov
Copy link
Contributor

@@ -251,7 +253,7 @@ class Users extends Component {
)
}
{
membersExist && (
!isLoadingProject && membersExist && (

Choose a reason for hiding this comment

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

Consider checking the isLoadingProject condition earlier in the logic to potentially avoid unnecessary checks or rendering. This might improve readability and performance if isLoadingProject is a common state.

@@ -305,6 +307,8 @@ class Users extends Component {
)
}

{isLoadingProject && <Loader />}

Choose a reason for hiding this comment

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

Consider adding a conditional rendering check to ensure that the Loader component is only displayed when necessary. This will prevent unnecessary rendering and improve performance.

@@ -322,6 +326,7 @@ Users.propTypes = {
projects: PropTypes.arrayOf(PropTypes.object),
projectMembers: PropTypes.arrayOf(PropTypes.object),
invitedMembers: PropTypes.arrayOf(PropTypes.object),
isLoadingProject: PropTypes.bool.isRequired,

Choose a reason for hiding this comment

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

The addition of isLoadingProject as a required prop is clear, but ensure that this prop is being used correctly within the component to handle loading states. Double-check if there are any related changes needed in the component logic to accommodate this new prop.

@@ -21,7 +21,8 @@ class Users extends Component {
loginUserRoleInProject: '',
projectMembers: null,
invitedMembers: null,
isAdmin: false
isAdmin: false,
isLoadingProject: false
}
this.loadProject = this.loadProject.bind(this)
this.updateProjectNember = this.updateProjectNember.bind(this)

Choose a reason for hiding this comment

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

Typo in method name updateProjectNember. It should likely be updateProjectMember.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hentrymartin can you please commit a fix for this in develop?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@kkartunov I've added a fix for this!

@@ -80,9 +81,10 @@ class Users extends Component {
}

loadProject (projectId) {
this.setState({ isLoadingProject: true })

Choose a reason for hiding this comment

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

Consider handling potential errors from fetchProjectById to ensure isLoadingProject state is properly reset in case of failure.

@@ -91,7 +93,8 @@ class Users extends Component {
invitedMembers: invitedMembers.map(m => ({
...m,
email: m.email || invitedUsers[m.userId].handle
}))
})),
isLoadingProject: false

Choose a reason for hiding this comment

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

The addition of isLoadingProject: false seems to be outside the scope of the invitedMembers mapping. Ensure that this property is intended to be part of the state update and not mistakenly included within the invitedMembers transformation.

@@ -42,11 +42,11 @@ class UserCard extends Component {
isUpdatingPermission: true
})

const { user, updateProjectNember } = this.props
const { user, updateProjectMember } = this.props

Choose a reason for hiding this comment

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

Typo fix: The variable updateProjectNember was corrected to updateProjectMember. Ensure that all references to this function are updated throughout the codebase to prevent any potential errors.

</div>
)
}
}

Users.propTypes = {
loadProject: PropTypes.func.isRequired,
updateProjectNember: PropTypes.func.isRequired,
updateProjectMember: PropTypes.func.isRequired,
removeProjectNember: PropTypes.func.isRequired,

Choose a reason for hiding this comment

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

Typo correction needed: removeProjectNember should be removeProjectMember to match the corrected spelling of updateProjectMember.

}
this.loadProject = this.loadProject.bind(this)
this.updateProjectNember = this.updateProjectNember.bind(this)
this.updateProjectMember = this.updateProjectMember.bind(this)
this.removeProjectNember = this.removeProjectNember.bind(this)

Choose a reason for hiding this comment

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

The method removeProjectNember seems to have a typo in its name. Consider renaming it to removeProjectMember to maintain consistency with the corrected method name updateProjectMember.

})
const { loggedInUser } = this.props
this.updateLoginUserRoleInProject(projectMembers, loggedInUser)
})
}

updateProjectNember (newMemberInfo) {
updateProjectMember (newMemberInfo) {

Choose a reason for hiding this comment

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

The function name updateProjectMember has been corrected from updateProjectNember. Ensure that all references to this function throughout the codebase are updated to prevent any potential errors.

} = this.state
return (
<UsersComponent
projects={projects}
loadProject={this.loadProject}
updateProjectNember={this.updateProjectNember}
updateProjectMember={this.updateProjectMember}
removeProjectNember={this.removeProjectNember}

Choose a reason for hiding this comment

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

The function name removeProjectNember seems to have a typo similar to the one corrected for updateProjectMember. Consider renaming it to removeProjectMember for consistency and clarity.

@@ -109,15 +110,15 @@ class Users extends Component {
async onRemoveConfirmClick () {
if (this.state.isRemoving) { return }

const { removeProjectNember, invitedMembers } = this.props
const { removeProjectMember, invitedMembers } = this.props

Choose a reason for hiding this comment

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

Typo fix: The variable removeProjectNember was corrected to removeProjectMember. Ensure that this change is consistent throughout the codebase where this variable is used.

@@ -111,7 +114,7 @@ class Users extends Component {
this.updateLoginUserRoleInProject(newProjectMembers, loggedInUser)
}

removeProjectNember (projectMember) {
removeProjectMember (projectMember) {

Choose a reason for hiding this comment

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

Typo fix: The method name was corrected from removeProjectNember to removeProjectMember. Ensure that all references to this method throughout the codebase are updated accordingly to prevent any potential errors.

@kkartunov kkartunov merged commit ed41222 into master May 13, 2025
7 checks passed
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