-
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
feat(delegation-api): Add GeneralMandate delegations to accessControl #16170
Conversation
WalkthroughThe pull request enhances the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 (1)
libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (1)
185-187
: LGTM: Conditional rendering updated to include GeneralMandate type.The addition of
delegation.type === AuthDelegationType.GeneralMandate
to the conditional rendering logic aligns with the PR objective to incorporate general mandate delegations. This change correctly extends the cases where the delegation type label is rendered.Consider extracting the condition into a separate variable for improved readability:
const shouldRenderDelegationTypeLabel = isAdminView || !isOutgoing || delegation.type === AuthDelegationType.GeneralMandate; {shouldRenderDelegationTypeLabel && ( // ... existing code )}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- libs/auth-api-lib/src/lib/delegations/delegations-outgoing.service.ts (2 hunks)
- libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/auth-api-lib/src/lib/delegations/delegations-outgoing.service.ts (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/access/AccessCard.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 (5)
libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (2)
8-14
: LGTM: Import statements reorganized and new components added.The reordering of import statements and addition of new component imports (
Inline
,Stack
,Tag
, andText
) improve code organization and indicate the use of these components in the file. This change adheres to the coding guideline for effective tree-shaking and bundling practices.
Line range hint
1-324
: LGTM: Component adheres to coding guidelines forlibs/**/*
.The
AccessCard
component follows the coding guidelines for thelibs/**/*
pattern:
- It's a reusable React component that can be used across different NextJS apps.
- TypeScript is used for defining props (AccessCardProps interface).
- The component structure supports effective tree-shaking and bundling practices.
libs/auth-api-lib/src/lib/delegations/delegations-outgoing.service.ts (3)
42-43
: LGTM: New import added correctlyThe new import for
DelegationDelegationType
is correctly placed and follows the existing import style. Both this and theAuthDelegationType
import are necessary for the new functionality in thefindAll
method.
108-135
: LGTM: TypeScript usage and reusabilityThe new code maintains consistent TypeScript usage, leveraging type inference and existing model types. The changes are well-integrated into the
DelegationsOutgoingService
class without introducing any reusability issues across different NextJS apps.The modifications are specific to this service and align well with the existing codebase structure. No additional types need to be exported, preserving the current level of modularity.
Line range hint
42-135
: Summary: Successfully implemented GeneralMandate delegationsThe changes in this file successfully implement the feature to incorporate general mandate delegations into the access control section, specifically within the "From" tab. The modifications allow users to view their GeneralMandate delegations, aligning well with the PR objectives.
Key points:
- New imports added correctly.
- The
findAll
method now includes GeneralMandate delegations.- TypeScript usage is consistent and doesn't introduce reusability issues.
The implementation enhances the access control functionality as intended, improving the overall usability of the system. A minor optimization using
Promise.all
was suggested to potentially improve performance.
libs/auth-api-lib/src/lib/delegations/delegations-outgoing.service.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16170 +/- ##
=======================================
Coverage 36.69% 36.69%
=======================================
Files 6776 6776
Lines 139586 139592 +6
Branches 39680 39680
=======================================
+ Hits 51222 51227 +5
- Misses 88364 88365 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 13 Total Test Services: 0 Failed, 13 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
libs/auth-api-lib/src/lib/delegations/delegations-outgoing.service.ts
Outdated
Show resolved
Hide resolved
…#16170) * delegation-to for access control * performance fixes * fix zendesk constants * small refactor * small refactor --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
What
Add general mandate delegations to the access control->From tab since it is missing there
Why
So users can see GeneralMandate delegations that they have given
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Chores