Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
}
.annc-dlg-details_value {
font-size: 14px;
font-weight: 500;
color: var(--annc-text);
min-width: 0;
overflow: hidden;
Expand Down
105 changes: 86 additions & 19 deletions Employee_Managment_App/src/components/Policies.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
--text-strong: #0f172a;
--text-muted: #667085;
--text-soft: #475467;
--policy-text: #0f172a;


--surface: #ffffff;
Expand All @@ -31,6 +32,8 @@

--color-sf-primary-bg-color: #1ab394;
--color-sf-primary-border-color: #1ab394;

--policy-muted: #64748b;
}

.policies-grid-wrapper {
Expand Down Expand Up @@ -64,7 +67,6 @@
grid-template-columns: 1fr;
/* collapse to single column */
gap: 0;
margin: 0 0 14px;
padding: 0;
/* remove unmarked padding/border/shadow */
border: 0;
Expand Down Expand Up @@ -98,7 +100,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin: 12px 0 12px;
margin: 12px 0 8px;
}

.section-title {
Expand All @@ -108,6 +110,15 @@
font-family: 'Roboto', sans-serif;
}

.policy-dialog-title {
font-size: 12px;
color: var(--policy-muted);
text-transform: uppercase;
letter-spacing: .3px;
font-weight: 800;
margin-bottom: 8px;
}

.view-all-link {
color: var(--primary-700);
text-decoration: none;
Expand Down Expand Up @@ -284,27 +295,44 @@
opacity: .95;
}

/* Dialog */
/* Dialog – match Announcement dialog styles exactly where different */
.no-gradient,
.no-gradient * { background-image: none !important; }

.policy-dialog.e-dialog {
border-radius: 12px;
background: #ffffff;
box-shadow: var(--shadow-md);
overflow: hidden;
}

.policy-dialog .e-dlg-header-content {
border-bottom: 1px solid var(--border);
padding: 14px 18px;
padding: 16px 20px;
background: #fff;
}

.policy-dialog .e-dlg-header {
font-weight: 900;
color: var(--primary-800);
color: var(--policy-text);
font-weight: 800;
font-size: 18px;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.policy-dialog .e-dlg-content {
padding: 0;
background: #fff;
max-height: min(72vh, 560px);
overflow: auto;
}

.policy-dialog__content {
display: grid;
gap: 20px;
padding: 18px 20px 20px;
gap: 16px;
padding: 16px 20px 14px 20px;
}

.policy-dialog__meta {
Expand All @@ -313,9 +341,8 @@
gap: 12px 16px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--surface-subtle);
box-shadow: var(--shadow-xs);
border-radius: 10px;
background: #ffffff;
}

@media (min-width: 640px) {
Expand All @@ -325,23 +352,63 @@
}

.meta-label {
font-size: 12px;
color: var(--text-muted);
font-size: 11px;
color: var(--policy-muted);
text-transform: uppercase;
letter-spacing: .25px;
font-weight: 700;
line-height: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.meta-value {
font-weight: 600;
font-size: 12px;
padding-top: 5px;
color: var(--text-strong);
font-size: 14px;
font-weight: 500;
color: var(--policy-text);
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-top: 4px
}

.meta-badge.status--active {
font-size: 11px;
margin-top: 4px;
font-weight: 700;
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
line-height: 1.4;
background: #ecfdf5;
color: #047857;
border: 1px solid #d1fae5;
}
.policy-description{
line-height: 1.75;
padding-top: 10px;
color: var(--policy-text);
font-size: 15px;
line-height: 1.7;
margin: 0;
white-space: pre-wrap;
}

/* Footer to match Announcement dialog */
.policy-dialog .e-dlg-footer-content {
padding: 12px 20px;
border-top: 1px solid var(--border);
background: #fff;
}
.policy-dialog__footer {
width: 100%;
display: flex;
justify-content: flex-end;
gap: 10px;
}
@media (max-width: 520px) {
.policy-dialog__footer { flex-direction: column-reverse; align-items: stretch; }
}
.meta-badge.status--review {
color: #92400e;
Expand Down
24 changes: 17 additions & 7 deletions Employee_Managment_App/src/components/Policies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
CommandModel,
CommandClickEventArgs
} from '@syncfusion/ej2-react-grids';
import { DialogComponent } from '@syncfusion/ej2-react-popups';
import { DialogComponent, AnimationSettingsModel } from '@syncfusion/ej2-react-popups';
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import './Policies.css';

Expand Down Expand Up @@ -97,6 +97,12 @@ const Policies: React.FC = () => {
setActiveCategory('All');
};

// Dialog animation
const dialogAnimation: AnimationSettingsModel = { effect: 'Zoom', duration: 140 };
// ref to trigger built-in hide animation before unmounting
const dialogRef = React.useRef<DialogComponent | null>(null);
const hideWithAnimation = () => dialogRef.current?.hide();

return (
<div className="policiespage policiespage--green">
<div className="policies-content policies-grid-wrapper">
Expand Down Expand Up @@ -164,7 +170,7 @@ const Policies: React.FC = () => {
<ColumnDirective field="category" headerText="Category" width="170" template={categoryTemplate} />
<ColumnDirective field="lastUpdated" headerText="Last Updated" width="150" type="date" format="d MMM yyyy" textAlign="Right" />
<ColumnDirective field="enrolledOn" headerText="Enrolled On" width="150" type="date" format="d MMM yyyy" textAlign="Right" />
<ColumnDirective field="statusText" headerText="Status" width="130" template={statusTemplate} />
<ColumnDirective field="statusText" headerText="Status" width="130" template={statusTemplate} textAlign="Center" />
<ColumnDirective headerText="Actions" width="110" commands={viewCommands} textAlign="Center" />
</ColumnsDirective>
<Inject services={[Page, Sort, Toolbar, Resize, CommandColumn]} />
Expand All @@ -173,15 +179,19 @@ const Policies: React.FC = () => {
</div>

<DialogComponent
ref={dialogRef}
visible={open}
isModal
showCloseIcon
closeOnEscape
width="min(92vw, 720px)"
height="auto"
header={selected ? selected.policyName : 'Policy Details'}
width="600px"
target=".policies-grid-wrapper"
cssClass="policy-dialog"
cssClass="policy-dialog no-gradient"
close={onDialogClose}
animationSettings={{ duration: 0 }}
overlayClick={hideWithAnimation}
animationSettings={dialogAnimation}
>
{selected && (
<div className="policy-dialog__content">
Expand All @@ -205,12 +215,12 @@ const Policies: React.FC = () => {
</div>

<div className="policy-dialog__section">
<div className="section-title">Description:</div>
<div className="policy-dialog-title">Description:</div>
<p className="policy-description">{selected.policyDesciption}</p>
</div>

<div className="policy-dialog__footer">
<ButtonComponent cssClass="e-primary" onClick={onDialogClose} type="button">Close</ButtonComponent>
<ButtonComponent cssClass="e-primary" onClick={hideWithAnimation} type="button">Close</ButtonComponent>
</div>
</div>
)}
Expand Down