Skip to content

Commit 4988e7f

Browse files
999936: fixed the bugs and UI changes
1 parent 4ff3f27 commit 4988e7f

File tree

12 files changed

+256
-284
lines changed

12 files changed

+256
-284
lines changed

Employee_Managment_App/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function App() {
9090
width={`${SIDEBAR_WIDTH}px`}
9191
dockSize={`${SIDEBAR_WIDTH_COLLAPSED}px`}
9292
enableDock={sbEnableDock}
93+
enableGestures={false}
9394
isOpen={sbIsOpen}
9495
type={sbType as any}
9596
position="Left"

Employee_Managment_App/src/components/Achievements.css

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ body,
3434
/* removed decorative radial gradients */
3535
min-height: 100%;
3636
color: var(--text);
37-
font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
38-
}
37+
font-family: 'Roboto', sans-serif;
38+
}
3939

4040
/* Toolbar - flat */
4141
.achievements-toolbar {
@@ -70,14 +70,17 @@ body,
7070
}
7171

7272
.toolbar-field {
73-
display: grid;
73+
display: flex;
74+
justify-content: center;
75+
align-items: center;
7476
gap: 6px;
7577
font-size: 12px;
7678
color: var(--muted);
7779
}
7880

7981
.field-label {
8082
opacity: .9;
83+
font-size: 14px;
8184
}
8285

8386
/* Syncfusion dropdowns */
@@ -144,7 +147,7 @@ body,
144147
.lb-section {
145148
background: var(--surface);
146149
border: 1px solid var(--border);
147-
border-radius: 10px;
150+
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
148151
overflow: hidden;
149152
}
150153

@@ -153,6 +156,7 @@ body,
153156
display: flex;
154157
align-items: center;
155158
gap: 10px;
159+
height: 70px;
156160
padding: 10px 12px;
157161
border-bottom: 1px solid var(--border);
158162
background: #fff;
@@ -171,18 +175,21 @@ body,
171175
.bg-r-overall {
172176
background: #fb5757;
173177
color: #fff;
178+
font-size: 22px;
174179
}
175180

176181
.icon-task,
177182
.bg-r-task {
178183
background: #d65e22;
179184
color: #fff;
185+
font-size: 22px;
180186
}
181187

182188
.icon-att,
183189
.bg-r-attendance {
184190
background: #317701;
185191
color: #fff;
192+
font-size: 22px;
186193
}
187194

188195
.lb-header-text {
@@ -196,7 +203,7 @@ body,
196203
}
197204

198205
.lb-sub {
199-
font-size: 10px;
206+
font-size: 14px;
200207
color: #fff;
201208
letter-spacing: 1px;
202209
padding-top: 5px;
@@ -292,13 +299,6 @@ body,
292299
font-size: 13px;
293300
letter-spacing: .2px;
294301
font-feature-settings: "tnum" on, "lnum" on;
295-
background: #f8fafc;
296302
padding: 4px 8px;
297-
border-radius: 6px;
298-
border: 1px solid #e5e7eb;
299303
font-family: 'Roboto', sans-serif;
300304
}
301-
302-
.score.flat {
303-
background: #f8fafc;
304-
}

Employee_Managment_App/src/components/Achievements.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
209209

210210
<div className="toolbar-right">
211211
<label className="toolbar-field">
212-
<span className="field-label">Role</span>
212+
<span className="field-label" >Role</span>
213213
<DropDownListComponent
214214
id="role-ddl"
215215
cssClass="sf-field-input"
216216
dataSource={roles}
217217
fields={{ text: 'text', value: 'value' }}
218218
value={role}
219-
width="180px"
219+
width="135px"
220220
placeholder="Select role"
221221
change={(e: any) => setRole(e.value)}
222222
aria-label="Filter by role"
@@ -231,6 +231,7 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
231231
id="month-ddl"
232232
cssClass="sf-field-input"
233233
dataSource={months}
234+
width="100px"
234235
fields={{ text: 'text', value: 'value' }}
235236
value={month}
236237
placeholder="Select month"
@@ -247,6 +248,7 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
247248
id="year-ddl"
248249
cssClass="sf-field-input"
249250
dataSource={years}
251+
width="100px"
250252
fields={{ text: 'text', value: 'value' }}
251253
value={year}
252254
placeholder="Select year"
@@ -270,10 +272,7 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
270272
<div className="lb-sections">
271273
<section className="lb-section">
272274
<header className="lb-header bg-r-overall">
273-
<div className="lb-header-icon icon-overall" aria-hidden>
274-
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
275-
<path d="M7 10a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm10 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4zM12 9a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm-7 8v-1a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v1H5zm10 0v-1a5 5 0 0 1 5-5h.5A1.5 1.5 0 0 1 22 12.5V17H15z" />
276-
</svg>
275+
<div className="lb-header-icon icon-overall e-icons e-user" aria-hidden>
277276
</div>
278277
<div className="lb-header-text">
279278
<div className="lb-title">Overall</div>
@@ -297,10 +296,7 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
297296

298297
<section className="lb-section">
299298
<header className="lb-header bg-r-task">
300-
<div className="lb-header-icon icon-task" aria-hidden>
301-
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
302-
<path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
303-
</svg>
299+
<div className="lb-header-icon icon-task e-icons e-check-tick" aria-hidden>
304300
</div>
305301
<div className="lb-header-text">
306302
<div className="lb-title">Task</div>
@@ -324,10 +320,7 @@ const Achievements: React.FC<AchievementsProps> = ({ userInfo, onlyTeamIfUser =
324320

325321
<section className="lb-section">
326322
<header className="lb-header bg-r-attendance">
327-
<div className="lb-header-icon icon-att" aria-hidden>
328-
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
329-
<path d="M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm0 16H5V8h14v11z" />
330-
</svg>
323+
<div className="lb-header-icon icon-att e-icons e-day" aria-hidden>
331324
</div>
332325
<div className="lb-header-text">
333326
<div className="lb-title">Attendance</div>

Employee_Managment_App/src/components/Announcement.tsx

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// src/components/Announcement.tsx
22
// Reusable right-side drawer that shows Notifications and Announcements
33
// Adds Syncfusion Dialog for item details
4-
54
import React from 'react';
65
import './Announcement.css';
76
import { AnnouncementDetailDialog } from './AnnouncementDetailDialog';
7+
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
88

99
export type PanelItem = {
1010
id: string | number;
@@ -14,6 +14,7 @@ export type PanelItem = {
1414
type?: 'announcement' | 'notification' | 'message';
1515
content?: string; // full body to show in dialog
1616
read?: boolean; // optional read flag
17+
iconClass?: string;
1718
};
1819

1920
export type AnnouncementPanelProps = {
@@ -51,7 +52,9 @@ export const AnnouncementPanel: React.FC<AnnouncementPanelProps> = ({
5152
}, [open, defaultTab]);
5253

5354
React.useEffect(() => {
54-
const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); };
55+
const onKey = (e: KeyboardEvent) => {
56+
if (e.key === 'Escape') onClose();
57+
};
5558
document.addEventListener('keydown', onKey);
5659
return () => document.removeEventListener('keydown', onKey);
5760
}, [onClose]);
@@ -80,6 +83,22 @@ export const AnnouncementPanel: React.FC<AnnouncementPanelProps> = ({
8083
setSelectedItem(null);
8184
};
8285

86+
const handleMarkAllRead = () => {
87+
// Notify parent (if provided)
88+
onMarkAllRead?.(tab);
89+
90+
// Keep your existing badge-hiding logic (targets TopNav icon buttons)
91+
const selector =
92+
tab === 'announcements'
93+
? '.icon-btn.e-icons.e-audio span'
94+
: '.icon-btn.e-icons.e-multiple-comment span';
95+
document.querySelectorAll(selector).forEach((el) => {
96+
const span = el as HTMLElement;
97+
span.style.display = 'none';
98+
span.setAttribute('aria-hidden', 'true');
99+
});
100+
};
101+
83102
const items = tab === 'notifications' ? notificationItems : announcementItems;
84103

85104
return (
@@ -98,31 +117,43 @@ export const AnnouncementPanel: React.FC<AnnouncementPanelProps> = ({
98117
>
99118
<div className="annc-panel-header">
100119
<div className="annc-panel-title">Notification</div>
101-
<button className="annc-panel-close" type="button" aria-label="Close" onClick={onClose} title="Close">
120+
<ButtonComponent
121+
className="annc-panel-close"
122+
cssClass="annc-panel-close"
123+
type="button"
124+
aria-label="Close"
125+
onClick={onClose}
126+
title="Close"
127+
>
102128
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
103-
<path fill="currentColor" d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
129+
<path
130+
fill="currentColor"
131+
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
132+
/>
104133
</svg>
105-
</button>
134+
</ButtonComponent>
106135
</div>
107136

108137
<div className="annc-panel-tabs" role="tablist" aria-label="Notification categories">
109-
<button role="tab" aria-selected={tab === 'notifications'} className={tab === 'notifications' ? 'active' : ''} onClick={() => setActiveTab('notifications')} title="Notifications">
110-
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
111-
<path fill="currentColor" d="M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2zm6-6V11a6 6 0 1 0-12 0v5l-2 2v1h16v-1l-2-2z" />
112-
</svg>
138+
<button role="tab" aria-selected={tab === 'notifications'} className={tab === 'notifications' ? 'active e-icons e-multiple-comment' : 'e-icons e-multiple-comment'} onClick={() => setActiveTab('notifications')} title="Notifications">
113139
</button>
114-
<button role="tab" aria-selected={tab === 'announcements'} className={tab === 'announcements' ? 'active' : ''} onClick={() => setActiveTab('announcements')} title="Announcements">
115-
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
116-
<path fill="currentColor" d="M3 10v4a1 1 0 0 0 1 1h1l3.89 2.6a2 2 0 0 0 3.11-1.65V7.05A2 2 0 0 0 8.89 5.4L5 8H4a1 1 0 0 0-1 1zm18-4v12l-8-4V10l8-4z" />
117-
</svg>
140+
<button role="tab" aria-selected={tab === 'announcements'} className={tab === 'announcements' ? 'active e-icons e-audio' : 'e-icons e-audio'} onClick={() => setActiveTab('announcements')} title="Announcements">
118141
</button>
119142
</div>
120143

121144
<div className="annc-panel-subhead">
122-
{tab === 'notifications' ? <span>Notifications for the last 15 days</span> : <span>Announcements</span>}
123-
<button className="annc-panel-cta" type="button" onClick={() => onMarkAllRead?.(tab)}>
145+
{tab === 'notifications' ? (
146+
<span>Notifications for the last 15 days</span>
147+
) : (
148+
<span>Announcements</span>
149+
)}
150+
<ButtonComponent
151+
cssClass="annc-panel-cta"
152+
type="button"
153+
onClick={handleMarkAllRead}
154+
>
124155
Mark all read
125-
</button>
156+
</ButtonComponent>
126157
</div>
127158

128159
<div className="annc-panel-content" role="region" aria-live="polite">
@@ -138,17 +169,8 @@ export const AnnouncementPanel: React.FC<AnnouncementPanelProps> = ({
138169
onKeyDown={(e) => e.key === 'Enter' && openDetail(it)}
139170
title="View details"
140171
>
141-
<span className={`annc-item-icon ${tab === 'announcements' ? 'bullhorn' : ''}`}>
142-
<svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true">
143-
<path
144-
fill="currentColor"
145-
d={
146-
tab === 'announcements'
147-
? 'M3 10v4a1 1 0 0 0 1 1h1l3.89 2.6a2 2 0 0 0 3.11-1.65V7.05A2 2 0 0 0 8.89 5.4L5 8H4a1 1 0 0 0-1 1zm18-4v12l-8-4V10l8-4z'
148-
: 'M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2zm6-6V11a6 6 0 1 0-12 0v5l-2 2v1h16v-1l-2-2z'
149-
}
150-
/>
151-
</svg>
172+
<span className="panel-item-icon" aria-hidden="true">
173+
<i className={it.iconClass ?? (it.type === 'announcement' ? 'e-icons e-audio' : 'e-icons e-multiple-comment')} />
152174
</span>
153175
<div className="annc-item-body">
154176
<div className="annc-item-title">{it.title}</div>
@@ -164,7 +186,9 @@ export const AnnouncementPanel: React.FC<AnnouncementPanelProps> = ({
164186
</ul>
165187
) : (
166188
<div className="annc-panel-empty">
167-
{tab === 'notifications' ? 'No notification for the last 15 days.' : 'No announcements for the last 15 days.'}
189+
{tab === 'notifications'
190+
? 'No notification for the last 15 days.'
191+
: 'No announcements for the last 15 days.'}
168192
</div>
169193
)}
170194
</div>

Employee_Managment_App/src/components/AnnouncementDetailDialog.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ export type AnnouncementDetailDialogProps = {
2727
const dialogAnimation: AnimationSettingsModel = { effect: 'Zoom', duration: 140 };
2828

2929
const BullhornIcon = () => (
30-
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
31-
<path fill="currentColor" d="M3 10v4a1 1 0 0 0 1 1h1l3.89 2.6a2 2 0 0 0 3.11-1.65V7.05A2 2 0 0 0 8.89 5.4L5 8H4a1 1 0 0 0-1 1zm18-4v12l-8-4V10l8-4z" />
32-
</svg>
30+
<div className="e-icons e-audio"></div>
3331
);
3432
const BellIcon = () => (
35-
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
36-
<path fill="currentColor" d="M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2zm6-6V11a6 6 0 1 0-12 0v5l-2 2v1h16v-1l-2-2z" />
37-
</svg>
33+
<div className='e-icons e-multiple-comment'></div>
3834
);
3935
const MessageIcon = () => (
4036
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true">
@@ -97,7 +93,7 @@ export const AnnouncementDetailDialog: React.FC<AnnouncementDetailDialogProps> =
9793
const footerTemplate = () => (
9894
<div className="annc-dlg-footer">
9995
{item && (
100-
<ButtonComponent cssClass="e-primary" onClick={() => onMarkRead?.(item)}>
96+
<ButtonComponent cssClass="e-primary" onClick={onClose}>
10197
Mark as read
10298
</ButtonComponent>
10399
)}

Employee_Managment_App/src/components/Employees.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ const Employees = (props?: EmployeesProps) => {
125125
};
126126

127127
const beforeRender = (args: TooltipEventArgs) => {
128+
129+
if(args.target.classList.contains('e-headercell')) {
130+
(tooltipObj.current as any).content =args.target.innerText;
131+
}
132+
else {
128133
const rowInfo: RowInfo = employeeGridIns.current?.getRowInfo(args.target.closest('td') as HTMLElement) as RowInfo;
129134
const rowData = rowInfo?.rowData as EmployeeDetails;
130135
(tooltipObj.current as any).content = `
@@ -140,14 +145,15 @@ const Employees = (props?: EmployeesProps) => {
140145
</div>
141146
</div>
142147
</div>`;
148+
}
143149
};
144150

145151
return (
146152
<div className="employees-content">
147153
<TooltipComponent
148154
id="content"
149155
cssClass="e-tooltip-template-css"
150-
target="td.infotooltip"
156+
target="#employees_grid .e-headercell, #employees_grid td.infotooltip"
151157
beforeRender={beforeRender}
152158
ref={tooltipObj}
153159
>
@@ -160,6 +166,7 @@ const Employees = (props?: EmployeesProps) => {
160166
allowExcelExport={true}
161167
//width={'100%'}
162168
//height={'100%'}
169+
163170
allowGrouping={true}
164171
groupSettings={{ enableLazyLoading: true }}
165172
toolbar={toolbar}
@@ -177,6 +184,7 @@ const Employees = (props?: EmployeesProps) => {
177184
field="Image"
178185
headerText="Image"
179186
template={imageTemplate}
187+
clipMode='Clip'
180188
allowFiltering={false}
181189
allowSorting={false}
182190
allowGrouping={false}

0 commit comments

Comments
 (0)