Skip to content

Commit 141e162

Browse files
1000396: added UI corrections in Payroll page
1 parent f570ff8 commit 141e162

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

Employee_Managment_App/src/components/EmployeePayRoll.tsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,25 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
208208
];
209209

210210
const queryCellInfo = (args: QueryCellInfoEventArgs): void => {
211-
if (args.column?.field === 'Total') {
212-
for (let i: number = 0; i < elemClass.length; i++) {
213-
const elem: HTMLElement = args.cell?.querySelector('.' + elemClass[i]) as HTMLElement;
214-
let value: number = 0;
215-
for (let j: number = 0; j < months.length; j++) {
216-
if ((args.data as any)[months[j].field]) {
217-
value += (args.data as any)[months[j].field][elemClass[i]] * (isPreviousYearRef.current ? 0.9 : 1);
218-
}
219-
}
220-
if (elem) {
221-
elem.innerText = '$ ' + value.toFixed(2);
211+
if (args.column?.field === 'Total') {
212+
for (let i: number = 0; i < elemClass.length; i++) {
213+
const elem: HTMLElement = args.cell?.querySelector('.' + elemClass[i]) as HTMLElement;
214+
let value: number = 0;
215+
for (let j: number = 0; j < months.length; j++) {
216+
if ((args.data as any)[months[j].field]) {
217+
value += (args.data as any)[months[j].field][elemClass[i]] * (isPreviousYearRef.current ? 0.9 : 1);
222218
}
223219
}
220+
if (elem) {
221+
elem.innerText = '$ ' + value.toFixed(2);
222+
}
224223
}
225-
};
224+
225+
// Make all Total column values bold
226+
const totalCells = args.cell?.querySelectorAll('.cardcell') ?? [];
227+
totalCells.forEach((c) => ((c as HTMLElement).style.fontWeight = '700'));
228+
}
229+
};
226230

227231
const calculteGrossAggregate = (data: any, aggColumn: AggregateColumnModel): string => {
228232
const payStubData: MonthPayStub =
@@ -412,7 +416,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
412416
type="Custom"
413417
customAggregate={calculteGrossInYear}
414418
footerTemplate={(props: any) => {
415-
return <span>$ {props.Custom}</span>;
419+
return <strong>$ {props.Custom}</strong>;
416420
}}
417421
/>
418422
{months.map((x, index) => {
@@ -445,7 +449,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
445449
type="Custom"
446450
customAggregate={calculteDeductionInYear}
447451
footerTemplate={(props: any) => {
448-
return <span>$ {props.Custom}</span>;
452+
return <strong>$ {props.Custom}</strong>;
449453
}}
450454
/>
451455
{months.map((x, index) => {
@@ -470,7 +474,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
470474
field="Item"
471475
type="Custom"
472476
footerTemplate={() => {
473-
return <strong>Net Pay</strong>;
477+
return <span>Net Pay</span>;
474478
}}
475479
/>
476480
<AggregateColumnDirective
@@ -489,7 +493,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
489493
type="Custom"
490494
customAggregate={calculteNetPayAggregate}
491495
footerTemplate={(props: any) => {
492-
return <span>$ {props.Custom}</span>;
496+
return <strong>$ {props.Custom}</strong>;
493497
}}
494498
/>
495499
);

Employee_Managment_App/src/components/TopNav.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111

112112
/* Input group container */
113113
.search-field.input-group {
114-
pointer-events: none;
115114
position: relative;
116115
display: flex;
117116
align-items: center;

0 commit comments

Comments
 (0)