Skip to content

Commit bcdd1ab

Browse files
authored
Merge pull request #42 from SyncfusionExamples/EJ2-1000395-Issuefix
1000395: Fixing issues in Employee Management
2 parents f570ff8 + 0ef423d commit bcdd1ab

File tree

3 files changed

+104
-26
lines changed

3 files changed

+104
-26
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: 86 additions & 19 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 {
@@ -64,7 +67,6 @@
6467
grid-template-columns: 1fr;
6568
/* collapse to single column */
6669
gap: 0;
67-
margin: 0 0 14px;
6870
padding: 0;
6971
/* remove unmarked padding/border/shadow */
7072
border: 0;
@@ -98,7 +100,7 @@
98100
display: flex;
99101
align-items: center;
100102
justify-content: space-between;
101-
margin: 12px 0 12px;
103+
margin: 12px 0 8px;
102104
}
103105

104106
.section-title {
@@ -108,6 +110,15 @@
108110
font-family: 'Roboto', sans-serif;
109111
}
110112

113+
.policy-dialog-title {
114+
font-size: 12px;
115+
color: var(--policy-muted);
116+
text-transform: uppercase;
117+
letter-spacing: .3px;
118+
font-weight: 800;
119+
margin-bottom: 8px;
120+
}
121+
111122
.view-all-link {
112123
color: var(--primary-700);
113124
text-decoration: none;
@@ -284,27 +295,44 @@
284295
opacity: .95;
285296
}
286297

287-
/* Dialog */
298+
/* Dialog – match Announcement dialog styles exactly where different */
299+
.no-gradient,
300+
.no-gradient * { background-image: none !important; }
301+
302+
.policy-dialog.e-dialog {
303+
border-radius: 12px;
304+
background: #ffffff;
305+
box-shadow: var(--shadow-md);
306+
overflow: hidden;
307+
}
308+
288309
.policy-dialog .e-dlg-header-content {
289310
border-bottom: 1px solid var(--border);
290-
padding: 14px 18px;
311+
padding: 16px 20px;
291312
background: #fff;
292313
}
293314

294315
.policy-dialog .e-dlg-header {
295-
font-weight: 900;
296-
color: var(--primary-800);
316+
color: var(--policy-text);
317+
font-weight: 800;
318+
font-size: 18px;
319+
line-height: 1.3;
320+
overflow: hidden;
321+
text-overflow: ellipsis;
322+
white-space: nowrap;
297323
}
298324

299325
.policy-dialog .e-dlg-content {
300326
padding: 0;
301327
background: #fff;
328+
max-height: min(72vh, 560px);
329+
overflow: auto;
302330
}
303331

304332
.policy-dialog__content {
305333
display: grid;
306-
gap: 20px;
307-
padding: 18px 20px 20px;
334+
gap: 16px;
335+
padding: 16px 20px 14px 20px;
308336
}
309337

310338
.policy-dialog__meta {
@@ -313,9 +341,8 @@
313341
gap: 12px 16px;
314342
padding: 12px;
315343
border: 1px solid var(--border);
316-
border-radius: 12px;
317-
background: var(--surface-subtle);
318-
box-shadow: var(--shadow-xs);
344+
border-radius: 10px;
345+
background: #ffffff;
319346
}
320347

321348
@media (min-width: 640px) {
@@ -325,23 +352,63 @@
325352
}
326353

327354
.meta-label {
328-
font-size: 12px;
329-
color: var(--text-muted);
355+
font-size: 11px;
356+
color: var(--policy-muted);
357+
text-transform: uppercase;
358+
letter-spacing: .25px;
359+
font-weight: 700;
360+
line-height: 1;
361+
white-space: nowrap;
362+
overflow: hidden;
363+
text-overflow: ellipsis;
330364
}
331365

332366
.meta-value {
333-
font-weight: 600;
334-
font-size: 12px;
335-
padding-top: 5px;
336-
color: var(--text-strong);
367+
font-size: 14px;
368+
font-weight: 500;
369+
color: var(--policy-text);
370+
min-width: 0;
371+
overflow: hidden;
372+
text-overflow: ellipsis;
373+
white-space: nowrap;
374+
padding-top: 4px
337375
}
338376

339377
.meta-badge.status--active {
340378
font-size: 11px;
379+
margin-top: 4px;
380+
font-weight: 700;
381+
display: inline-flex;
382+
align-items: center;
383+
padding: 2px 8px;
384+
border-radius: 999px;
385+
line-height: 1.4;
386+
background: #ecfdf5;
387+
color: #047857;
388+
border: 1px solid #d1fae5;
341389
}
342390
.policy-description{
343-
line-height: 1.75;
344-
padding-top: 10px;
391+
color: var(--policy-text);
392+
font-size: 15px;
393+
line-height: 1.7;
394+
margin: 0;
395+
white-space: pre-wrap;
396+
}
397+
398+
/* Footer to match Announcement dialog */
399+
.policy-dialog .e-dlg-footer-content {
400+
padding: 12px 20px;
401+
border-top: 1px solid var(--border);
402+
background: #fff;
403+
}
404+
.policy-dialog__footer {
405+
width: 100%;
406+
display: flex;
407+
justify-content: flex-end;
408+
gap: 10px;
409+
}
410+
@media (max-width: 520px) {
411+
.policy-dialog__footer { flex-direction: column-reverse; align-items: stretch; }
345412
}
346413
.meta-badge.status--review {
347414
color: #92400e;

Employee_Managment_App/src/components/Policies.tsx

Lines changed: 17 additions & 7 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">
@@ -205,12 +215,12 @@ const Policies: React.FC = () => {
205215
</div>
206216

207217
<div className="policy-dialog__section">
208-
<div className="section-title">Description:</div>
218+
<div className="policy-dialog-title">Description:</div>
209219
<p className="policy-description">{selected.policyDesciption}</p>
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)