[WEB-4192]fix: inactive member is hidden in created by#7435
[WEB-4192]fix: inactive member is hidden in created by#7435sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughThe changes update the handling of workspace member activity status across both backend and frontend. The backend now returns all members regardless of their active status, while the frontend filters to display only active members. Type definitions and store logic are updated to include the optional Changes
Sequence Diagram(s)sequenceDiagram
participant Client (Web)
participant API
participant DB
Client->>API: Request workspace members
API->>DB: Query all members (no is_active filter)
DB-->>API: Return all members (active + inactive)
API-->>Client: Return all members
Client->>Client: Filter members (is_active == true)
Client->>Client: Display only active members
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/core/components/workspace/settings/members-list.tsx (1)
50-52: Handle undefinedis_activevalues explicitly.The filtering logic correctly excludes inactive members, but consider handling the case where
is_activeis undefined. Since this is an optional property, you might want to be more explicit about whether undefined should be treated as active or inactive.Consider this more explicit approach:
const memberDetails = searchedMemberIds ?.map((memberId) => getWorkspaceMemberDetails(memberId)) - .filter((member) => member?.is_active); + .filter((member) => member?.is_active !== false);This treats undefined as active, which is likely the desired behavior for backward compatibility.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/api/plane/app/views/workspace/member.py(1 hunks)apps/web/core/components/workspace/settings/members-list.tsx(1 hunks)apps/web/core/store/member/workspace-member.store.ts(3 hunks)packages/types/src/workspace.ts(1 hunks)
🔇 Additional comments (5)
packages/types/src/workspace.ts (1)
86-86: Clean type extension for active status tracking.The addition of the optional
is_activeproperty to theIWorkspaceMemberinterface is well-designed and maintains backward compatibility while enabling the new functionality to distinguish between active and inactive members.apps/web/core/store/member/workspace-member.store.ts (3)
22-22: Good interface extension for workspace membership.The addition of the optional
is_activeproperty to theIWorkspaceMembershipinterface is consistent with the type definitions and enables proper tracking of member active status in the store.
179-179: Proper propagation of active status in member details.The
is_activeproperty is correctly propagated when constructing theIWorkspaceMemberobject returned bygetWorkspaceMemberDetails. This ensures the frontend components receive the active status information.
212-212: Correct storage of active status from API response.The
is_activeproperty is properly stored when setting member data in the store, ensuring the active status information from the backend is preserved in the client-side store.apps/api/plane/app/views/workspace/member.py (1)
36-36: Correctly removes active filter to include all members.The removal of
.filter(is_active=True)from the base queryset is the right approach to fix the issue. This allows the API to return all workspace members (both active and inactive), enabling the frontend to make appropriate filtering decisions. Other methods in the class still appropriately filter byis_active=Truewhere needed for operations that should only work with active members.
Description
This update fixes the issue where inactive user is hidden from
Created byin a work item.Type of Change
Summary by CodeRabbit
New Features
Bug Fixes
Chores