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: UI Issue in Option Translations Modal #8878

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

mbabhaziSamuel
Copy link
Contributor

@mbabhaziSamuel mbabhaziSamuel commented Mar 18, 2025

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


Summary by CodeRabbit

  • New Features

    • Enhanced the input sections by grouping fields with a newly introduced label that clearly indicates the language, improving clarity and user interaction.
  • Style

    • Revamped the visual presentation with a modern card layout, refined input appearances, and interactive hover effects.
    • Improved responsiveness and overall layout, ensuring information is cleanly organized and visually appealing.

Sorry, something went wrong.

Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

The pull request updates the product option group translation component by restructuring the HTML and overhauling the corresponding SCSS. In the HTML file, input fields are now wrapped in a container that includes a new language label, while the SCSS file has been refactored to replace outdated classes with a new structure featuring a main container and nested styles for card elements and input fields. No changes were made to the underlying functionality or public entities.

Changes

File Change Summary
packages/ui-core/.../product-option-group-translation.component.html Wrapped input fields in an .input-container div and added a <span class="language-label">{{ ln.value }}</span> above each input, maintaining the original conditional rendering.
packages/ui-core/.../product-option-group-translation.component.scss Refactored styling by removing the .option-line class, introducing a new .main class with nested styles for card headers, bodies, and footers, and adjusting input and language label appearances.

Suggested reviewers

  • rahul-rocket

Poem

I'm a rabbit, hopping proud and free,
Coding tweaks danced all around me.
Containers and labels in a neat array,
Styles refined as I leap and play.
With joyful hops, I celebrate this spree! 🐰🌟

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 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 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.

@mbabhaziSamuel mbabhaziSamuel self-assigned this Mar 18, 2025
@mbabhaziSamuel mbabhaziSamuel linked an issue Mar 18, 2025 that may be closed by this pull request
@mbabhaziSamuel
Copy link
Contributor Author

Before
Capture d’écran du 2025-03-18 10-40-19

After
Capture d’écran du 2025-03-18 11-35-28

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

🧹 Nitpick comments (3)
packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.html (2)

23-32: Enhanced Group Translation Input Container Structure

The new <div class="input-container"> along with the nested <span class="language-label"> and <input> provides a clear, semantic grouping for active group translation fields. This layout improves visual hierarchy and aligns well with the updated UI strategy.

Note: Consider generating unique IDs for the <input> element (currently statically set as nameInput) if multiple instances can render on the page, to avoid accessibility issues or conflicts in the DOM.


48-57: Enhanced Option Translation Input Container Structure

Similar to the group section, wrapping the active option translation input within an <div class="input-container"> with an accompanying <span class="language-label"> ensures a consistent and improved UI layout. The conditional rendering still preserves the intended behavior based on isOptionActive(option, ln.value).

Note: As above, verify that each input’s id remains unique if multiple inputs are rendered simultaneously.

packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (1)

131-155: New Input Container Styling

The styling for the .input-container delivers a robust flex layout for aligning the language label and input field, along with clear borders and background settings for the label. This addition supports the structural HTML changes well.

Note: Consider if the use of !important on properties for the inner input (lines 151-153) is necessary. If possible, revising the CSS specificity to avoid !important might lead to better maintainability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 638a35a and 21aec51.

📒 Files selected for processing (2)
  • packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.html (2 hunks)
  • packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (1)
packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (1)

3-30: Updated Main Container Styling

The newly introduced .main class effectively applies a modern look to the component with a subtle box-shadow, rounded borders, and controlled overflow. Nested styles for the card header (including the cancel button and title) are organized clearly.

Note: Double-check that these styles do not unintentionally override or conflict with global card styles elsewhere in the application.

Copy link

nx-cloud bot commented Mar 18, 2025

View your CI Pipeline Execution ↗ for commit 5227b39.

Command Status Duration Result
nx build desktop --base-href ./ ✅ Succeeded 1m 43s View ↗
nx build desktop-api --output-path=dist/apps/de... ✅ Succeeded 28s View ↗
nx run api:desktop-api ✅ Succeeded 1m 19s View ↗
nx build gauzy -c=production --prod --verbose ✅ Succeeded 3m 46s View ↗
nx run gauzy:desktop-ui --base-href ./ ✅ Succeeded 3m 46s View ↗
nx build api -c=production --prod ✅ Succeeded 1m 18s View ↗
nx build desktop-ui-lib --configuration=develop... ✅ Succeeded 30s View ↗
nx build plugin-integration-wakatime ✅ Succeeded <1s View ↗
Additional runs (57) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-03-18 12:20:38 UTC

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances the UI of the Option Translations Modal by improving input field organization and visual hierarchy through consistent styling and layout patterns.

  • Added .input-container wrapper with language labels for better visual grouping in /packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.html
  • Implemented modern card-based layout with proper shadows and borders in /packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss
  • Added responsive design considerations for mobile views with @media queries
  • Improved hover effects and interactive states for better user feedback

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

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

🧹 Nitpick comments (2)
packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (2)

56-79: Refine Option Line Element

The .option-line styling is clean with proper hover effects and spacing. However, note that the inner .language-span is still defined here even though the updated UI uses a new .language-label for language display. Please verify if this legacy class is still required. If it’s no longer in use, consider removing or renaming it to maintain consistency across the component.

-      .language-span {
-        flex-shrink: 0;
-        font-weight: 600;
-        color: #495057;
-        margin-right: 0.5rem;
-        padding-right: 0.5rem;
-        border-right: 1px solid #e9ecef;
-        display: inline-block;
-      }

156-160: Consider Future-Proofing ::ng-deep Usage

The :host ::ng-deep rule effectively overrides the nb-input padding, which is necessary for current styling needs. Note, however, that the ::ng-deep combinator is deprecated and may be removed in future Angular versions. It might be worthwhile to explore alternative encapsulation strategies to future-proof the styling.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 21aec51 and 5227b39.

📒 Files selected for processing (2)
  • packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.html (2 hunks)
  • packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.html
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (7)
packages/ui-core/shared/src/lib/product/product-mutation/product-option-group-translation/product-option-group-translation.component.scss (7)

3-7: .main Container Styling Strengthens the Visual Hierarchy

The new .main container applies a consistent box-shadow, border-radius, and overflow setting, which enhances the dialog’s visual containment and overall polish.


8-29: Well-Structured Header Section

The nb-card-header block now clearly defines spacing and positioning. The use of relative positioning in the header paired with the absolutely positioned .cancel button is appropriate, ensuring the cancel icon displays as intended.


31-55: Responsive Card Body Layout

The updated .option-row and the nested .col-md-3 rules effectively introduce a flexible, responsive layout. The use of negative margins and media queries ensures proper alignment across devices.


82-91: Input Field Styling Looks Consistent

The input fields within the card body now have clear styling with full-width and defined padding. The special rule for [nbInput] ensures that inputs flagged by this attribute receive adjusted padding.


94-112: Creative Use of Pseudo-Elements for Form Controls

The use of a ::before pseudo-element with [formControlName] to simulate a label is a smart approach to maintain a clean UI. Just ensure that the attribute case (formcontrolname vs. formControlName) remains consistent with Angular conventions for better maintainability.


115-128: Solid Footer Layout

The nb-card-footer block applies padding and a border-top effectively, and the spacing applied to buttons (especially using :first-child) is balanced and clear.


130-154: Robust Input Container Implementation

The .input-container with its flex layout, border, and rounded corners provides a cohesive structure for the input elements. The new .language-label class is well-defined, ensuring that language identifiers are clearly presented above or beside the inputs.

@evereq evereq merged commit 640a3c2 into develop Mar 20, 2025
16 checks passed
@evereq evereq deleted the fix/8877-ui-option-translations-modal branch March 20, 2025 07:24
evereq added a commit that referenced this pull request Mar 22, 2025
* fix: UI Issue in Option Translations Modal (#8878)

* fix: UI Issue in Option Translations Modal

* feedback integration

* [Fix] Issues with Accounting Tab (Invoice, Estimate, and Receipt Templates) (#8880)

* fix(accounting-template): resolve duplicate templates and incorrect language filtering

* Remove console log

* feedback integration

* Remove duplicated comment

* [Fix] Inventory Filters (#8881)

* fix:Inventory Filters

* fix: remove filter by name

* feedback Integration

* [Enhancement] Introduce SELECT_EMPLOYEE Permission & Allow Employee to Assign Managers/Members in Project Creation (#8836)

* feat: allows employees to select others

* chore: add translations for SELECT_EMPLOYEE permission

* Fix: retrieved employees

* Integration of feedback

* Fix: remove CHANGE_SELECTED_EMPLOYEE permission

* Fix: Ensure both CHANGE_SELECTED_EMPLOYEE and SELECT_EMPLOYEE permissions are applied

---------

Co-authored-by: mbabhaziSamuel <[email protected]>

---------

Co-authored-by: Samuel Mbabhazi <[email protected]>
Co-authored-by: samuel mbabhazi <[email protected]>
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.

[Bug] UI Issue in Option Translations Modal
2 participants