-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feat/display all members invite toggle #3200
Conversation
WalkthroughThis pull request introduces a new boolean flag, Suggested reviewers
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
backend/src/db/migrations/20250307001101_add-display-all-members-invite-to-org.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin". (The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/backend".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "backend/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
backend/src/db/migrations/20250307001101_add-display-all-members-invite-to-org.ts
(1 hunks)backend/src/db/schemas/organizations.ts
(1 hunks)backend/src/server/routes/v1/organization-router.ts
(1 hunks)backend/src/services/org/org-service.ts
(2 hunks)backend/src/services/org/org-types.ts
(1 hunks)frontend/src/components/projects/NewProjectModal.tsx
(2 hunks)frontend/src/hooks/api/organization/queries.tsx
(2 hunks)frontend/src/hooks/api/organization/types.ts
(1 hunks)frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
(2 hunks)frontend/src/pages/organization/SettingsPage/components/ProductSettings/ProductSettings.tsx
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Check Frontend Type and Lint check
frontend/src/components/projects/NewProjectModal.tsx
[error] 249-249: error TS2339: Property 'displayAllMembersInvite' does not exist on type 'Organization'.
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Check API Changes
- GitHub Check: Check TS and Lint
- GitHub Check: Run integration test
🔇 Additional comments (14)
frontend/src/hooks/api/organization/types.ts (1)
29-29
: LGTM: New boolean flag added correctlyThe addition of the optional
displayAllMembersInvite
boolean property to theUpdateOrgDTO
type aligns perfectly with the PR objective of controlling member invitation visibility.backend/src/services/org/org-types.ts (1)
75-75
: LGTM: Backend type definition added properlyThe addition of the
displayAllMembersInvite
boolean property to theTUpdateOrgDTO
type correctly mirrors the frontend changes and completes the type definition for the new feature.backend/src/db/schemas/organizations.ts (1)
25-26
: LGTM: Schema updated with correct default valueThe addition of the
displayAllMembersInvite
property with a default value oftrue
ensures backward compatibility with existing behavior as specified in the PR objectives.backend/src/server/routes/v1/organization-router.ts (1)
260-261
: LGTM: API schema updated correctlyThe addition of the optional
displayAllMembersInvite
boolean property to the request body schema properly enables the API endpoint to accept this new parameter when updating an organization.frontend/src/hooks/api/organization/queries.tsx (1)
112-114
: Good implementation of the new organization propertyThe
displayAllMembersInvite
parameter is correctly added to both the mutation function signature and the request payload, following the established pattern in the codebase.Also applies to: 122-124
frontend/src/components/projects/NewProjectModal.tsx (1)
54-54
: Good default value additionSetting a default value of
false
for theaddMembers
field ensures predictable behavior when the form is initialized.backend/src/db/migrations/20250307001101_add-display-all-members-invite-to-org.ts (1)
5-11
: LGTM: Good migration implementation for adding the columnThe
up
function correctly adds thedisplayAllMembersInvite
boolean column with a default value oftrue
to the Organization table.frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx (1)
14-14
: Good addition of the Products tabThe new Products tab is properly integrated into the organization settings page, following the established pattern of other tabs.
#!/bin/bash # Check if ProductSettings component exists fd -t f "ProductSettings.tsx" --exec ls -la {}Also applies to: 24-24
backend/src/services/org/org-service.ts (2)
283-299
: Feature addition looks correctThe
displayAllMembersInvite
property has been correctly added to theupdateOrg
function parameters. This new property follows the same pattern as other organization settings and will be used to control whether all members are displayed in the invite section during project creation.
363-372
: Correct implementation of updating the organization propertyThe
displayAllMembersInvite
property is properly included in the object passed toorgDAL.updateById()
. Unlike some other properties (e.g.,enforceMfa
orauthEnforced
), there are no permission or plan restrictions for this property, which seems appropriate for this feature.frontend/src/pages/organization/SettingsPage/components/ProductSettings/ProductSettings.tsx (4)
7-61
: Well-implemented ProductConfigSection component with proper error handlingThe
ProductConfigSection
component implements the toggle for displaying all members during project creation. It has good error handling (lines 11-31), provides user feedback through notifications, and correctly checks for the existence of the current organization before making API calls.
11-31
: Robust toggle handler implementationThe
handleDisplayAllMembersInviteToggle
function checks if organization data is available before making the API call, provides user feedback on success or failure, and handles errors appropriately.
44-53
: Good permission implementationThe toggle is correctly wrapped in an
OrgPermissionCan
component to restrict who can edit this setting based on their organization permissions. The toggle is disabled if the user doesn't have the required permissions.
63-69
: Simple wrapper componentThe
ProductSettings
component serves as a simple wrapper for the configuration section. This structure allows for easy addition of more product-related settings in the future.
backend/src/db/migrations/20250307001101_add-display-all-members-invite-to-org.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
z
Description 📣
Added a new 'Products' tab in Organization Settings to manage product-related options. Currently, it includes a single toggle for enabling/disabling the 'Add all members of my organization to this project' option in the project creation modal. A new field was added to the organizations table, defaulting to true to preserve existing behavior.
Type ✨
Tests 🛠️
https://www.loom.com/share/4ec308d0fbdc4d61a7080dff367a0ff3?sid=59a75731-ce29-49e5-a3ae-b1e02cbc8975
# Here's some code block to paste some code snippets
Summary by CodeRabbit
ProductSettings
component for managing member invitation display settings.