Skip to content

Conversation

@joaosoutto
Copy link
Contributor

@joaosoutto joaosoutto commented Jan 22, 2025

As a user, on the BaseApp Profile,I would like to remove an existing member, In order to prevent them from doing anything in the profile.

Original Story:
Acceptance Criteria
Business Rules - Removing Member - 2

Given the user wants to remove a member, they can choose the remove option in the dropdown.

The remove option should be prominently displayed and in red font to dintinguish it from other options.

Given the user has selected to remove the member, display a confirmation dialog to make sure he intends to do this change.

Given the user has confirmed the removal of member, then remove the member from the organization and he should not be able to access the organizations profile anymore.

Copy Text

Removal Confirmation: Are you sure you want to remove this member? This action will revoke access to the organizational profile

Current behavior

Expected behavior

Code Snippet

Design Link: https://www.figma.com/design/XRD6wSl1m8Kz6XUcAy5CLp/BaseApp---WEB?node-id=3680-68785&node-type=instance&t=4tZzXNioOJs6iIeL-0

Approvd
https://app.approvd.io/projects/BA/stories/35056

DEMO: https://www.loom.com/share/c267ee0a8eb14ae787dc174abfd67c4b

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ability to remove members from a profile
    • Introduced member removal confirmation dialog
  • Improvements

    • Enhanced role management for chat room participants
    • Improved type safety for participant roles
  • Bug Fixes

    • Refined chat room update mutation handling

The update introduces a streamlined process for managing profile members, including a new confirmation step before removing a member and more robust role-based controls.

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: b91f4fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/components/modules/profiles/Members/MemberItem/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
packages/components/modules/profiles/graphql/mutations/RemoveMember.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
packages/components/modules/profiles/Members/constants.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
  • 1 others

Walkthrough

The pull request introduces functionality for removing a member from a profile, enhancing the MemberItem component. This includes the addition of a new GraphQL mutation for member removal, a confirmation dialog for user verification, and state management to control the visibility of removed members. An enumeration for member actions is also introduced, integrating the removal action into the existing role options.

Changes

File Change Summary
packages/components/modules/profiles/Members/MemberItem/index.tsx Added member removal functionality, including confirmation dialog, mutation hook, and state management for hiding removed members.
packages/components/modules/profiles/Members/constants.ts Introduced MemberActions enum with remove action and updated roleOptions.
packages/components/modules/profiles/graphql/mutations/RemoveMember.ts Created new GraphQL mutation and custom hook for removing members.
packages/components/schema.graphql Updated GraphQL schema with new input types, payload types, and mutation for member removal.
packages/components/package.json Updated dependency versions for various libraries, transitioning from catalog references to fixed versioning.

Possibly related PRs

  • BA-1777: multiple profiles member list #135: The main PR enhances the MemberItem component with member removal functionality, which relates to the previous PR that introduced the MemberItem component itself, establishing a foundational structure for member management.
  • Ba 1839 fe multiple profiles edit member role #143: This PR modifies the MemberItem component to enhance role management, which is closely related to the main PR's focus on managing member actions, including removal.
  • BA-1965: implement reaction notification #161: The introduction of reaction notifications in this PR may relate to the overall messaging and interaction features being developed, including member actions like removal, as both involve user interactions within the messaging context.

Suggested reviewers

  • Hercilio1
  • deboracosilveira
  • anicioalexandre
  • pt-tsl
  • rafaelhdr

Poem

🐰 A rabbit's tale of member might,
Removing roles with swift delight,
Mutations dance, confirmations sing,
A GraphQL ballet on coding's wing!
Farewell, dear member, your time is done ✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
packages/components/modules/profiles/Members/constants.ts (1)

29-32: Consider separating actions from roles.

While the implementation works, mixing member actions with role options might not be the most intuitive design. Consider creating a separate dropdown or button for the remove action to:

  1. Better separate concerns between role management and member removal
  2. Prevent accidental member removal when changing roles
  3. Align with common UX patterns where destructive actions are separated from regular options
packages/components/modules/profiles/graphql/mutations/RemoveMember.ts (1)

15-38: Consider adding loading state feedback.

The mutation implementation is solid with good error handling and notifications. However, consider showing a loading state to users during the mutation.

 const commit = (config: UseMutationConfig<RemoveMemberMutation>) =>
   commitMutation({
     ...config,
+    optimisticResponse: {
+      profileRemoveMember: {
+        deletedId: config.variables.input.userId,
+      },
+    },
     onCompleted: (response, errors) => {
packages/components/modules/profiles/Members/MemberItem/index.tsx (2)

57-70: Consider adding error recovery mechanism.

The member removal functions are well-implemented, but consider adding a way to recover from failed removals.

 const removeProfileMember = () => {
   if (currentProfile?.id && userId) {
     removeMember({
       variables: { input: { profileId: currentProfile.id, userId } },
+      onError: () => {
+        setHideMember(false); // Reset UI state on error
+      },
     })
   }
 }

103-110: Consider using a dedicated handler for remove action.

The current implementation mixes role change and remove action handling. Consider separating these concerns for better maintainability.

-onChange={(event, _) => {
-  const { value } = event.target
-  if (value === MemberActions.remove) {
-    handleRemoveMemberDialog()
-  } else {
-    handleRoleChange(event as SelectChangeEvent<{ value: MemberRoles }>)
-  }
-}}
+onChange={handleSelectChange}

+const handleSelectChange = (event: SelectChangeEvent<unknown>, child: React.ReactNode) => {
+  const { value } = event.target
+  if (value === MemberActions.remove) {
+    handleRemoveMemberDialog()
+    return
+  }
+  handleRoleChange(event as SelectChangeEvent<{ value: MemberRoles }>)
+}
packages/components/schema.graphql (1)

1236-1242: Consider adding more details in the payload.

The payload could be more informative by including the affected profile or user details.

type ProfileRemoveMemberPayload {
  """May contain more than one error for same field."""
  errors: [ErrorType]
  _debug: DjangoDebug
  deletedId: ID
+ profile: Profile
+ removedUserId: ID
  clientMutationId: String
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8256fe and 934acd66321aee7a51c68400e6828a96de3301f3.

⛔ Files ignored due to path filters (1)
  • packages/components/__generated__/RemoveMemberMutation.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (4)
  • packages/components/modules/profiles/Members/MemberItem/index.tsx (6 hunks)
  • packages/components/modules/profiles/Members/constants.ts (2 hunks)
  • packages/components/modules/profiles/graphql/mutations/RemoveMember.ts (1 hunks)
  • packages/components/schema.graphql (7 hunks)
🔇 Additional comments (5)
packages/components/modules/profiles/Members/constants.ts (1)

16-18: LGTM! Clean enum implementation.

The MemberActions enum is well-defined and follows TypeScript best practices.

packages/components/modules/profiles/graphql/mutations/RemoveMember.ts (1)

7-13: LGTM! Well-structured GraphQL mutation.

The mutation is properly defined with the correct input type and deletion record handling.

packages/components/modules/profiles/Members/MemberItem/index.tsx (2)

34-35: LGTM! Clean state management.

Good use of state hooks for managing member visibility and removal mutation.


166-182: LGTM! Well-implemented confirmation dialog.

The confirmation dialog follows the PR requirements with clear messaging and proper action buttons.

packages/components/schema.graphql (1)

1230-1234: LGTM! Well-defined input type.

The ProfileRemoveMemberInput type is properly defined with required fields.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/components/package.json (1)

67-67: Fix caret ranges in dependencies.

Some dependencies use caret ranges (^) which can lead to unexpected updates:

  • "@faker-js/faker": "^9.0.3"
  • "eslint-plugin-storybook": "^0.8.0"

Consider using fixed versions for better predictability:

-    "@faker-js/faker": "^9.0.3",
+    "@faker-js/faker": "9.0.3",
-    "eslint-plugin-storybook": "^0.8.0",
+    "eslint-plugin-storybook": "0.8.0",

Also applies to: 100-100

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 934acd66321aee7a51c68400e6828a96de3301f3 and 27a9e1ff1de37f95ae0c5301a85ec702346b0230.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/components/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Component Test Applications and Packages
  • GitHub Check: Lint
🔇 Additional comments (2)
packages/components/package.json (2)

55-56: Verify React 18.3.1 compatibility.

The update to React 18.3.1 is significant and may introduce breaking changes.

Run this script to check for potential compatibility issues:


24-48: Verify breaking changes in core dependencies.

Several core dependencies have major version updates which may introduce breaking changes:

  • @mui/* packages (5.x series)
  • @tanstack/react-query (5.x)
  • react-relay (16.x)

Run this script to check for potential breaking changes:

✅ Verification successful

Dependencies are safe to update - no breaking changes impact detected

The codebase is already using modern patterns and APIs across all core dependencies:

  • MUI v5: Using recommended createTheme and ThemeProvider
  • React Query v5: Proper usage of new object config syntax
  • React Relay v16: Following recommended hooks and patterns
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in core dependencies

# Check MUI v5 breaking changes
echo "Checking for MUI v5 breaking changes..."
rg "createTheme|ThemeProvider|makeStyles|withStyles|createStyles"

# Check react-query v5 breaking changes
echo "Checking for react-query v5 breaking changes..."
rg "useQuery|useMutation|useInfiniteQuery"

# Check react-relay v16 breaking changes
echo "Checking for react-relay v16 breaking changes..."
rg "useLazyLoadQuery|usePreloadedQuery|usePaginationFragment"

Length of output: 26359

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid using Next.js canary version in production.

Using next: "14.3.0-canary.24" in production dependencies is risky as canary releases are unstable and may contain breaking changes.

Consider using the latest stable version instead:

-    "next": "14.3.0-canary.24",
+    "next": "14.2.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"next": "14.3.0-canary.24",
"next": "14.2.0",

Comment on lines +59 to +120
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Webpack version 5.93.0 has a known security vulnerability

The current webpack version is vulnerable to a moderate severity XSS issue through the AutoPublicPathRuntimeModule. Please upgrade to webpack 5.94.0 or later.

  • Update webpack from "5.93.0" to "^5.94.0" in packages/components/package.json
🔗 Analysis chain

Verify security advisories for dev dependencies.

Several development dependencies have been updated to new major versions. Let's verify there are no known security vulnerabilities.

Run this script to check for security advisories:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for security advisories in dev dependencies

# Check for security advisories using GitHub API
for pkg in "@storybook/react" "@testing-library/react" "jest" "cypress" "webpack"; do
  echo "Checking $pkg..."
  gh api graphql -f query='{
    securityVulnerabilities(first: 5, ecosystem: NPM, package: "'$pkg'") {
      nodes {
        advisory {
          summary
          severity
          publishedAt
        }
        vulnerableVersionRange
        firstPatchedVersion {
          identifier
        }
      }
    }
  }'
done

Length of output: 3049

@joaosoutto joaosoutto force-pushed the BA-2123-multiple-profiles-removing-member branch from 27a9e1f to b91f4fd Compare January 29, 2025 15:57
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
packages/components/package.json (1)

Line range hint 1-120: Fix the out-of-sync lockfile.

The pipeline is failing because pnpm-lock.yaml is out of sync with package.json. Run pnpm install to update the lockfile.

pnpm install
🧰 Tools
🪛 GitHub Actions: Main Workflow

[error] pnpm-lock.yaml is out of sync with package.json. The lockfile's dependency specifications do not match those in package.json. Run 'pnpm install' without the --frozen-lockfile flag to update the lockfile.

🧹 Nitpick comments (2)
packages/components/modules/profiles/Members/MemberItem/index.tsx (2)

104-111: Add loading state feedback during member removal.

The UI should indicate when a member removal is in progress.

 onChange={(event, _) => {
   const { value } = event.target
   if (value === MemberActions.remove) {
+    if (isRemovingMember) return
     handleRemoveMemberDialog()
   } else {
     handleRoleChange(event as SelectChangeEvent<{ value: MemberRoles }>)
   }
 }}

170-186: Improve accessibility of the confirmation dialog.

Add ARIA labels and role attributes to improve accessibility.

 <ConfirmDialog
   title="Remove member"
   open={openConfirmRemoveMember}
   onClose={handleRemoveMemberDialog}
+  aria-label="Remove member confirmation dialog"
+  role="alertdialog"
   content={
     <Typography variant="body1">
       Are you sure you want to remove this member? This action will revoke their access to the
       organization profile.
     </Typography>
   }
   cancelText="Back"
   action={
-    <Button variant="contained" color="error" onClick={confirmRemoveProfileMember}>
+    <Button 
+      variant="contained" 
+      color="error" 
+      onClick={confirmRemoveProfileMember}
+      aria-label="Confirm member removal"
+    >
       Remove
     </Button>
   }
 />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27a9e1ff1de37f95ae0c5301a85ec702346b0230 and b91f4fd.

⛔ Files ignored due to path filters (2)
  • packages/components/__generated__/RemoveMemberMutation.graphql.ts is excluded by !**/__generated__/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/components/modules/profiles/Members/MemberItem/index.tsx (6 hunks)
  • packages/components/modules/profiles/Members/constants.ts (2 hunks)
  • packages/components/modules/profiles/graphql/mutations/RemoveMember.ts (1 hunks)
  • packages/components/package.json (1 hunks)
  • packages/components/schema.graphql (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/modules/profiles/Members/constants.ts
  • packages/components/modules/profiles/graphql/mutations/RemoveMember.ts
🧰 Additional context used
🪛 GitHub Actions: Main Workflow
packages/components/package.json

[error] pnpm-lock.yaml is out of sync with package.json. The lockfile's dependency specifications do not match those in package.json. Run 'pnpm install' without the --frozen-lockfile flag to update the lockfile.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/components/package.json (2)

39-39: Avoid using Next.js canary version in production.

Using next: "14.3.0-canary.24" in production dependencies is risky as canary releases are unstable. Consider using the latest stable version instead.

🧰 Tools
🪛 GitHub Actions: Main Workflow

[error] pnpm-lock.yaml is out of sync with package.json. The lockfile's dependency specifications do not match those in package.json. Run 'pnpm install' without the --frozen-lockfile flag to update the lockfile.


118-118: Update webpack to patch security vulnerability.

The current webpack version (5.93.0) has a known XSS vulnerability. Please upgrade to version 5.94.0 or later.

🧰 Tools
🪛 GitHub Actions: Main Workflow

[error] pnpm-lock.yaml is out of sync with package.json. The lockfile's dependency specifications do not match those in package.json. Run 'pnpm install' without the --frozen-lockfile flag to update the lockfile.

packages/components/schema.graphql (1)

1258-1270: LGTM! The GraphQL schema changes look good.

The new types and mutation for member removal are well-structured and follow GraphQL best practices:

  • Required fields are properly marked
  • Consistent naming conventions
  • Proper error handling structure

Comment on lines +35 to +36
const [hideMember, setHideMember] = useState(false)
const [removeMember, isRemovingMember] = useRemoveMemberMutation(setHideMember)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling for the remove member mutation.

The mutation should handle potential errors and provide feedback to the user.

-  const [removeMember, isRemovingMember] = useRemoveMemberMutation(setHideMember)
+  const [removeMember, isRemovingMember] = useRemoveMemberMutation(setHideMember, {
+    onError: (error) => {
+      // Show error notification to user
+      console.error('Failed to remove member:', error)
+    }
+  })

Committable suggestion skipped: line range outside the PR's diff.

@joaosoutto joaosoutto closed this Jan 30, 2025
@nossila nossila deleted the BA-2123-multiple-profiles-removing-member branch May 27, 2025 02:03
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