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

feat(portal): Display user display name in release modal #5294

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

Conversation

gucovip
Copy link

@gucovip gucovip commented Dec 10, 2024

What's the purpose of this PR

Display user display name in release-modal.html

Which issue(s) this PR fixes:

Fixes #

Brief changelog

feat(portal): Display user display name in release modal

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 display of last modified user information in the release modal with user display names.
  • Bug Fixes

    • Improved clarity of user modification details across multiple table sections in the release modal.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 10, 2024
Copy link

github-actions bot commented Dec 10, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@gucovip
Copy link
Author

gucovip commented Dec 10, 2024

I have read the CLA Document and I hereby sign the CLA

Copy link
Contributor

coderabbitai bot commented Dec 10, 2024

Walkthrough

The changes in this pull request involve updates to the release-modal.html file, specifically enhancing the display of last modified user information in three tables. The modification replaces the existing user ID display with a more descriptive format that combines the user's display name with their ID in parentheses. The overall structure and logic of the modal remain unchanged, with no modifications to the control flow or error handling.

Changes

File Path Change Summary
apollo-portal/src/main/resources/static/... Updated last modified user display in three tables by concatenating display name with user ID.

Poem

In the modal where changes reside,
A name and ID now stand side by side.
With each release, a tale to tell,
Of users who worked and did so well.
Hopping through code, we celebrate,
A clearer view, oh, isn’t it great! 🐇✨

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8be9b56 and 5c6b2b0.

📒 Files selected for processing (1)
  • apollo-portal/src/main/resources/static/views/component/release-modal.html (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apollo-portal/src/main/resources/static/views/component/release-modal.html

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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

🧹 Outside diff range and nitpick comments (1)
apollo-portal/src/main/resources/static/views/component/release-modal.html (1)

112-112: Consider adding a tooltip for long display names.

Since user display names can be lengthy, consider adding a tooltip to show the full information on hover.

-<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + '(' + config.item.dataChangeLastModifiedBy + ')'"></span>
+<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + '(' + config.item.dataChangeLastModifiedBy + ')'" title="{{config.item.dataChangeLastModifiedByDisplayName}} ({{config.item.dataChangeLastModifiedBy}})"></span>

Also applies to: 166-166, 206-206

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 28d2898 and 8be9b56.

📒 Files selected for processing (1)
  • apollo-portal/src/main/resources/static/views/component/release-modal.html (3 hunks)
🔇 Additional comments (2)
apollo-portal/src/main/resources/static/views/component/release-modal.html (2)

166-166: Consistent implementation across all table sections.

The user display format is consistently implemented across all three table sections (normal release, gray release, and update & publish), providing a uniform user experience.

Also applies to: 206-206


112-112: LGTM! User display format enhances readability.

The new format dataChangeLastModifiedByDisplayName + '(' + dataChangeLastModifiedBy + ')' improves user identification while maintaining the technical ID for reference.

Let's verify that these properties are consistently available:

✅ Verification successful

The user display format is consistently implemented across the codebase

The verification shows that the same user display pattern dataChangeLastModifiedByDisplayName + '(' + dataChangeLastModifiedBy + ')' is consistently used across all relevant HTML templates:

  • namespace-panel-branch-tab.html (2 occurrences)
  • namespace-panel-master-tab.html (3 occurrences)
  • release-modal.html (3 occurrences)

This confirms that the implementation follows a uniform pattern throughout the application's UI components, maintaining a consistent user experience.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent usage of display name properties
# Look for other instances where we might want to apply the same pattern

rg "dataChangeLastModifiedByDisplayName" --type html

Length of output: 2008

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 (2)
apollo-portal/src/main/resources/static/views/component/release-modal.html (2)

112-112: LGTM! Consider adding a space before the parenthesis

The addition of the display name improves user identification. However, consider adding a space before the parenthesis for better readability.

-<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + '(' + config.item.dataChangeLastModifiedBy + ')'"></span>
+<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + ' (' + config.item.dataChangeLastModifiedBy + ')'"></span>

112-112: Consider creating an AngularJS filter for user display formatting

The same user display format is repeated across multiple tables. Consider creating a reusable AngularJS filter to handle this formatting consistently.

Example implementation:

angular.module('apollo.portal')
  .filter('userDisplay', function() {
    return function(user) {
      if (!user.dataChangeLastModifiedByDisplayName) return user.dataChangeLastModifiedBy;
      return user.dataChangeLastModifiedByDisplayName + ' (' + user.dataChangeLastModifiedBy + ')';
    };
  });

Then use it in the template:

-<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + '(' + config.item.dataChangeLastModifiedBy + ')'"></span>
+<span class="block" ng-bind="config.item | userDisplay"></span>

Also applies to: 166-166, 206-206

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 28d2898 and 8be9b56.

📒 Files selected for processing (1)
  • apollo-portal/src/main/resources/static/views/component/release-modal.html (3 hunks)
🔇 Additional comments (3)
apollo-portal/src/main/resources/static/views/component/release-modal.html (3)

166-166: Same formatting suggestion applies here

For consistency with the previous suggestion, consider adding a space before the parenthesis.


206-206: Same formatting suggestion applies here

For consistency with the previous suggestions, consider adding a space before the parenthesis.


112-112: Verify display name availability

The changes assume that dataChangeLastModifiedByDisplayName is always available. Let's verify this assumption.

Also applies to: 166-166, 206-206

✅ Verification successful

Let me gather more information about how the display name is populated.


Let me check one more aspect about the user info enrichment process since we found references to enricher adapters.


Based on the evidence gathered, I can now provide the final response:

Display names are properly handled through the enrichment process

The display names are automatically populated through a robust enrichment system:

  • The UserDisplayNameEnricher component enriches DTOs with user display names
  • The AdditionalUserInfoEnrichServiceImpl service orchestrates the enrichment process
  • The BaseDtoUserInfoEnrichedAdapter ensures display names are properly set
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if there are any direct uses of dataChangeLastModifiedBy without corresponding display name

# Search for uses of dataChangeLastModifiedBy to ensure display name is always set
rg "dataChangeLastModifiedBy" --type java

# Search for display name setter/getter methods
ast-grep --pattern 'class $_ {
  $$$
  setDataChangeLastModifiedByDisplayName($$$) {
    $$$
  }
  $$$
}'

Length of output: 2782


Script:

#!/bin/bash
# Search for where display names are set in the codebase
rg "setDataChangeLastModifiedByDisplayName" -B 5 -A 5

# Check if there's any controller or service that handles this
rg "dataChangeLastModifiedByDisplayName" --type java -g "*Controller.java" -g "*Service.java" -B 5 -A 5

Length of output: 4102


Script:

#!/bin/bash
# Check the enricher implementation to understand how user display names are populated
rg -l "UserInfoEnricher" --type java
rg "UserInfoEnricher" -B 5 -A 10 --type java

# Also check for any tests related to this functionality
rg "UserInfoEnricher" -g "*Test.java" -B 5 -A 10

Length of output: 13802

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)
apollo-portal/src/main/resources/static/views/component/release-modal.html (1)

206-206: LGTM! Consider extracting the user display format.

The user information display format is consistent with other tables. Since this format is used in multiple places, consider extracting it into a reusable template or filter.

Example filter implementation:

app.filter('userDisplay', function() {
  return function(user) {
    return user.dataChangeLastModifiedByDisplayName + 
           '(' + user.dataChangeLastModifiedBy + ')';
  };
});

Then use it in the template:

-<span class="block" ng-bind="config.item.dataChangeLastModifiedByDisplayName + '(' + config.item.dataChangeLastModifiedBy + ')'"></span>
+<span class="block" ng-bind="config.item | userDisplay"></span>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 28d2898 and 8be9b56.

📒 Files selected for processing (1)
  • apollo-portal/src/main/resources/static/views/component/release-modal.html (3 hunks)
🔇 Additional comments (2)
apollo-portal/src/main/resources/static/views/component/release-modal.html (2)

166-166: LGTM! Consistent with normal release table.

The user information display format maintains consistency across different tables.


112-112: LGTM! Verify display name availability.

The user information display format looks good, combining the display name with ID for better identification.

Let's verify that the display name is always available:

✅ Verification successful

Based on the code analysis, I can now generate the final response. The code shows that dataChangeLastModifiedByDisplayName is properly managed through:

  1. The BaseDTO class which defines the field and its accessors
  2. The UserDisplayNameEnricher component that populates display names
  3. The BaseDtoUserInfoEnrichedAdapter that handles setting the display name
  4. The AdditionalUserInfoEnrichServiceImpl that orchestrates the enrichment process

LGTM! Display name is properly managed.

The display name field is part of the core data model and is automatically populated by the user info enrichment system. The changes to display the user's display name alongside their ID in the UI are safe and consistent with the backend implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for places where dataChangeLastModifiedByDisplayName is set
rg "dataChangeLastModifiedByDisplayName" --type js

Length of output: 50


Script:

#!/bin/bash
# Let's try searching in all file types since it might be in TypeScript or other frontend files
rg "dataChangeLastModifiedByDisplayName"

# Also search for related user display name patterns
rg "displayName" -A 2 -B 2

Length of output: 96502


Script:

#!/bin/bash
# Let's search for the related user data in Java files to understand how dataChangeLastModifiedByDisplayName is populated
rg "dataChangeLastModifiedByDisplayName" --type java -A 2 -B 2

# Also search for user display name related code in controllers
rg "setDataChangeLastModifiedByDisplayName" --type java -A 2 -B 2

Length of output: 3742


Script:

#!/bin/bash
# Let's check the UserInfoEnricher implementation to see how display names are populated
rg "UserInfoEnricher" --type java -A 5 -B 5

# Also check if there are any tests verifying this functionality
rg "UserInfoEnricher.*Test" --type java

Length of output: 9853

@nobodyiam
Copy link
Member

Thanks for the contribution. The layout feels a bit tight; could we adjust it slightly? For example, we could utilize the space around the left-side label.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants