Skip to content

Conversation

@shubhamkumar9199
Copy link
Contributor

@shubhamkumar9199 shubhamkumar9199 commented Oct 26, 2025

Description

Enhanced the CSS for the button to improve spacing, padding, and alignment

#{Issue Number}
WEB-(356)

Screenshots, if any

before:
Screenshot 2025-10-22 160037
after:
Screenshot 2025-10-22 170535

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [ X ] If you have multiple commits please combine them into one commit by squashing them.

  • [ X ] Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • UI/UX Improvements
    • Added visual section dividers to organize office details
    • Implemented a compact, denser and responsive layout for improved mobile and narrow views
    • Repositioned the Edit action to a bottom action area with updated button styling and spacing
    • Enhanced External ID display to show a dedicated identifier component or "Unassigned" when empty
    • Adjusted tab and card presentation for cleaner navigation; data tabs render conditionally based on permissions

@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

Walkthrough

Layout and styling updates across office view and general tab templates and SCSS: introduces compact/condensed classes, section dividers, moved edit button to bottom container, replaces External ID display with component, and adds responsive utility styles and scrollbar/button refinements.

Changes

Cohort / File(s) Summary
General Tab template
src/app/organization/offices/view-office/general-tab/general-tab.component.html
Adds compact-view / condensed wrappers, inserts <hr class="section-divider" /> between rows, conditionally renders mifosx-external-identifier for External Id, moves Edit action into a bottom button container, and reduces icon margin.
General Tab styles
src/app/organization/offices/view-office/general-tab/general-tab.component.scss
Adds compact/condensed utility classes, .compact-details, .compact-button, .bottom-button-container, .edit-button (hover/transform), .section-divider, layout wrappers and responsive rules to tighten spacing and center content.
Office view template
src/app/organization/offices/view-office/view-office.component.html
Applies container/layout classes (narrow-container, extra-small, card-content, compact-tab, tab-panel) to card and tab elements; minor structural wrapping for permission-gated datatable tab.
Office view styles
src/app/organization/offices/view-office/view-office.component.scss
Expands styling: card and action-button sizing, padding, border-radius, hover shadow/translate; adds .container, .narrow-container, .extra-small, .compact-tab, .card-content, .tab-panel, scrollbar styling and media query for small screens.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Primarily template and SCSS changes with no business logic modifications.
  • Review focus: verify CSS class name consistency between templates and SCSS, confirm permission checks still applied for Edit and datatable tab, and validate mifosx-external-identifier usage and conditional rendering.

Suggested reviewers

  • alberto-art3ch
  • IOhacker

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title "WEB-(356)-Fix general tab changes" references a real component being modified (the general-tab component), making it related to the changeset. However, the title uses vague and generic terminology that lacks specificity about the nature of the modifications. The word "Fix" could imply various types of changes (bug fix, enhancement, refactor), and "changes" is a generic placeholder term that doesn't convey meaningful information about what was actually done. The PR description provides more clarity by mentioning "Enhanced the CSS for the button to improve spacing, padding, and alignment," but the title itself doesn't communicate this level of detail. Additionally, the title focuses narrowly on the general-tab component while the changeset also includes substantial modifications to the view-office component styling and layout. Consider refining the title to be more specific about the type of change and scope. For example, "Redesign general tab layout with compact view and improved styling" would better convey that this is a UI/UX enhancement involving layout restructuring and CSS improvements. If the general-tab changes are the primary focus, ensure the title clearly indicates whether this is a bug fix, refactor, or enhancement, and consider mentioning that view-office styling was also updated if that's a significant part of the work.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9efe2cc and f293e9f.

📒 Files selected for processing (4)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.html (2 hunks)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.html (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**

⚙️ CodeRabbit configuration file

src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.

Files:

  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss
  • src/app/organization/offices/view-office/view-office.component.html
  • src/app/organization/offices/view-office/general-tab/general-tab.component.html
  • src/app/organization/offices/view-office/view-office.component.scss
🔇 Additional comments (11)
src/app/organization/offices/view-office/view-office.component.html (1)

1-33: HTML structure and layout classes look good.

The template properly introduces container-level styling with narrow-container and extra-small, applies compact-tab to tab links for consistent spacing, and wraps the datatable tabs in a span while preserving the permission directive. The tab-panel class supports the layout refinements.

src/app/organization/offices/view-office/general-tab/general-tab.component.scss (3)

26-37: Verify .mat-body-strong, .left, and .right are properly defined.

The nested selectors in .compact-details target .mat-body-strong (likely from Angular Material typography), .left, and .right. Ensure these classes are applied to corresponding elements in the HTML or are defined elsewhere in the component's SCSS.


79-89: Verify .flex-45 and .flex-50 classes are defined.

The .condensed class applies padding and font-size rules to .flex-45 and .flex-50. Confirm these utility classes exist in the component or global SCSS to ensure proper layout.


20-58: Layout and button styling refinements look solid.

The new utility classes (.compact-button, .bottom-button-container, .edit-button) introduce consistent, responsive spacing and visual polish. The hover effects are smooth, and the shadow/transform transitions are non-intrusive. Section dividers use a clean border approach.

src/app/organization/offices/view-office/general-tab/general-tab.component.html (3)

22-27: Verify the mifosx-external-identifier component exists and is properly imported.

The External ID display now uses a custom component <mifosx-external-identifier> with property binding. Ensure this component is:

  1. Declared or imported in the general-tab component module
  2. Properly typed to accept the externalId input property
  3. Tested to ensure it renders correctly with the passed value

30-36: Verify permission directive doesn't interfere with routerLink navigation.

The Edit button is wrapped in a <span> with the *mifosxHasPermission directive. Ensure that:

  1. The permission directive doesn't prevent the routerLink from functioning when permission is granted
  2. The button visually and functionally behaves as expected when hidden/shown
  3. No CSS specificity issues arise from the wrapper

1-36: Layout restructuring with dividers and button relocation looks well-executed.

The template now uses a compact, sectioned layout with visual dividers between information rows. The Edit button is repositioned to the bottom (bottom-button-container), preserving the permission check. Responsive classes and Material typography are applied consistently.

src/app/organization/offices/view-office/view-office.component.scss (4)

14-19: Verify necessity of !important flags on .office-card.

The .office-card rules include !important on border-radius and box-shadow. This may indicate specificity conflicts with Material components or other rules. Verify that these flags are necessary and not masking underlying CSS organization issues. Consider removing them if specificity can be resolved through selector refinement.


43-46: Media query breakpoint alignment check.

The media query uses @media (width <= 768px), which is valid but less common than max-width. Verify that this breakpoint (768px) aligns with your design requirements and responsive strategy. Both syntaxes are functionally equivalent for this use case.


21-41: Scrollbar and tab styling refinements are well-executed.

The navigation tabs now include cross-browser scrollbar styling (standard scrollbar-width: thin plus webkit customization), and the .mat-tab-label receives appropriate spacing, height, and font-size for a compact layout. The padding and visual hierarchy are consistent with the design.


49-74: Utility classes provide clean, consistent spacing and sizing.

The new utility classes (.container, .narrow-container, .extra-small, .compact-tab, .card-content, .tab-panel) introduce reusable, minimal styling for layout management. They follow single-responsibility principles and integrate well with the view-office and general-tab layout changes.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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)
src/app/organization/offices/view-office/general-tab/general-tab.component.scss (1)

20-24: Unused .compact-button class—consider removing or clarifying intent.

The .compact-button class is defined (with padding, font-size, line-height) but does not appear to be used in general-tab.component.html. The Edit button instead uses the .edit-button class. Either apply this class where appropriate or remove it to avoid dead code.

src/app/organization/offices/view-office/view-office.component.scss (1)

15-19: Avoid !important flags in box-shadow and border-radius overrides.

Lines 18–19 use !important on border-radius and box-shadow to override Material Design card styles. This can complicate future styling changes and maintenance. Consider using CSS specificity (e.g., .office-card.office-card { border-radius: 8px; }) or ensuring these styles are applied in the correct cascade order without !important.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30dd814 and 9efe2cc.

📒 Files selected for processing (4)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.html (2 hunks)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.html (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**

⚙️ CodeRabbit configuration file

src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.

Files:

  • src/app/organization/offices/view-office/view-office.component.scss
  • src/app/organization/offices/view-office/general-tab/general-tab.component.html
  • src/app/organization/offices/view-office/view-office.component.html
  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss
🔇 Additional comments (18)
src/app/organization/offices/view-office/view-office.component.html (2)

1-1: Verify that extra-small and narrow-container classes produce intended max-width.

Both narrow-container (max-width: 600px) and extra-small (max-width: 500px) constrain width on the same container. Confirm that the narrower constraint (500px) is the intended final width for this view.


11-11: CSS class additions align with compact-tab styling.

The compact-tab class is applied consistently to both the General tab link and datatable tab links. Verify that this class is defined in view-office.component.scss (it is present at line 63-66) and achieves the intended compact appearance.

Also applies to: 23-23

src/app/organization/offices/view-office/general-tab/general-tab.component.scss (8)

2-5: Updated tab-container spacing aligns with compact layout.

The changes to padding (0.5rem), margin (1% auto), max-width (600px), and width (90%) establish a narrower, centered container—consistent with the compact design direction.


26-37: Well-structured .compact-details with nested responsive typography.

The class appropriately reduces font sizes and padding for a denser layout. Nesting of .left and .right is clear, and the .mat-body-strong override ensures typography consistency. Good practice.


39-44: Bottom-button-container flexbox layout is clean.

Flexbox centering (justify-content: center) with top margin (2rem) and padding (1rem 0) creates appropriate visual spacing for the Edit button placement.


46-58: Edit-button hover effects are polished, but verify Material Design alignment.

The button styling includes modern micro-interactions (translateY transform on hover, dynamic box-shadow). Confirm that the custom styles do not conflict with Material Design button base styles or create unexpected behavior when combined with [mat-raised-button].


65-70: Section-divider styling is semantic and appropriate.

Using <hr> with transparent black border (rgb(0 0 0 / 10%)) provides subtle visual separation. Good choice over decorative divs.


72-77: Compact-view container maintains width constraints consistent with narrow-container.

Max-width of 450px aligns with the extra-small constraint (500px from view-office.component.scss), creating a cohesive narrow-layout strategy across the component hierarchy.


79-89: Condensed class appropriately reduces typography and spacing.

Font-size reduction (0.85rem) and padding reduction (0.2rem) in flex utilities, along with smaller section dividers (4px margin), support a compact, dense information display.


91-99: Small-buttons wrapper with nested edit-button override is logical.

This follows a good naming convention and allows buttons within this container to inherit compact sizing without modifying the global .edit-button definition.

src/app/organization/offices/view-office/general-tab/general-tab.component.html (4)

1-2: Container and layout classes correctly apply compact styling.

The combination of tab-container, mat-typography, compact-view on the root container and layout-row-wrap, responsive-column, compact-details, condensed on the layout wrapper establishes the intended compact, responsive structure.


7-7: Section dividers improve information hierarchy.

The <hr class="section-divider" /> elements between Parent Office, Opened On, Name Decorated, and External Id visually separate information blocks and are styled consistently with the new SCSS definition (line 65–70 of general-tab.component.scss).

Also applies to: 13-13, 19-19


22-27: Conditional external-identifier rendering is well-implemented.

The component correctly uses *ngIf="officeData.externalId" to conditionally render the mifosx-external-identifier component and falls back to an "Unassigned" message when the external ID is not present. Verify that the mifosx-external-identifier component is imported and available in the module.


30-36: Edit button repositioned to bottom-button-container with proper permission gating.

Moving the Edit button to a dedicated bottom container improves visual hierarchy. The *mifosxHasPermission="'UPDATE_OFFICE'" guard correctly restricts button visibility. Icon spacing updated from m-r-10 to m-r-5 aligns with the compact aesthetic.

src/app/organization/offices/view-office/view-office.component.scss (4)

2-12: Action-button styling introduces polished hover interactions.

The width (85%), margin (0.2rem auto), padding (0.3rem), border-radius (3px), and smooth transition (all 0.3s ease) are appropriate. The hover effect (translateY, box-shadow) is consistent with the edit-button styling in general-tab.component.scss and provides good visual feedback.


21-40: Navigation-tabs styling with custom scrollbar is well-implemented.

The scrollbar styling (lines 26–33) provides a thin, modern appearance with webkit support. The .mat-tab-label overrides (lines 35–40) reduce min-width (80px), adjust padding (0 0.5rem), set height (36px), and shrink font-size (0.85rem)—all supporting the compact tab aesthetic without breaking Material tab layout.


43-46: Responsive media query at 768px adjusts card width appropriately.

The media query reduces .office-card width to 85% on smaller viewports, complementing the general-tab.component.scss compact-view responsive design and ensuring consistent narrow-layout behavior across screen sizes.


49-74: New utility classes (container, narrow-container, extra-small, compact-tab, card-content, tab-panel) are well-organized and consistent.

These classes establish a cohesive layout vocabulary for the view-office feature:

  • narrow-container (max-width: 600px) and extra-small (max-width: 500px) provide width constraints.
  • compact-tab (min-width: auto, padding: 0 12px) adjusts tab sizing.
  • card-content and tab-panel add padding refinements.
  • All sizing and spacing values align with the compact design direction across related components.

remove  the dupicate line of code
@gkbishnoi07
Copy link
Collaborator

We need to maintain consistency if you’re changing this layout, make sure to update all other pages that follow the same format like “General” tab.

@shubhamkumar9199
Copy link
Contributor Author

We need to maintain consistency if you’re changing this layout, make sure to update all other pages that follow the same format like “General” tab.

@gkbishnoi07 Yes, I know that. That’s why I’m not changing the color and am keeping the button positioned in the same place. However, the size needs to be different because each page has different content — only the box size varies.

@IOhacker IOhacker merged commit 28c8f7b into openMF:dev Oct 27, 2025
3 checks passed
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.

3 participants