-
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(service-portal): Delete and view delegation in service portal form me list #16400
Conversation
WalkthroughThe changes in this pull request involve updates to two components: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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: 0
🧹 Outside diff range and nitpick comments (1)
libs/portals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx (1)
Line range hint
1-20
: Consider optimizing imports for better tree-shakingWhile the code adheres to the coding guidelines for
libs/**/*
, there's an opportunity to optimize imports. The file currently imports many dependencies, which could potentially impact tree-shaking.Consider reviewing these imports and only import what's necessary. For example, if you're not using all components from
@island.is/island-ui/core
, you could import them individually:import { SkeletonLoader } from '@island.is/island-ui/core/SkeletonLoader' import { Stack } from '@island.is/island-ui/core/Stack' import { Box } from '@island.is/island-ui/core/Box'This approach can lead to more effective tree-shaking and potentially smaller bundle sizes.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- libs/portals/shared-modules/delegations/src/components/delegations/DelegationViewModal.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/DelegationViewModal.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 (2)
libs/portals/shared-modules/delegations/src/components/delegations/DelegationViewModal.tsx (1)
157-157
: Improved date validation forvalidTo
This change enhances the accuracy of date validation by converting
delegation.validTo
to aDate
object before passing it to theisValid
function. This approach is more robust and aligns with theisValid
function's expected input type.The modification addresses the PR objective of correctly displaying the
validTo
date, ensuring that the component handles date validation more reliably.libs/portals/shared-modules/delegations/src/components/delegations/outgoing/DelegationsOutgoing.tsx (1)
124-128
: ImprovedonDelete
implementationThe simplification of the
onDelete
prop is a good improvement. It enhances code readability and maintainability by removing the conditional logic. This change aligns well with the PR objectives by enabling deletion for all delegation types, including general mandates.The implementation maintains type safety with TypeScript and preserves the component's reusability across different NextJS apps. Good job on this refactoring!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16400 +/- ##
=======================================
Coverage 36.73% 36.73%
=======================================
Files 6808 6808
Lines 141061 141061
Branches 40217 40217
=======================================
Hits 51817 51817
Misses 89244 89244
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 ReportBranch report: ✅ 0 Failed, 4 Passed, 0 Skipped, 2.69s Total Time |
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.
LGTM✍️
…m me list (#16400) * fixes wrong validTo date in DelegationViewModal and show delete button for outgoing delegation * remove log * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <builders@andes.is>
) * feat(auth-admin): Delegation-admin webhook auditlog (#16335) * audit log delegation-admin webhook * log the response in resource and request in meta * remove audit in decorator * make createdBy optional * attempt to fix pipe * attempt to fix pipe * merge with main * fix tests --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(service-portal): Delete and view delegation in service portal form me list (#16400) * fixes wrong validTo date in DelegationViewModal and show delete button for outgoing delegation * remove log * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <builders@andes.is> --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Magnea Rún Vignisdóttir <magneavignisdottir@gmail.com> Co-authored-by: andes-it <builders@andes.is>
What
Fix that delete button was not showing in from user list, and validTo date was endless even when set
Why
Be able to delete and see correct valid to date
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
validTo
property to ensure correct date validation.