Skip to content
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): Use display name for api scope groups #16736

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

magnearun
Copy link
Contributor

@magnearun magnearun commented Nov 6, 2024

What

We should use the displayName

Why

To get the correct translation

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Updated the display logic for names in the Access List, enhancing user experience by showing a more user-friendly display name when available.
  • Bug Fixes

    • Ensured fallback functionality for name display, improving clarity for delegation scopes without a defined display name.

Copy link
Contributor

coderabbitai bot commented Nov 6, 2024

Walkthrough

The changes in this pull request involve modifications to the AccessList component in the AccessList.tsx file. The key update is in the assignment of the name prop for the AccessListItem component, which now uses scope.displayName || scope.name to provide a more user-friendly display name when available. The overall structure and functionality of the component, including its rendering logic and recursive scope tree rendering, remain unchanged.

Changes

File Path Change Summary
libs/portals/shared-modules/delegations/src/components/access/AccessList/AccessList.tsx Updated AccessListItem component's name prop to use `scope.displayName

Possibly related PRs

Suggested reviewers

  • obmagnusson
  • sigruntg

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@magnearun magnearun marked this pull request as ready for review November 7, 2024 10:53
@magnearun magnearun requested a review from a team as a code owner November 7, 2024 10:53
Copy link
Member

@GunnlaugurG GunnlaugurG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@magnearun magnearun added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.53%. Comparing base (304f753) to head (f601747).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16736   +/-   ##
=======================================
  Coverage   36.53%   36.53%           
=======================================
  Files        6888     6888           
  Lines      143642   143642           
  Branches    40926    40926           
=======================================
+ Hits        52483    52484    +1     
+ Misses      91159    91158    -1     
Flag Coverage Δ
api 3.35% <ø> (ø)
api-domains-auth-admin 48.48% <ø> (ø)
api-domains-communications 39.79% <ø> (ø)
application-system-api 41.12% <ø> (ø)
application-template-api-modules 27.69% <ø> (+0.01%) ⬆️
clients-zendesk 50.24% <ø> (ø)
services-auth-admin-api 52.46% <ø> (ø)
services-auth-delegation-api 58.26% <ø> (+0.06%) ⬆️
services-auth-ids-api 52.06% <ø> (ø)
services-auth-personal-representative 45.59% <ø> (+0.02%) ⬆️
services-auth-personal-representative-public 41.75% <ø> (+0.01%) ⬆️
services-auth-public-api 49.56% <ø> (ø)
services-user-notification 46.84% <ø> (ø)
services-user-profile 61.74% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 304f753...f601747. Read the comment docs.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/access/AccessList/AccessList.tsx (1)

Line range hint 71-71: Consider adding fallback for consistency

The name prop here only uses scope.displayName without a fallback, unlike the implementation in line 46. Consider adding the same fallback pattern for consistency.

-              name={scope.displayName}
+              name={scope.displayName || scope.name}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 304f753 and f601747.

📒 Files selected for processing (1)
  • libs/portals/shared-modules/delegations/src/components/access/AccessList/AccessList.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
libs/portals/shared-modules/delegations/src/components/access/AccessList/AccessList.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/access/AccessList/AccessList.tsx (2)

46-46: LGTM: Proper implementation of display name with fallback

The change correctly implements the display name requirement while maintaining backward compatibility with a fallback to scope.name.


Line range hint 1-24: LGTM: Compliant with coding guidelines

The component demonstrates good practices for shared modules:

  • Well-defined TypeScript interfaces
  • Proper import patterns for tree-shaking
  • Reusable component structure using shared UI components

@kodiakhq kodiakhq bot merged commit e298ae4 into main Nov 7, 2024
62 checks passed
@kodiakhq kodiakhq bot deleted the fix/translation-mismatch branch November 7, 2024 11:54
robertaandersen pushed a commit that referenced this pull request Nov 11, 2024
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
jonnigs pushed a commit that referenced this pull request Nov 12, 2024
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants