Skip to content

Commit 2ceede1

Browse files
authored
Merge pull request #38 from SyncfusionExamples/1000396-UI-employee
config(1000396): Need to fix bugs and UI issues for all the pages in Employee Management
2 parents 1c13f03 + c0919a6 commit 2ceede1

File tree

9 files changed

+83
-42
lines changed

9 files changed

+83
-42
lines changed
-46.9 KB
Binary file not shown.

Employee_Managment_App/src/App.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
top: 0;
2121
left: 0;
2222
bottom: 0;
23-
background-image: url(../public/background.png);
2423
width: var(--sidebar-current-width);
2524
background-color: #242a35;
2625
color: #fff;

Employee_Managment_App/src/components/EmployeeInfo.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,15 @@ const EmployeeInfo = (props: { employeeData?: EmployeeDetails; userInfo?: Employ
225225
<div className="profile-data-name">{employeeData.Name}</div>
226226
<div className="profile-data-mail">{employeeData.Mail}</div>
227227
<div className="profile-data-designation">{employeeData.Designation}</div>
228+
<div className='profile-data-Teamname'>{employeeData.Team}</div>
228229
<div className="profile-data-supervisor">Supervisor: {employeeData.TeamLead}</div>
229230
<div className="profile-data-branch">Branch: {employeeData.Branch}</div>
230231
<div className="Profile-data-availability e-badge"> Available - {employeeData.Branch}</div>
231232
</div>
232233
</div>
233234
<div className="overview-content">
234-
<TabComponent heightAdjustMode="Auto" overflowMode='Scrollable'>
235-
<TabItemsDirective>
235+
<TabComponent heightAdjustMode="Auto" swipeMode="None" overflowMode='Scrollable'>
236+
<TabItemsDirective >
236237
<TabItemDirective header={headerText[0]} content={content0} />
237238
{employeeData &&
238239
userInfo &&

Employee_Managment_App/src/components/EmployeeLeave.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
letter-spacing: .2px;
135135
}
136136

137+
137138
/* Container for grid cell alignment */
138139
.leave-type-badge {
139140
display: flex;
@@ -225,3 +226,44 @@
225226
color: #FFECA6;
226227
border-color: #6A5617;
227228
}
229+
230+
/* container if you need any extra padding or alignment */
231+
.status-badge-wrapper {
232+
display: flex;
233+
justify-content: center; /* or flex-start/ end as you like */
234+
align-items: center;
235+
}
236+
237+
/* base badge overrides (optional) */
238+
.status-badge-wrapper .e-badge {
239+
display: inline-block;
240+
padding: 4px 10px;
241+
border-radius: 999px;
242+
font-size: 12px;
243+
font-weight: 600;
244+
line-height: 1.2;
245+
letter-spacing: .2px; /* white text */
246+
}
247+
248+
/* now per-status background colors */
249+
.status-approved {
250+
background-color: #FFF3C4; /* light yellow for pending/request */
251+
color: #8A6A00; /* dark gold/brown */
252+
border: 1px solid #FFE28A; /* green */
253+
}
254+
.status-closed {
255+
background-color: #A8E6CF; /* light green */
256+
color: #11624C; /* dark green */
257+
border: 1px solid #7BD4B4; /* gray */
258+
}
259+
.status-need-to-approve {
260+
background-color: #FFD6D6; /* light red */
261+
color: #9B1C1C; /* dark red */
262+
border: 1px solid #F5A8A8; /* orange */
263+
}
264+
.status-requested {
265+
background-color: #17a2b8; /* teal */
266+
}
267+
.status-pending {
268+
background-color: #007bff; /* blue */
269+
}

Employee_Managment_App/src/components/EmployeeLeave.tsx

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -220,25 +220,23 @@ const leaveTypeTemplate = (args: any) => {
220220
}
221221
};
222222

223-
const statusTemplate = (args: any) => {
224-
return (
225-
<div>
226-
{args.Status === 'Closed' ? (
227-
<div id="status" className="statustemp closed">
228-
<span className="statustxt closed">{args.Status}</span>
229-
</div>
230-
) : args.Status === 'Approved' ? (
231-
<div id="status" className="statustemp approved">
232-
<span className="statustxt approved">{args.Status}</span>
233-
</div>
234-
) : (
235-
<div id="status" className="statustemp needtoapprove">
236-
<span className="statustxt needtoapprove">{args.Status}</span>
237-
</div>
238-
)}
239-
</div>
240-
);
241-
};
223+
const statusTemplate = (args: any) => {
224+
const rawStatus = args.Status || 'N/A';
225+
// normalize id-safe key, e.g. "Need to Approve" → "need-to-approve"
226+
const key = rawStatus
227+
.toString()
228+
.trim()
229+
.toLowerCase()
230+
.replace(/\s+/g, '-');
231+
232+
return (
233+
<div className="status-badge-wrapper">
234+
<span className={`e-badge status-${key}`} title={rawStatus}>
235+
{rawStatus}
236+
</span>
237+
</div>
238+
);
239+
};
242240

243241
const approveChange = (args: ChangeEventArgs) => {
244242
const td = ((args.event as any).target as HTMLElement)?.closest('td');
@@ -268,15 +266,11 @@ const leaveTypeTemplate = (args: any) => {
268266
<div className='employee-leave-detail'>
269267
<div className="employeeLeave-header">
270268
<div className="leaveinfo">
271-
<div className='leave-headerinfo'>
272-
<b>Leave:</b>{' '}
273-
</div>
274-
<div className='leave-value'>
269+
<b>Leave:</b>{' '}
275270
<span className="e-badge badge-casual">{leaveCount.casual} d</span> Casual |{' '}
276271
<span className="e-badge badge-sick">{leaveCount.sick} d</span> Sick |{' '}
277272
<span className="e-badge badge-others">{leaveCount.others} d</span> Others |{' '}
278273
<span className="e-badge badge-request">{leaveCount.request} d</span> Request
279-
</div>
280274
</div>
281275
<div className="daterange">
282276
<Presets dateRangeChange={dateRangeChange} />
@@ -311,7 +305,7 @@ const leaveTypeTemplate = (args: any) => {
311305
<ColumnDirective field="From" type="date" format="MMM d yyyy" textAlign="Right" width="120" />
312306
<ColumnDirective field="To" type="date" format="MMM d yyyy" textAlign="Right" width="120" />
313307
<ColumnDirective field="Days" headerText="Day(s)" textAlign="Right" width="120" />
314-
<ColumnDirective field="Status" template={statusTemplate} width="150" />
308+
<ColumnDirective field="Status" headerText="Status" template={statusTemplate} width="150" />
315309
{props.employeeData &&
316310
props.userInfo &&
317311
props.employeeData.TeamLead === props.userInfo.Name && (

Employee_Managment_App/src/components/EmployeePayRoll.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
354354
id="payroll_grid"
355355
ref={payRollGridIns}
356356
dataSource={gridData}
357-
allowPaging={true}
357+
allowPaging={false}
358358
query={query}
359359
width={'100%'}
360360
height={'auto'}

Employee_Managment_App/src/components/Policies.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,9 @@
232232
}
233233

234234
.policies-grid-wrapper .e-grid {
235-
border: 1px solid var(--border);
236-
border-radius: 16px;
235+
237236
overflow: hidden;
238237
background: #fff;
239-
box-shadow: var(--shadow-md);
240238
}
241239

242240
.policies-grid-wrapper .e-grid .e-rowcell {

Employee_Managment_App/src/components/TopNav.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@
352352
width: 36px;
353353
height: 36px;
354354
border-radius: 999px;
355+
pointer-events: none;
355356
background: #f1f5f9;
356357
color: var(--topnav-text);
357358
border: 1px solid var(--topnav-border);

Employee_Managment_App/src/index.css

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70812,6 +70812,13 @@ a.employee-popover:hover {
7081270812
margin-top: 5px;
7081370813
font-family: var(--font-family);
7081470814
}
70815+
.profile-data-Teamname{
70816+
font-weight: 400;
70817+
height: 16px;
70818+
font-size: 14px;
70819+
margin-top: 5px;
70820+
font-family: var(--font-family);
70821+
}
7081570822

7081670823
.profile-data-supervisor {
7081770824
margin-top: 5px;
@@ -70929,7 +70936,6 @@ td.cardcell.separateline {
7092970936

7093070937
.statustemp.approved {
7093170938
background-color: #ffff99;
70932-
width: 75px;
7093370939
}
7093470940

7093570941
.statustxt.approved {
@@ -70960,12 +70966,10 @@ td.cardcell.separateline {
7096070966

7096170967
.statustemp.needtoapprove {
7096270968
background-color: #df2222;
70963-
width: 120px;
7096470969
}
7096570970

7096670971
.statustemp.closed {
7096770972
background-color: #00b300;
70968-
width: 54px;
7096970973
}
7097070974

7097170975
.statustxt.closed {
@@ -70976,13 +70980,6 @@ td.cardcell.separateline {
7097670980
color: white;
7097770981
}
7097870982

70979-
.statustemp {
70980-
position: relative;
70981-
height: 25px;
70982-
border-radius: 5px;
70983-
text-align: center;
70984-
}
70985-
7098670983
#listSidebar .e-listview:not(.e-list-template) .e-list-item {
7098770984
height: 60px;
7098870985
padding: 12px;
@@ -71027,12 +71024,18 @@ td.cardcell.separateline {
7102771024
.achievements-content .card-control-section.basic_card_layout .col-xs-6.col-sm-6.col-lg-6.col-md-6 {
7102871025
width: 100%;
7102971026
}
71027+
.paystubpage, .employee-leave-detail, .payrollpage{
71028+
margin-right: 25px;
71029+
}
7103071030
}
7103171031

7103271032
@media (max-width: 600px) {
7103371033
.card-control-section.basic_card_layout .col-xs-6.col-sm-6.col-lg-6.col-md-6 {
7103471034
width: 100%;
7103571035
}
71036+
.org-filters__pills .org-pill{
71037+
margin-bottom: 7px;
71038+
}
7103671039

7103771040
.achievements-content .card-control-section.basic_card_layout .col-xs-6.col-sm-6.col-lg-6.col-md-6 {
7103871041
width: 100%;
@@ -71041,6 +71044,9 @@ td.cardcell.separateline {
7104171044
.card-control-section.basic_card_layout .card-layout {
7104271045
max-width: 600px;
7104371046
}
71047+
.employeeLeave-header span {
71048+
margin: 2px 2px
71049+
}
7104471050
}
7104571051

7104671052
.e-line-very-small:before {

0 commit comments

Comments
 (0)