Skip to content

Relationships in Manage Items/Services #11705

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

Merged
merged 4 commits into from
Apr 9, 2025

Conversation

KithminiOKD
Copy link
Collaborator

@KithminiOKD KithminiOKD commented Apr 9, 2025

Improve the UI in Relationships in Manage Items/Services
#1729

Summary by CodeRabbit

  • New Features
    • Introduced a redesigned user interface for managing relationships, featuring a modern layout and improved navigation.
  • Style
    • Enhanced visual aesthetics with updated button icons and consistent input field sizing for a more polished user experience.

Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

The changes update the relationships management interface by replacing the table-based layout with modern UI components. The layout now relies on p:panelGrid and p:panel for structuring both the selection area and details panel. Command buttons for adding, deleting, and saving relationships have been updated with icon support, a flex container arrangement, and modified process attributes. No changes were made to any exported or public entity declarations.

Changes

File(s) Change Summary
src/.../admin/items/relationships.xhtml Replaced table layout with p:panelGrid and p:panel; restructured "Select Relationship" and "Details" panels; updated command buttons with icons, flex layout, and process="@this".

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant UI as Relationships UI
    participant S as Server

    U->>UI: Select a relationship from the list
    U->>UI: Click "Add" or "Delete" button
    UI->>S: Process action (using @this)
    S-->>UI: Return updated state
    U->>UI: Update details in the panel
    U->>UI: Click "Save" button
    UI->>S: Process save action (targeting details panel)
    S-->>UI: Confirm update
Loading

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 1

🧹 Nitpick comments (1)
src/main/webapp/admin/items/relationships.xhtml (1)

72-138: Consider removing commented code.

While keeping the old implementation as comments might be helpful during development and testing, it's generally better to remove commented-out code before merging to production. The version control system already preserves the history of changes, making these comments unnecessary and potentially confusing for future developers.

-<!--                        <table class="w-100">-->
-<!--                            <tr>-->
-...
-<!--                            </tr>-->
-<!--                        </table>-->
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 36e6cf8 and 30e1891.

📒 Files selected for processing (1)
  • src/main/webapp/admin/items/relationships.xhtml (1 hunks)
🔇 Additional comments (5)
src/main/webapp/admin/items/relationships.xhtml (5)

15-16: Modern layout structure improves visual organization.

The new layout using p:panelGrid with defined columns and styling creates a more balanced and responsive design compared to the previous table-based approach. The gap styling and width classes help maintain consistent spacing.

Also applies to: 71-71


17-28: Selection panel enhancements look good.

The updated list box implementation maintains the same functionality while providing better styling. Using style="width:100%" ensures the component properly fills its container, improving responsiveness.


29-44: Button layout improvements with proper icons.

The flex container for buttons creates better spacing and alignment. Adding icons to the buttons enhances visual cues for users. The process attribute change from specific IDs to @this is an improvement that limits the scope of Ajax processing.


46-59: Details panel structure is well organized.

The panel grid implementation provides better alignment of labels and input fields. The styling ensures consistent width of input fields, improving the form layout.


60-69: Save button styling and placement is improved.

Centering the save button and adding an icon enhances usability. The process attribute now correctly targets only the details panel, which is more efficient than the previous implementation.

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: 1

🧹 Nitpick comments (1)
src/main/webapp/admin/items/relationships.xhtml (1)

46-59: Consider adding input validation.

While the panel structure and layout are well-designed, there's no visible validation for these input fields. Consider adding validation constraints to ensure data integrity.

 <p:inputText id="atobName" value="#{relationshipController.current.atobName}"
-              style="width:100%" />
+              style="width:100%" required="true" />
+<p:message for="atobName" />

 <p:inputText id="btoaName" value="#{relationshipController.current.btoaName}"
-              style="width:100%" />
+              style="width:100%" required="true" />
+<p:message for="btoaName" />

 <p:inputText id="orderNo" value="#{relationshipController.current.orderNo}"
-              style="width:100%" />
+              style="width:100%" validatorMessage="Order No must be a number">
+  <f:validateLongRange />
+</p:inputText>
+<p:message for="orderNo" />
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a4b861b and c1fe9aa.

📒 Files selected for processing (1)
  • src/main/webapp/admin/items/relationships.xhtml (1 hunks)
🔇 Additional comments (3)
src/main/webapp/admin/items/relationships.xhtml (3)

15-16: UI layout improvement with modern components.

The redesign with p:panel and p:panelGrid creates a more structured and responsive layout compared to traditional tables. The gap styling provides good visual separation between panels.


17-28: Well-structured selection component with proper AJAX handling.

The p:selectOneListbox with full-width styling provides an improved interface for relationship selection. The AJAX event is efficiently configured to only execute and render the necessary components.


29-44: Enhanced button styling and optimized processing.

The command buttons now include appropriate icons and are arranged in a flex container with proper spacing. The process="@this" attribute optimizes performance by only processing the clicked button during action execution.

@GSMgeeth GSMgeeth merged commit 2127322 into development Apr 9, 2025
3 checks passed
@GSMgeeth GSMgeeth deleted the Manage-Items/Services-#1729 branch April 9, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants