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

update all the place to show user name instead of ID #5215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kalavt
Copy link

@kalavt kalavt commented Aug 29, 2024

What's the purpose of this PR

update all the place to show user name instead of ID

Brief changelog

update all the place to show user name instead of ID

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Summary by CodeRabbit

  • New Features

    • Enhanced user information display by showing user names instead of user IDs in the settings and system role management interfaces.
    • Improved functionality for user role management by ensuring correct user IDs are utilized for deletion actions.
  • Bug Fixes

    • Simplified data handling in the permission controller by directly returning detailed user information, improving performance and clarity.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 29, 2024
Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes involve modifications to the PermissionController class, updating the return type of the getCreateApplicationRoleUsers method from a list of user IDs to a set of UserInfo objects. Additionally, the HTML templates for user settings and system role management have been updated to display user names instead of IDs, enhancing user interface clarity and interaction specificity.

Changes

File Change Summary
.../PermissionController.java Updated getCreateApplicationRoleUsers method to return Set<UserInfo> instead of List<String>.
.../static/app/setting.html Changed button binding from user.userId to user.name for improved clarity. Added a newline before </html>.
.../static/system-role-manage.html Updated ng-bind to use user.name and ng-click to use user.userId for better specificity.

Poem

Hop along, the changes bright,
User names now take the light!
From IDs we’ve made the switch,
Clarity is quite the pitch.
In code and view, we dance and play,
A better path, hip-hip-hooray! 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f4a0236 and 88571d0.

Files selected for processing (3)
  • apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/PermissionController.java (1 hunks)
  • apollo-portal/src/main/resources/static/app/setting.html (2 hunks)
  • apollo-portal/src/main/resources/static/system-role-manage.html (1 hunks)
Additional comments not posted (6)
apollo-portal/src/main/resources/static/system-role-manage.html (2)

68-68: LGTM!

The ng-bind directive is correctly updated to bind user.name, improving the user interface.

The code changes are approved.


71-71: LGTM!

The ng-click directive is correctly updated to use user.userId, ensuring the correct identifier is passed to the function.

The code changes are approved.

apollo-portal/src/main/resources/static/app/setting.html (2)

78-78: LGTM!

The ng-bind directive is correctly updated to bind user.name, improving the user interface.

The code changes are approved.


223-223: LGTM!

The newline added before the closing </html> tag is a minor formatting improvement.

The code changes are approved.

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/PermissionController.java (2)

326-326: LGTM!

The return type change from List<String> to Set<UserInfo> enhances the method's output by providing more detailed user information.

The code changes are approved.


327-327: LGTM!

The implementation update to return a set of UserInfo objects simplifies the control flow and improves performance.

The code changes are approved.

@kalavt
Copy link
Author

kalavt commented Aug 29, 2024

hello @nobodyiam @shoothzj
may I request your review and approve for this PR?

Copy link
Member

@shoothzj shoothzj left a comment

Choose a reason for hiding this comment

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

This changes the compatibility of REST API. I would suggest to design a new API, @nobodyiam WDYT?

@nobodyiam
Copy link
Member

This is a breaking change. @kalavt would you please help to describe the background of this change?

@kalavt
Copy link
Author

kalavt commented Aug 30, 2024

With LDAP and OAUTH login, user ID is a meaning less string which looks ugly on multiple place of UI,
better to show user's name instead of ID.

image image

@kalavt
Copy link
Author

kalavt commented Aug 31, 2024

@shoothzj @nobodyiam let me know if you considering we shall implement a another API for keep the backward capability.

@nobodyiam
Copy link
Member

  1. We need to add a new api to retrieve the user info
  2. It's better to display the user name as well as the user id, e.g. xxName(xxId)

Copy link

stale bot commented Oct 5, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Oct 5, 2024
@nobodyiam nobodyiam added this to the 2.4.0 milestone Oct 6, 2024
@stale stale bot removed stale labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants