Skip to content

Commit 203d828

Browse files
1000395: Fixing issues in Employee Management
1 parent 3230700 commit 203d828

File tree

3 files changed

+100
-28
lines changed

3 files changed

+100
-28
lines changed

Employee_Managment_App/src/components/AnnouncementDialog.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
}
124124
.annc-dlg-details_value {
125125
font-size: 14px;
126+
font-weight: 500;
126127
color: var(--annc-text);
127128
min-width: 0;
128129
overflow: hidden;

Employee_Managment_App/src/components/Policies.css

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
--text-strong: #0f172a;
1818
--text-muted: #667085;
1919
--text-soft: #475467;
20+
--policy-text: #0f172a;
2021

2122

2223
--surface: #ffffff;
@@ -31,6 +32,8 @@
3132

3233
--color-sf-primary-bg-color: #1ab394;
3334
--color-sf-primary-border-color: #1ab394;
35+
36+
--policy-muted: #64748b;
3437
}
3538

3639
.policies-grid-wrapper {
@@ -98,14 +101,16 @@
98101
display: flex;
99102
align-items: center;
100103
justify-content: space-between;
101-
margin: 12px 0 12px;
104+
margin: 12px 0 8px;
102105
}
103106

104107
.section-title {
105-
margin: 0;
106-
font-size: 18px;
107-
font-weight: 700;
108-
font-family: 'Roboto', sans-serif;
108+
font-size: 12px;
109+
color: var(--annc-muted);
110+
text-transform: uppercase;
111+
letter-spacing: .3px;
112+
font-weight: 800;
113+
margin-bottom: 8px;
109114
}
110115

111116
.view-all-link {
@@ -284,27 +289,44 @@
284289
opacity: .95;
285290
}
286291

287-
/* Dialog */
292+
/* Dialog – match Announcement dialog styles exactly where different */
293+
.no-gradient,
294+
.no-gradient * { background-image: none !important; }
295+
296+
.policy-dialog.e-dialog {
297+
border-radius: 12px;
298+
background: #ffffff;
299+
box-shadow: var(--shadow-md);
300+
overflow: hidden;
301+
}
302+
288303
.policy-dialog .e-dlg-header-content {
289304
border-bottom: 1px solid var(--border);
290-
padding: 14px 18px;
305+
padding: 16px 20px;
291306
background: #fff;
292307
}
293308

294309
.policy-dialog .e-dlg-header {
295-
font-weight: 900;
296-
color: var(--primary-800);
310+
color: var(--annc-text);
311+
font-weight: 800;
312+
font-size: 18px;
313+
line-height: 1.3;
314+
overflow: hidden;
315+
text-overflow: ellipsis;
316+
white-space: nowrap;
297317
}
298318

299319
.policy-dialog .e-dlg-content {
300320
padding: 0;
301321
background: #fff;
322+
max-height: min(72vh, 560px);
323+
overflow: auto;
302324
}
303325

304326
.policy-dialog__content {
305327
display: grid;
306-
gap: 20px;
307-
padding: 18px 20px 20px;
328+
gap: 16px;
329+
padding: 16px 20px 14px 20px;
308330
}
309331

310332
.policy-dialog__meta {
@@ -313,9 +335,8 @@
313335
gap: 12px 16px;
314336
padding: 12px;
315337
border: 1px solid var(--border);
316-
border-radius: 12px;
317-
background: var(--surface-subtle);
318-
box-shadow: var(--shadow-xs);
338+
border-radius: 10px;
339+
background: #ffffff;
319340
}
320341

321342
@media (min-width: 640px) {
@@ -325,23 +346,63 @@
325346
}
326347

327348
.meta-label {
328-
font-size: 12px;
329-
color: var(--text-muted);
349+
font-size: 11px;
350+
color: var(--policy-muted);
351+
text-transform: uppercase;
352+
letter-spacing: .25px;
353+
font-weight: 700;
354+
line-height: 1;
355+
white-space: nowrap;
356+
overflow: hidden;
357+
text-overflow: ellipsis;
330358
}
331359

332360
.meta-value {
333-
font-weight: 600;
334-
font-size: 12px;
335-
padding-top: 5px;
336-
color: var(--text-strong);
361+
font-size: 14px;
362+
font-weight: 500;
363+
color: var(--policy-text);
364+
min-width: 0;
365+
overflow: hidden;
366+
text-overflow: ellipsis;
367+
white-space: nowrap;
368+
padding-top: 4px
337369
}
338370

339371
.meta-badge.status--active {
340372
font-size: 11px;
373+
margin-top: 4px;
374+
font-weight: 700;
375+
display: inline-flex;
376+
align-items: center;
377+
padding: 2px 8px;
378+
border-radius: 999px;
379+
line-height: 1.4;
380+
background: #ecfdf5;
381+
color: #047857;
382+
border: 1px solid #d1fae5;
341383
}
342384
.policy-description{
343-
line-height: 1.75;
344-
padding-top: 10px;
385+
color: var(--policy-text);
386+
font-size: 15px;
387+
line-height: 1.7;
388+
margin: 0;
389+
white-space: pre-wrap;
390+
}
391+
392+
/* Footer to match Announcement dialog */
393+
.policy-dialog .e-dlg-footer-content {
394+
padding: 12px 20px;
395+
border-top: 1px solid var(--border);
396+
background: #fff;
397+
}
398+
.policy-dialog__footer {
399+
width: 100%;
400+
display: flex;
401+
justify-content: flex-end;
402+
gap: 10px;
403+
}
404+
@media (max-width: 520px) {
405+
.policy-dialog__footer { flex-direction: column-reverse; align-items: stretch; }
345406
}
346407
.meta-badge.status--review {
347408
color: #92400e;

Employee_Managment_App/src/components/Policies.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
CommandModel,
1414
CommandClickEventArgs
1515
} from '@syncfusion/ej2-react-grids';
16-
import { DialogComponent } from '@syncfusion/ej2-react-popups';
16+
import { DialogComponent, AnimationSettingsModel } from '@syncfusion/ej2-react-popups';
1717
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
1818
import './Policies.css';
1919

@@ -97,6 +97,12 @@ const Policies: React.FC = () => {
9797
setActiveCategory('All');
9898
};
9999

100+
// Dialog animation
101+
const dialogAnimation: AnimationSettingsModel = { effect: 'Zoom', duration: 140 };
102+
// ref to trigger built-in hide animation before unmounting
103+
const dialogRef = React.useRef<DialogComponent | null>(null);
104+
const hideWithAnimation = () => dialogRef.current?.hide();
105+
100106
return (
101107
<div className="policiespage policiespage--green">
102108
<div className="policies-content policies-grid-wrapper">
@@ -164,7 +170,7 @@ const Policies: React.FC = () => {
164170
<ColumnDirective field="category" headerText="Category" width="170" template={categoryTemplate} />
165171
<ColumnDirective field="lastUpdated" headerText="Last Updated" width="150" type="date" format="d MMM yyyy" textAlign="Right" />
166172
<ColumnDirective field="enrolledOn" headerText="Enrolled On" width="150" type="date" format="d MMM yyyy" textAlign="Right" />
167-
<ColumnDirective field="statusText" headerText="Status" width="130" template={statusTemplate} />
173+
<ColumnDirective field="statusText" headerText="Status" width="130" template={statusTemplate} textAlign="Center" />
168174
<ColumnDirective headerText="Actions" width="110" commands={viewCommands} textAlign="Center" />
169175
</ColumnsDirective>
170176
<Inject services={[Page, Sort, Toolbar, Resize, CommandColumn]} />
@@ -173,15 +179,19 @@ const Policies: React.FC = () => {
173179
</div>
174180

175181
<DialogComponent
182+
ref={dialogRef}
176183
visible={open}
177184
isModal
178185
showCloseIcon
186+
closeOnEscape
187+
width="min(92vw, 720px)"
188+
height="auto"
179189
header={selected ? selected.policyName : 'Policy Details'}
180-
width="600px"
181190
target=".policies-grid-wrapper"
182-
cssClass="policy-dialog"
191+
cssClass="policy-dialog no-gradient"
183192
close={onDialogClose}
184-
animationSettings={{ duration: 0 }}
193+
overlayClick={hideWithAnimation}
194+
animationSettings={dialogAnimation}
185195
>
186196
{selected && (
187197
<div className="policy-dialog__content">
@@ -210,7 +220,7 @@ const Policies: React.FC = () => {
210220
</div>
211221

212222
<div className="policy-dialog__footer">
213-
<ButtonComponent cssClass="e-primary" onClick={onDialogClose} type="button">Close</ButtonComponent>
223+
<ButtonComponent cssClass="e-primary" onClick={hideWithAnimation} type="button">Close</ButtonComponent>
214224
</div>
215225
</div>
216226
)}

0 commit comments

Comments
 (0)