Skip to content

Commit 11d26e7

Browse files
1000396: added UI changes in payroll page
1 parent 141e162 commit 11d26e7

File tree

1 file changed

+59
-58
lines changed

1 file changed

+59
-58
lines changed

Employee_Managment_App/src/components/EmployeePayRoll.tsx

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -73,42 +73,42 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
7373
}, []);
7474

7575
const itemTemplate = () => {
76-
return (
77-
<div>
78-
<table className="CardTable">
79-
<colgroup>
80-
<col />
81-
</colgroup>
82-
<tbody>
83-
<tr>
84-
<td className="cardcell"> Regular Hours Worked </td>
85-
</tr>
86-
<tr>
87-
<td className="cardcell">OverTime Hours Worked </td>
88-
</tr>
89-
<tr>
90-
<td className="cardcell"> Bonus </td>
91-
</tr>
92-
<tr>
93-
<td className="cardcell separateline"> Commission </td>
94-
</tr>
95-
<tr>
96-
<td className="cardcell"> Federal Income Tax </td>
97-
</tr>
98-
<tr>
99-
<td className="cardcell"> State Income Tax </td>
100-
</tr>
101-
<tr>
102-
<td className="cardcell"> Social Security Tax </td>
103-
</tr>
104-
<tr>
105-
<td className="cardcell"> MedicareTax </td>
106-
</tr>
107-
</tbody>
108-
</table>
109-
</div>
110-
);
111-
};
76+
return (
77+
<div>
78+
<table className="CardTable">
79+
<colgroup>
80+
<col />
81+
</colgroup>
82+
<tbody>
83+
<tr>
84+
<td className="cardcell" style={{ fontWeight: 400 }}> Regular Hours Worked </td>
85+
</tr>
86+
<tr>
87+
<td className="cardcell" style={{ fontWeight: 400 }}>OverTime Hours Worked </td>
88+
</tr>
89+
<tr>
90+
<td className="cardcell" style={{ fontWeight: 400 }}> Bonus </td>
91+
</tr>
92+
<tr>
93+
<td className="cardcell separateline" style={{ fontWeight: 400 }}> Commission </td>
94+
</tr>
95+
<tr>
96+
<td className="cardcell" style={{ fontWeight: 400 }}> Federal Income Tax </td>
97+
</tr>
98+
<tr>
99+
<td className="cardcell" style={{ fontWeight: 400 }}> State Income Tax </td>
100+
</tr>
101+
<tr>
102+
<td className="cardcell" style={{ fontWeight: 400 }}> Social Security Tax </td>
103+
</tr>
104+
<tr>
105+
<td className="cardcell" style={{ fontWeight: 400 }}> MedicareTax </td>
106+
</tr>
107+
</tbody>
108+
</table>
109+
</div>
110+
);
111+
};
112112

113113
const totalTemplate = () => {
114114
return (
@@ -209,10 +209,11 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
209209

210210
const queryCellInfo = (args: QueryCellInfoEventArgs): void => {
211211
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++) {
212+
// Compute totals into the Total column
213+
for (let i = 0; i < elemClass.length; i++) {
214+
const elem = args.cell?.querySelector('.' + elemClass[i]) as HTMLElement;
215+
let value = 0;
216+
for (let j = 0; j < months.length; j++) {
216217
if ((args.data as any)[months[j].field]) {
217218
value += (args.data as any)[months[j].field][elemClass[i]] * (isPreviousYearRef.current ? 0.9 : 1);
218219
}
@@ -222,9 +223,9 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
222223
}
223224
}
224225

225-
// Make all Total column values bold
226+
// Make all Total column values medium (500)
226227
const totalCells = args.cell?.querySelectorAll('.cardcell') ?? [];
227-
totalCells.forEach((c) => ((c as HTMLElement).style.fontWeight = '700'));
228+
totalCells.forEach((c) => ((c as HTMLElement).style.fontWeight = '500'));
228229
}
229230
};
230231

@@ -416,7 +417,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
416417
type="Custom"
417418
customAggregate={calculteGrossInYear}
418419
footerTemplate={(props: any) => {
419-
return <strong>$ {props.Custom}</strong>;
420+
return <span style={{ fontWeight: 500 }}>$ {props.Custom}</span>;
420421
}}
421422
/>
422423
{months.map((x, index) => {
@@ -449,7 +450,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
449450
type="Custom"
450451
customAggregate={calculteDeductionInYear}
451452
footerTemplate={(props: any) => {
452-
return <strong>$ {props.Custom}</strong>;
453+
return <span style={{ fontWeight: 500 }}>$ {props.Custom}</span>;
453454
}}
454455
/>
455456
{months.map((x, index) => {
@@ -474,30 +475,30 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
474475
field="Item"
475476
type="Custom"
476477
footerTemplate={() => {
477-
return <span>Net Pay</span>;
478+
return <span style={{ fontWeight: 600 }}>Net Pay</span>;
478479
}}
479480
/>
480481
<AggregateColumnDirective
481482
field="Total"
482483
type="Custom"
483484
customAggregate={calculteNetPayInYear}
484485
footerTemplate={(props: any) => {
485-
return <strong>$ {props.Custom}</strong>;
486+
return <span style={{ fontWeight: 600 }}>$ {props.Custom}</span>;
486487
}}
487488
/>
488489
{months.map((x, index) => {
489-
return (
490-
<AggregateColumnDirective
491-
key={index + 3}
492-
field={x.field}
493-
type="Custom"
494-
customAggregate={calculteNetPayAggregate}
495-
footerTemplate={(props: any) => {
496-
return <strong>$ {props.Custom}</strong>;
497-
}}
498-
/>
499-
);
500-
})}
490+
return (
491+
<AggregateColumnDirective
492+
key={index + 3}
493+
field={x.field}
494+
type="Custom"
495+
customAggregate={calculteNetPayAggregate}
496+
footerTemplate={(props: any) => {
497+
return <span style={{ fontWeight: 600 }}>$ {props.Custom}</span>;
498+
}}
499+
/>
500+
);
501+
})}
501502
</AggregateColumnsDirective>
502503
</AggregateDirective>
503504
</AggregatesDirective>

0 commit comments

Comments
 (0)