-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(auth-admin): Removed Legal guardian minor delegation type from access control #16676
Conversation
WalkthroughThe changes in this pull request involve modifications to two components, Changes
Possibly related PRs
Suggested labels
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? 🪧 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
Documentation and Community
|
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: 1
🧹 Outside diff range and nitpick comments (3)
libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (2)
61-63
: LGTM! Consider adding a comment explaining the business context.The implementation correctly filters out LegalGuardianMinor delegations. Consider adding a comment explaining why this delegation type is excluded for better maintainability.
+// Legal guardian minor delegations are handled separately and should not be displayed if (delegation.type === AuthDelegationType.LegalGuardianMinor) return null
Line range hint
1-140
: Component structure follows best practices for shared modules.The component demonstrates good practices for shared library code:
- Proper TypeScript usage with well-defined types
- Modular imports supporting tree-shaking
- Reusable component structure suitable for different NextJS apps
libs/portals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx (1)
Line range hint
1-190
: Consider enhancing component reusability.To improve reusability across different NextJS apps, consider making the filtered delegation types configurable through props. This would allow the component to be more flexible and reusable in different contexts.
Here's a suggestion for making the component more configurable:
interface DelegationsOutgoingProps { excludedDelegationTypes?: AuthDelegationType[]; // ... other props } export const DelegationsOutgoing = ({ excludedDelegationTypes = [AuthDelegationType.LegalGuardianMinor], // ... other props }: DelegationsOutgoingProps) => { // ... existing code }This way, the component can be reused with different filtering requirements while maintaining the current default behavior.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx
(1 hunks)libs/portals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/portals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (1)
libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (1)
61-63
: Verify the impact on existing delegations.
The removal of LegalGuardianMinor delegations might affect users with existing delegations of this type.
Let's verify the usage and potential impact:
...rtals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 70 Total Test Services: 0 Failed, 67 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
What
Removed Legal guardian minor delegation type from access control
Why
So it will not be displayed
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes