Skip to content

Refactor: Staff payroll selected staff page UI improvements#20830

Open
RohanSGX wants to merge 2 commits into
developmentfrom
staff_payroll_selected_staff
Open

Refactor: Staff payroll selected staff page UI improvements#20830
RohanSGX wants to merge 2 commits into
developmentfrom
staff_payroll_selected_staff

Conversation

@RohanSGX
Copy link
Copy Markdown
Collaborator

@RohanSGX RohanSGX commented May 18, 2026

Summary

UI refactor of the staff payroll selected staff page, consistent with the salary summary and payroll pages styling and layout pattern.

Changes

  • Replaced h:panelGrid columns="2" filter fields in the Staff list tab with a 2-column fields-grid layout using stacked label + field groups
  • Applied consistent tab content layout using tab-content flex column with gap for both tabs
  • Moved action buttons to dedicated tab-actions rows in both tabs
  • Applied staff-table styling to p:dataTable — muted uppercase headers, consistent padding, hover highlight
  • Sentence-cased tab titles (Staff ListStaff list, Pay RolePay role) and column headers
  • Replaced raw border: 1px solid black table styling with clean payroll-table styles matching reference pages
  • Removed all inline style attributes from td and th elements — alignment handled via col-left and col-name classes
  • Replaced mixed h:outputLabel/h:outputText usage in data cells with consistent h:outputText
  • Moved print footer into report-table-footer div with flex layout matching reference pages
  • Sentence-cased button labels (Process Hold ListProcess hold list, Fill All StaffFill all staff)
  • Shortened verbose column headers matching reference pages
  • Removed redundant <br/> spacers throughout
  • Fixed Excel download filename: staff_payroll.xlsstaff_payroll_selected.xls
  • Added appendTo="@body" and autoWidth="false" on p:selectOneMenu to prevent overlay closing immediately when wrapped inside p:tabView

No functional changes

All bean bindings, action methods, ui:repeat dynamic columns, staff selection logic, Excel export, and print behaviour are unchanged.

Summary by CodeRabbit

  • Style
    • Redesigned the HR staff salary page with improved visual styling and structured layout.
    • Updated the staff list section with an organized field layout.
    • Improved the pay role section with reorganized buttons, enhanced report headers, and a new styled footer displaying print information.
    • Enhanced overall data table presentation with improved styling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Walkthrough

The hr_staff_salary_1.xhtml page was comprehensively refactored from an unstyled inline JSF layout to a styled, structured view. The changes add embedded CSS styling, rebuild both the "Staff list" and "Pay role" tabs with grid-based layouts and class-based styling, introduce a new print footer, and update the Excel export control while preserving all data bindings and EL expressions.

Changes

HR Staff Salary Page Styling Refactor

Layer / File(s) Summary
CSS Styling Foundation
src/main/webapp/hr/hr_staff_salary_1.xhtml
A new <h:outputStylesheet> block defines layout spacing, grid containers, button sizing, payroll table formatting, totals row appearance, hover states, and report footer typography/colors.
Staff List Tab UI Restructuring
src/main/webapp/hr/hr_staff_salary_1.xhtml
The "Staff list" tab filter controls were rebuilt from h:panelGrid into a grid/field-group layout with styled output labels and autocomplete components; the staff data table markup was reformatted with updated row classes while preserving all filtering, selection, and field bindings.
Pay Role Tab & Report Footer
src/main/webapp/hr/hr_staff_salary_1.xhtml
The "Pay role" tab action buttons were reorganized into styled containers; Excel export markup and download filename were updated; payroll table styling was converted to CSS classes while EL-driven totals computations and the table header/body/footer sections remained functionally intact; a new flexbox-based "report-table-footer" replaced the previous "Print By ... Print At ..." row to display print metadata and system messages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • hmislk/hmis#20884: Refactors another HR report XHTML page to the same design-system style—adding h:outputStylesheet, modernizing PrimeFaces datatable rendering, and introducing a styled "Print by"/current-datetime footer.
  • hmislk/hmis#20895: Refactors a different HR JSF report view with analogous changes—restructuring controls/Excel export and rebuilding the print footer layout with flex-based styling and updated datatable markup.
  • hmislk/hmis#20834: Refactors another HR report XHTML page (hr_report_staff_over_time.xhtml) with the same pattern—adding styled h:outputStylesheet, rebuilding the report/table UI, and introducing the "Print by"/timestamp flex footer.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: UI refactoring of the staff payroll selected staff page with styling and layout improvements, as confirmed by the detailed PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staff_payroll_selected_staff

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.

@RohanSGX RohanSGX requested a review from buddhika75 May 18, 2026 11:03
@RohanSGX RohanSGX self-assigned this May 18, 2026
@RohanSGX RohanSGX added UI User Interface Improvements hr-module Work related to the HR module labels May 18, 2026
Copy link
Copy Markdown
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.

🧹 Nitpick comments (6)
src/main/webapp/hr/hr_staff_salary_1.xhtml (6)

298-300: 💤 Low value

Wrap row index in h:outputText for consistency.

Other columns use h:outputText for values; this plain EL expression is inconsistent.

Suggested fix
                             <p:column>
-                                #{i+1}
+                                <h:outputText value="#{i+1}" />
                             </p:column>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` around lines 298 - 300, Replace
the bare EL expression "#{i+1}" inside the p:column with an h:outputText
component for consistency with other columns; locate the p:column that currently
contains the plain "#{i+1}" (the row index) and change it to use h:outputText
with value="#{i+1}" so the column follows the same rendering pattern as other
cells.

364-384: ⚡ Quick win

Use h:outputText for report header labels.

The static text in <span> elements and inline prefixes should use h:outputText for consistency with ERP page patterns.

Suggested fix
                         <div class="report-header-wrap">
-                            <span class="report-title-label">Staff payroll — selected staff</span>
+                            <span class="report-title-label"><h:outputText value="Staff payroll — selected staff" /></span>
                             <span class="report-cycle-label">
                                 <h:outputText value="#{salaryCycleController.current.name}" />
                             </span>
                             <h:panelGroup rendered="#{salaryCycleController.reportKeyWord.institution ne null}">
                                 <p class="report-meta">
                                     <h:outputText value="#{salaryCycleController.reportKeyWord.institution.name}" />
                                 </p>
                             </h:panelGroup>
                             <h:panelGroup rendered="#{salaryCycleController.reportKeyWord.department ne null}">
                                 <p class="report-meta">
-                                    Department: <h:outputText value="#{salaryCycleController.reportKeyWord.department.name}" />
+                                    <h:outputText value="Department: " /><h:outputText value="#{salaryCycleController.reportKeyWord.department.name}" />
                                 </p>
                             </h:panelGroup>
                             <h:panelGroup rendered="#{salaryCycleController.reportKeyWord.roster ne null}">
                                 <p class="report-meta">
-                                    Roster: <h:outputText value="#{salaryCycleController.reportKeyWord.roster.name}" />
+                                    <h:outputText value="Roster: " /><h:outputText value="#{salaryCycleController.reportKeyWord.roster.name}" />
                                 </p>
                             </h:panelGroup>
                         </div>

As per coding guidelines: "Use h:outputText for headings and labels in ERP pages instead of plain text"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` around lines 364 - 384, Replace
plain static text used for headings/labels with h:outputText components: change
the "Staff payroll — selected staff" inside the span.report-title-label to an
<h:outputText> value, replace the report-cycle-label static wrapper if needed,
and convert inline prefixes "Department:" and "Roster:" inside the <p
class="report-meta"> blocks to <h:outputText> components; update the markup
around those spans/phrases so they use h:outputText while keeping existing
references like salaryCycleController.current.name and
salaryCycleController.reportKeyWord.department/roster.name unchanged.

211-211: 💤 Low value

Redundant .greenText class shadows global definition.

This class is already defined in maincss.css (line 670). The duplicate definition with !important may cause unintended style conflicts or make future maintenance harder. Consider removing this line and relying on the global stylesheet.

Suggested fix
-                .greenText { color: `#2e7d32` !important; }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` at line 211, Remove the duplicate
.greenText CSS rule in hr_staff_salary_1.xhtml (the ".greenText { color: `#2e7d32`
!important; }" snippet) and rely on the global definition in maincss.css
instead; if the !important was added to override specificity, move that change
into the global stylesheet (maincss.css) or adjust selectors rather than keeping
a redundant inline rule in hr_staff_salary_1.xhtml.

403-405: ⚡ Quick win

Wrap dynamic header text in h:outputText.

The dynamic column headers from ui:repeat use plain EL expressions. Wrap them in h:outputText for consistency and proper escaping.

Suggested fix
                                         <ui:repeat value="#{salaryCycleController.headersAdd}" var="h">
-                                            <th>#{h}</th>
+                                            <th><h:outputText value="#{h}" /></th>
                                         </ui:repeat>
                                         <ui:repeat value="#{salaryCycleController.headersSub}" var="hh">
-                                            <th>#{hh}</th>
+                                            <th><h:outputText value="#{hh}" /></th>
                                         </ui:repeat>

Also applies to: 411-413

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` around lines 403 - 405, The
ui:repeat rendering dynamic headers uses raw EL (ui:repeat
value="#{salaryCycleController.headersAdd}" var="h") and should wrap each header
expression in h:outputText to ensure proper escaping and consistent rendering;
replace the inline #{h} usage with an h:outputText component (e.g., use
h:outputText value="#{h}") for the repeat at the current block and apply the
same change to the second occurrence mentioned (the block around lines 411-413).

491-493: 💤 Low value

Use h:outputText instead of p:outputLabel for displaying formatted datetime.

p:outputLabel is semantically intended for labeling form inputs, not for displaying formatted values. Use h:outputText with the converter for proper semantic markup.

Suggested fix
-                            <p:outputLabel value="#{commonFunctionsProxy.currentDateTime}">
+                            <h:outputText value="#{commonFunctionsProxy.currentDateTime}">
                                 <f:convertDateTime pattern="yyyy MMMM dd hh:mm:ss a" />
-                            </p:outputLabel>
+                            </h:outputText>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` around lines 491 - 493, Replace
the p:outputLabel used to display the formatted datetime with h:outputText
because p:outputLabel is for labeling inputs; change the component from
p:outputLabel to h:outputText while keeping the f:convertDateTime converter and
its pattern (reference p:outputLabel and f:convertDateTime in the snippet) so
the same value #{commonFunctionsProxy.currentDateTime} is rendered semantically
as output text rather than a form label.

214-217: ⚡ Quick win

Use h:outputText for page headings per coding guidelines.

Plain text in <p> tags should be wrapped in h:outputText for consistency with ERP page patterns.

Suggested fix
             <div class="page-header noPrintButton">
-                <p class="page-title">Staff payroll — selected staff</p>
-                <p class="page-subtitle">Select staff from the list then process payroll in the Pay role tab</p>
+                <p class="page-title"><h:outputText value="Staff payroll — selected staff" /></p>
+                <p class="page-subtitle"><h:outputText value="Select staff from the list then process payroll in the Pay role tab" /></p>
             </div>

As per coding guidelines: "Use h:outputText for headings and labels in ERP pages instead of plain text"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/webapp/hr/hr_staff_salary_1.xhtml` around lines 214 - 217, Replace
the raw text inside the page header <p> elements with JSF h:outputText
components so headings follow ERP patterns: locate the <div class="page-header
noPrintButton"> and update the <p class="page-title"> and <p
class="page-subtitle"> elements to render their literal strings via h:outputText
(preserving the same CSS classes and text content) instead of plain text nodes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/main/webapp/hr/hr_staff_salary_1.xhtml`:
- Around line 298-300: Replace the bare EL expression "#{i+1}" inside the
p:column with an h:outputText component for consistency with other columns;
locate the p:column that currently contains the plain "#{i+1}" (the row index)
and change it to use h:outputText with value="#{i+1}" so the column follows the
same rendering pattern as other cells.
- Around line 364-384: Replace plain static text used for headings/labels with
h:outputText components: change the "Staff payroll — selected staff" inside the
span.report-title-label to an <h:outputText> value, replace the
report-cycle-label static wrapper if needed, and convert inline prefixes
"Department:" and "Roster:" inside the <p class="report-meta"> blocks to
<h:outputText> components; update the markup around those spans/phrases so they
use h:outputText while keeping existing references like
salaryCycleController.current.name and
salaryCycleController.reportKeyWord.department/roster.name unchanged.
- Line 211: Remove the duplicate .greenText CSS rule in hr_staff_salary_1.xhtml
(the ".greenText { color: `#2e7d32` !important; }" snippet) and rely on the global
definition in maincss.css instead; if the !important was added to override
specificity, move that change into the global stylesheet (maincss.css) or adjust
selectors rather than keeping a redundant inline rule in
hr_staff_salary_1.xhtml.
- Around line 403-405: The ui:repeat rendering dynamic headers uses raw EL
(ui:repeat value="#{salaryCycleController.headersAdd}" var="h") and should wrap
each header expression in h:outputText to ensure proper escaping and consistent
rendering; replace the inline #{h} usage with an h:outputText component (e.g.,
use h:outputText value="#{h}") for the repeat at the current block and apply the
same change to the second occurrence mentioned (the block around lines 411-413).
- Around line 491-493: Replace the p:outputLabel used to display the formatted
datetime with h:outputText because p:outputLabel is for labeling inputs; change
the component from p:outputLabel to h:outputText while keeping the
f:convertDateTime converter and its pattern (reference p:outputLabel and
f:convertDateTime in the snippet) so the same value
#{commonFunctionsProxy.currentDateTime} is rendered semantically as output text
rather than a form label.
- Around line 214-217: Replace the raw text inside the page header <p> elements
with JSF h:outputText components so headings follow ERP patterns: locate the
<div class="page-header noPrintButton"> and update the <p class="page-title">
and <p class="page-subtitle"> elements to render their literal strings via
h:outputText (preserving the same CSS classes and text content) instead of plain
text nodes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a76742de-8882-4ce8-b1d7-3ace87839698

📥 Commits

Reviewing files that changed from the base of the PR and between 22a0bd9 and c49b46f.

📒 Files selected for processing (1)
  • src/main/webapp/hr/hr_staff_salary_1.xhtml


<h:form id="print" styleClass="salary-summary-form">

<h:outputStylesheet>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We do nto usually use inline / page specific css. We need to add to a css file or use existing css and call the css classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hr-module Work related to the HR module UI User Interface Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants