New Dashboard
This commit is contained in:
parent
16f6a635fd
commit
46ab998ab7
|
|
@ -20,6 +20,9 @@ export class EssService {
|
|||
getAllPUR() {
|
||||
return this.apiService.httpGet<ProfileUpdateRequest[]>('/Ess/getAllPUR');
|
||||
}
|
||||
getUserProfile() {
|
||||
return this.apiService.httpGet<any>('/Ess/getUserProfile');
|
||||
}
|
||||
savePUR(param: any) {
|
||||
return this.apiService.httpPost<any>('/Ess/savePUR', param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,342 @@
|
|||
<app-loading-panel></app-loading-panel>
|
||||
@if (apiService.isSelService === true) {
|
||||
<div>
|
||||
<app-background-canvas></app-background-canvas>
|
||||
</div>
|
||||
}
|
||||
<div class="up-page" [ngClass]="{'customGrid': apiService.isSelService === true}">
|
||||
|
||||
<!-- ── Profile Hero ── -->
|
||||
<div class="up-hero">
|
||||
<div class="up-hero-left">
|
||||
<img class="up-photo" [src]="empPhoto" alt="Profile photo" (error)="onOwnPhotoError()" />
|
||||
<div class="up-hero-info">
|
||||
<div class="up-hero-name-row">
|
||||
<span class="up-hero-name">{{empName}}</span>
|
||||
<span class="up-hero-status-badge">{{empStatus}}</span>
|
||||
</div>
|
||||
<span class="up-hero-designation">{{empDesignation}} · {{empDepartment}}</span>
|
||||
<span class="up-hero-location">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none">
|
||||
<path d="M6.5 1.5a3.5 3.5 0 013.5 3.5c0 2.5-3.5 7-3.5 7S3 7.5 3 5a3.5 3.5 0 013.5-3.5z"
|
||||
stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<circle cx="6.5" cy="5" r="1.3" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
{{empLocation}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="up-hero-right">
|
||||
<button class="up-global-eye-btn" [class.up-global-eye-active]="showAllAmounts" (click)="toggleAllAmounts($event)" title="Toggle sensitive data">
|
||||
<svg *ngIf="!showAllAmounts" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
|
||||
<line x1="1" y1="1" x2="23" y2="23"></line>
|
||||
</svg>
|
||||
<svg *ngIf="showAllAmounts" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
||||
<circle cx="12" cy="12" r="3"></circle>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- Switch User Button — only when switchUserId is set (same as Payroll Home) -->
|
||||
<button class="ph-btn-download" *ngIf="switchUserId" (click)="switchUser()">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M16 3l4 4-4 4"/>
|
||||
<path d="M20 7H4"/>
|
||||
<path d="M8 21l-4-4 4-4"/>
|
||||
<path d="M4 17h16"/>
|
||||
</svg>
|
||||
Switch
|
||||
</button>
|
||||
<button class="up-btn-edit">
|
||||
<svg width="15" height="15" viewBox="0 0 15 15" fill="none">
|
||||
<path d="M10.5 1.5l3 3-8.5 8.5L2 13.5l.5-3 8-9z"
|
||||
stroke="#045AEA" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Edit Profile
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── Personal Information ── -->
|
||||
<div class="up-section">
|
||||
<div class="up-section-header">
|
||||
<div class="up-section-title-row">
|
||||
<div class="up-section-icon-wrap">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||
<circle cx="9" cy="6" r="3" stroke="#045AEA" stroke-width="1.5"/>
|
||||
<path d="M3 16c0-3.314 2.686-6 6-6s6 2.686 6 6"
|
||||
stroke="#045AEA" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="up-section-title">Personal Information</span>
|
||||
</div>
|
||||
<span class="up-view-all">
|
||||
View All
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M3 7h8M7.5 3.5 11 7l-3.5 3.5"
|
||||
stroke="#045AEA" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-fields-grid up-grid-4">
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Employee ID</span>
|
||||
<span class="up-field-value">{{employeeId}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Full Name</span>
|
||||
<span class="up-field-value">{{fullName}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Date of Birth</span>
|
||||
<span class="up-field-value">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" style="flex-shrink:0">
|
||||
<rect x="1" y="2.5" width="12" height="10" rx="1.5" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<path d="M4 1v3M10 1v3" stroke="#9CA3AF" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M1 6h12" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
{{dateOfBirth}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Gender</span>
|
||||
<span class="up-field-value">{{gender}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Status</span>
|
||||
<span class="up-field-value">
|
||||
<span class="up-active-badge">{{statusLabel}}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field" style="display:none">
|
||||
<span class="up-field-label">National ID</span>
|
||||
<span class="up-field-value">
|
||||
{{(showAllAmounts || showNationalId) ? nationalIdFull : nationalIdMasked}}
|
||||
<svg class="up-eye" (click)="toggleNationalId($event)" width="16" height="16" viewBox="0 0 18 18" fill="none">
|
||||
<path d="M1.5 9s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6S1.5 9 1.5 9z"
|
||||
stroke="#9CA3AF" stroke-width="1.3" stroke-linecap="round"/>
|
||||
<circle cx="9" cy="9" r="2.25" stroke="#9CA3AF" stroke-width="1.3"/>
|
||||
<path *ngIf="showNationalId" d="M2.5 15.5L15.5 2.5"
|
||||
stroke="#9CA3AF" stroke-width="1.3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">TIN</span>
|
||||
<span class="up-field-value">
|
||||
{{(showAllAmounts || showTin) ? tinFull : tinMasked}}
|
||||
<svg class="up-eye" (click)="toggleTin($event)" width="16" height="16" viewBox="0 0 18 18" fill="none">
|
||||
<path d="M1.5 9s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6S1.5 9 1.5 9z"
|
||||
stroke="#9CA3AF" stroke-width="1.3" stroke-linecap="round"/>
|
||||
<circle cx="9" cy="9" r="2.25" stroke="#9CA3AF" stroke-width="1.3"/>
|
||||
<path *ngIf="showTin" d="M2.5 15.5L15.5 2.5"
|
||||
stroke="#9CA3AF" stroke-width="1.3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── Employment Details ── -->
|
||||
<div class="up-section">
|
||||
<div class="up-section-header">
|
||||
<div class="up-section-title-row">
|
||||
<div class="up-section-icon-wrap">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||
<rect x="2" y="6" width="14" height="10" rx="2" stroke="#045AEA" stroke-width="1.5"/>
|
||||
<path d="M6 6V4a2 2 0 012-2h2a2 2 0 012 2v2" stroke="#045AEA" stroke-width="1.5"/>
|
||||
<path d="M2 10h14" stroke="#045AEA" stroke-width="1.5"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="up-section-title">Employment Details</span>
|
||||
</div>
|
||||
<span class="up-view-all">
|
||||
View All
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M3 7h8M7.5 3.5 11 7l-3.5 3.5"
|
||||
stroke="#045AEA" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-fields-grid up-grid-4">
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Division</span>
|
||||
<span class="up-field-value">{{division}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Department</span>
|
||||
<span class="up-field-value">{{department}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Designation</span>
|
||||
<span class="up-field-value">{{designation}}</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Grade</span>
|
||||
<span class="up-field-value">
|
||||
<span class="up-grade-badge">{{grade}}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Joining Date</span>
|
||||
<span class="up-field-value">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" style="flex-shrink:0">
|
||||
<rect x="1" y="2.5" width="12" height="10" rx="1.5" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<path d="M4 1v3M10 1v3" stroke="#9CA3AF" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M1 6h12" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
{{joiningDate}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Years of Service</span>
|
||||
<span class="up-field-value">{{yearsOfService}}</span>
|
||||
</div>
|
||||
|
||||
<!-- <div class="up-field">
|
||||
<span class="up-field-label">Manager</span>
|
||||
<span class="up-field-value">{{manager}}</span>
|
||||
</div> -->
|
||||
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Location</span>
|
||||
<span class="up-field-value">{{workLocation}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── Contact Information ── -->
|
||||
<div class="up-section">
|
||||
<div class="up-section-header">
|
||||
<div class="up-section-title-row">
|
||||
<div class="up-section-icon-wrap">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||
<path d="M3.5 3h3.5l1.5 3.5-1.5 1a8 8 0 003.5 3.5l1-1.5 3.5 1.5v3.5a1 1 0 01-1 1A13 13 0 012.5 4a1 1 0 011-1z"
|
||||
stroke="#045AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="up-section-title">Contact Information</span>
|
||||
</div>
|
||||
<span class="up-view-all">
|
||||
View All
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M3 7h8M7.5 3.5 11 7l-3.5 3.5"
|
||||
stroke="#045AEA" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="up-fields-grid up-grid-2">
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Work Email</span>
|
||||
<span class="up-field-value">
|
||||
{{workEmail}}
|
||||
<svg class="up-copy-btn" (click)="copy(workEmail)" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<rect x="4.5" y="4.5" width="8" height="8" rx="1.5" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<path d="M9.5 4.5V3A1.5 1.5 0 008 1.5H3A1.5 1.5 0 001.5 3v5A1.5 1.5 0 003 9.5h1.5"
|
||||
stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="up-field" style="display: none;">
|
||||
<span class="up-field-label">Personal Email</span>
|
||||
<span class="up-field-value">
|
||||
{{personalEmail}}
|
||||
<svg class="up-copy-btn" (click)="copy(personalEmail)" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<rect x="4.5" y="4.5" width="8" height="8" rx="1.5" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<path d="M9.5 4.5V3A1.5 1.5 0 008 1.5H3A1.5 1.5 0 001.5 3v5A1.5 1.5 0 003 9.5h1.5"
|
||||
stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<span class="up-field-label">Mobile</span>
|
||||
<span class="up-field-value">
|
||||
{{mobile}}
|
||||
<svg class="up-copy-btn" (click)="copy(mobile)" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<rect x="4.5" y="4.5" width="8" height="8" rx="1.5" stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
<path d="M9.5 4.5V3A1.5 1.5 0 008 1.5H3A1.5 1.5 0 001.5 3v5A1.5 1.5 0 003 9.5h1.5"
|
||||
stroke="#9CA3AF" stroke-width="1.2"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="up-field" style="display: none;">
|
||||
<span class="up-field-label">Address</span>
|
||||
<span class="up-field-value">{{address}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ── Switch User Dialog (Kendo Dialog, same as user-ss-dashboard; design unchanged) ── -->
|
||||
@if (showModal) {
|
||||
<div class="blur-background">
|
||||
<kendo-dialog class="ph-switch-dialog" (close)="onPopUpClose()" [width]="620" (keydown.escape)="$event.stopPropagation()">
|
||||
<div class="ph-modal-card">
|
||||
<div class="ph-modal-header">
|
||||
<div class="ph-modal-header-left">
|
||||
<div class="ph-modal-icon-wrap">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#045AEA" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M16 3l4 4-4 4"/>
|
||||
<path d="M20 7H4"/>
|
||||
<path d="M8 21l-4-4 4-4"/>
|
||||
<path d="M4 17h16"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="ph-modal-title">Switch to Admin</h2>
|
||||
<p class="ph-modal-subtitle">Select a payroll type to continue</p>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ph-modal-close" (click)="onPopUpClose()">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#6B7280" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ph-modal-body">
|
||||
<p class="ph-modal-hint">Select a payroll type to switch to Admin mode.</p>
|
||||
<div class="ph-type-list">
|
||||
@for (type of payrollTypes; track type) {
|
||||
<div class="ph-type-item" (click)="selectAccessType(type.id)">
|
||||
<div class="ph-type-icon-wrap">
|
||||
<img class="ph-type-img" [src]="getImagePath(type.id)" alt="{{ type.description }}" />
|
||||
</div>
|
||||
<div class="ph-type-info">
|
||||
<span class="ph-type-name">{{ type.description }}</span>
|
||||
<span class="ph-type-sub">Admin Mode</span>
|
||||
</div>
|
||||
<div class="ph-type-arrow">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#045AEA" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="9 18 15 12 9 6"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ph-modal-footer">
|
||||
<button class="ph-modal-cancel-btn" (click)="onPopUpClose()">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</kendo-dialog>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -0,0 +1,530 @@
|
|||
/* Same as user-ss-dashboard: no layout padding around the page */
|
||||
:host ::ng-deep .layout-wrapper .layout-main .layout-content {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
/* ── Page wrapper ── */
|
||||
.up-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
/* Keep the page above the absolutely positioned background canvas */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Same width as user-ss-dashboard */
|
||||
.customGrid {
|
||||
margin: 0 80px;
|
||||
transition: margin 0.4s ease;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.customGrid { margin: 0; }
|
||||
}
|
||||
|
||||
/* ── Profile Hero ── */
|
||||
.up-hero {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20px 20px;
|
||||
border: 1px solid #D4E4F7;
|
||||
border-radius: 14px;
|
||||
background:
|
||||
radial-gradient(ellipse 70% 150% at 0% 50%, rgba(219, 234, 254, 0.60) 0%, rgba(219, 234, 254, 0) 100%),
|
||||
radial-gradient(ellipse 55% 150% at 100% 50%, rgba(191, 219, 254, 0.45) 0%, rgba(191, 219, 254, 0) 100%),
|
||||
linear-gradient(to right, #EEF6FF 0%, #F8FBFF 45%, #FFFFFF 70%, #F8FBFF 100%);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.up-hero-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.up-photo {
|
||||
width: 82px;
|
||||
height: 82px;
|
||||
border-radius: 12px;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
border: 1.5px solid #DBEAFE;
|
||||
}
|
||||
|
||||
.up-hero-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.up-hero-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.up-hero-name {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #0A0A0A;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.up-hero-status-badge {
|
||||
background: #DCFCE7;
|
||||
color: #16A34A;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 2px 10px;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
.up-hero-designation {
|
||||
font-size: 14px;
|
||||
color: #6B7280;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.up-hero-location {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
color: #9CA3AF;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* Hero right group */
|
||||
.up-hero-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Global eye button */
|
||||
.up-global-eye-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 12px;
|
||||
border: 1.5px solid #BFDBFE;
|
||||
border-radius: 20px;
|
||||
background: #EFF6FF;
|
||||
cursor: pointer;
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
color: #2563EB;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.up-global-eye-btn:hover {
|
||||
background: #DBEAFE;
|
||||
border-color: #93C5FD;
|
||||
}
|
||||
|
||||
.up-global-eye-btn.up-global-eye-active {
|
||||
background: #2563EB;
|
||||
border-color: #2563EB;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Edit Profile button */
|
||||
.up-btn-edit {
|
||||
display: none;
|
||||
/* display: inline-flex; */
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
height: 40px;
|
||||
padding: 0 18px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 1px solid #BFDBFE;
|
||||
border-radius: 10px;
|
||||
color: #045AEA;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
font-family: 'Inter', -apple-system, sans-serif;
|
||||
}
|
||||
.up-btn-edit:hover {
|
||||
background: rgba(239, 246, 255, 0.95);
|
||||
border-color: #93C5FD;
|
||||
}
|
||||
|
||||
/* ── Section cards ── */
|
||||
.up-section {
|
||||
background: #ffffff;
|
||||
border: 1px solid #EEF1F5;
|
||||
border-radius: 14px;
|
||||
padding: 20px 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.up-section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.up-section-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.up-section-icon-wrap {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 9px;
|
||||
background: #EEF4FF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.up-section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #0A0A0A;
|
||||
}
|
||||
|
||||
.up-view-all {
|
||||
/* display: flex; */
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
color: #045AEA;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
transition: color 0.15s;
|
||||
user-select: none;
|
||||
}
|
||||
.up-view-all:hover { color: #0347c7; }
|
||||
|
||||
/* ── Fields grid ── */
|
||||
.up-fields-grid {
|
||||
display: grid;
|
||||
gap: 22px 20px;
|
||||
}
|
||||
|
||||
.up-grid-4 { grid-template-columns: repeat(4, 1fr); }
|
||||
.up-grid-2 { grid-template-columns: repeat(2, 1fr); }
|
||||
|
||||
.up-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.up-field-label {
|
||||
font-size: 12px;
|
||||
color: #9CA3AF;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.up-field-value {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #0A0A0A;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
/* Active status badge */
|
||||
.up-active-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
background: #DCFCE7;
|
||||
color: #16A34A;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 3px 10px;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
/* Grade badge */
|
||||
.up-grade-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
background: #D1FAE5;
|
||||
color: #065F46;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
padding: 3px 10px;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
/* Eye toggle */
|
||||
.up-eye {
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
opacity: 0.65;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.up-eye:hover { opacity: 1; }
|
||||
|
||||
/* Copy button */
|
||||
.up-copy-btn {
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
opacity: 0.45;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.up-copy-btn:hover { opacity: 0.9; }
|
||||
|
||||
/* ── Responsive ── */
|
||||
@media (max-width: 1100px) {
|
||||
.up-page { padding: 20px 24px 28px; }
|
||||
.up-grid-4 { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.up-page { padding: 16px 16px 24px; }
|
||||
.up-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
|
||||
.up-btn-edit { width: 100%; justify-content: center; }
|
||||
.up-grid-4 { grid-template-columns: repeat(2, 1fr); }
|
||||
.up-grid-2 { grid-template-columns: 1fr; }
|
||||
.up-hero-name { font-size: 18px; }
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.up-section { padding: 18px 16px; }
|
||||
.up-grid-4 { grid-template-columns: 1fr; }
|
||||
.up-hero { padding: 18px 16px; }
|
||||
}
|
||||
|
||||
/* ── Switch button + Switch User modal (from Payroll Home) ── */
|
||||
.ph-btn-download {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: linear-gradient(135deg, #045AEA, #3B82F6);
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
padding: 0 20px;
|
||||
height: 40px;
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.ph-btn-download:hover { opacity: 0.88; }
|
||||
|
||||
/* Kendo Dialog shell: strip its own frame so the card below keeps the same design */
|
||||
:host ::ng-deep .ph-switch-dialog .k-window,
|
||||
:host ::ng-deep .ph-switch-dialog .k-dialog {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
border-radius: 20px;
|
||||
max-width: calc(100vw - 32px);
|
||||
}
|
||||
:host ::ng-deep .ph-switch-dialog .k-window-content,
|
||||
:host ::ng-deep .ph-switch-dialog .k-dialog-content {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.ph-modal-card {
|
||||
background: #ffffff;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 24px 60px rgba(4, 90, 234, 0.15), 0 4px 16px rgba(0,0,0,0.1);
|
||||
width: 100%;
|
||||
max-width: 620px;
|
||||
overflow: hidden;
|
||||
animation: ph-slide-up 0.2s ease;
|
||||
}
|
||||
|
||||
@keyframes ph-slide-up {
|
||||
from { transform: translateY(24px); opacity: 0; }
|
||||
to { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Modal Header */
|
||||
.ph-modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 22px 24px 20px;
|
||||
border-bottom: 1px solid #F1F5F9;
|
||||
}
|
||||
|
||||
.ph-modal-header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.ph-modal-icon-wrap {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
background: #EEF4FF;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ph-modal-title {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: #0A0A0A;
|
||||
margin: 0 0 2px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.ph-modal-subtitle {
|
||||
font-size: 13px;
|
||||
color: #6B7280;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ph-modal-close {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: none;
|
||||
background: #F3F4F6;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
.ph-modal-close:hover { background: #E5E7EB; }
|
||||
|
||||
/* Modal Body */
|
||||
.ph-modal-body {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
.ph-modal-hint {
|
||||
font-size: 13px;
|
||||
color: #6B7280;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
/* Two payroll types side by side; a single one takes the full width */
|
||||
.ph-type-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.ph-type-item:only-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.ph-type-list { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* Payroll type image (same images as user-ss-dashboard) */
|
||||
.ph-type-img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.ph-type-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
padding: 16px 18px;
|
||||
border: 1.5px solid #E5E7EB;
|
||||
border-radius: 14px;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.ph-type-item:hover {
|
||||
border-color: #045AEA;
|
||||
background: #F0F6FF;
|
||||
box-shadow: 0 2px 10px rgba(4, 90, 234, 0.10);
|
||||
}
|
||||
|
||||
.ph-type-icon-wrap {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: #EEF4FF;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.ph-type-item:hover .ph-type-icon-wrap {
|
||||
background: #DBEAFE;
|
||||
}
|
||||
|
||||
.ph-type-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ph-type-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ph-type-sub {
|
||||
font-size: 12px;
|
||||
color: #9CA3AF;
|
||||
}
|
||||
|
||||
.ph-type-arrow {
|
||||
flex-shrink: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s, transform 0.15s;
|
||||
}
|
||||
|
||||
.ph-type-item:hover .ph-type-arrow {
|
||||
opacity: 1;
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
/* Modal Footer */
|
||||
.ph-modal-footer {
|
||||
padding: 16px 24px 22px;
|
||||
border-top: 1px solid #F1F5F9;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.ph-modal-cancel-btn {
|
||||
padding: 10px 28px;
|
||||
border: 1.5px solid #D1D5DB;
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
color: #374151;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
}
|
||||
.ph-modal-cancel-btn:hover { background: #F9FAFB; border-color: #9CA3AF; }
|
||||
|
|
@ -0,0 +1,345 @@
|
|||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { JwtHelperService } from '@auth0/angular-jwt';
|
||||
import { HRMNotificationService } from 'src/app/app.notification.service';
|
||||
import { EssService } from 'src/app/_services/ess/ess.service';
|
||||
import { loadingPanelService } from 'src/app/hrm-loding panel/loding.panel.service';
|
||||
import { AuthService } from 'src/app/_services/auth/auth.service';
|
||||
import { ApiService } from 'src/app/app.api.service';
|
||||
import { EnumUserType } from 'src/app/_models/enums';
|
||||
import { PayrollType } from 'src/app/_models/Authentication/payrollType';
|
||||
import { Bookmark } from 'src/app/_models/Basic/bookmark';
|
||||
import { AppMainComponent } from 'src/app/app.main.component';
|
||||
import { AuthGuard } from 'src/app/_guards/auth.guard';
|
||||
|
||||
@Component({
|
||||
selector: 'app-brac-self-service',
|
||||
templateUrl: './brac-self-service.component.html',
|
||||
styleUrls: ['./brac-self-service.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.Eager,
|
||||
standalone: false
|
||||
})
|
||||
export class BRACSelfServiceComponent implements OnInit {
|
||||
|
||||
// Hero
|
||||
empName = '';
|
||||
empStatus = '';
|
||||
empDesignation = '';
|
||||
empDepartment = '';
|
||||
empLocation = '';
|
||||
empPhoto = ApiService.DEFAULT_PHOTO;
|
||||
|
||||
// Personal Information
|
||||
employeeId = '';
|
||||
fullName = '';
|
||||
dateOfBirth = '';
|
||||
gender = '';
|
||||
statusLabel = '';
|
||||
nationalIdMasked = '';
|
||||
nationalIdFull = '';
|
||||
showNationalId = false;
|
||||
tinMasked = '';
|
||||
tinFull = '';
|
||||
showTin = false;
|
||||
|
||||
// Employment Details
|
||||
division = '';
|
||||
department = '';
|
||||
designation = '';
|
||||
grade = '';
|
||||
joiningDate = '';
|
||||
yearsOfService = '';
|
||||
manager = '';
|
||||
workLocation = '';
|
||||
|
||||
// Contact Information
|
||||
workEmail = '';
|
||||
personalEmail = '';
|
||||
mobile = '';
|
||||
address = '';
|
||||
|
||||
showAllAmounts = false;
|
||||
|
||||
// Switch (same as GP_Master hress/payroll-home)
|
||||
switchUserId: number;
|
||||
payrollTypes: PayrollType[] = [];
|
||||
showModal: boolean = false;
|
||||
selectedPayrollTypeID: number;
|
||||
bookmarks: Bookmark[];
|
||||
|
||||
// Payroll type images (same as user-ss-dashboard)
|
||||
public payrollTypesImg = [
|
||||
{ id: 1, imagePath: 'assets/payrolltype-img/payrolltype1.png' },
|
||||
{ id: 2, imagePath: 'assets/payrolltype-img/payrolltype2.png' },
|
||||
{ id: 3, imagePath: 'assets/payrolltype-img/payrolltype3.png' },
|
||||
{ id: 4, imagePath: 'assets/payrolltype-img/payrolltype4.png' },
|
||||
{ id: 5, imagePath: 'assets/payrolltype-img/payrolltype5.png' }
|
||||
];
|
||||
public getImagePath(typeId: number): string {
|
||||
const typeImage = this.payrollTypesImg.find(img => img.id === typeId);
|
||||
return typeImage ? typeImage.imagePath : 'assets/layout/images/Logo.png';
|
||||
}
|
||||
|
||||
constructor(
|
||||
private notify: HRMNotificationService,
|
||||
private essService: EssService,
|
||||
private loadingPanel: loadingPanelService,
|
||||
private authService: AuthService,
|
||||
private apiService: ApiService,
|
||||
public appMain: AppMainComponent,
|
||||
private auth: AuthGuard,
|
||||
public router: Router,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadProfile();
|
||||
}
|
||||
|
||||
private loadProfile(): void {
|
||||
this.loadingPanel.ShowLoadingPanel = true;
|
||||
|
||||
this.essService.getUserProfile().subscribe(
|
||||
(res) => {
|
||||
const b = res?.basic && res.basic.length > 0 ? res.basic[0] : {};
|
||||
const c = res?.contact && res.contact.length > 0 ? res.contact[0] : {};
|
||||
this.mapBasicData(b);
|
||||
this.mapContactData(c);
|
||||
// Same as user-ss-dashboard: a plain URL, so the browser fetches and caches the image itself.
|
||||
this.empPhoto = this.apiService.empPhotoUrl(this.employeeId);
|
||||
},
|
||||
(err) => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
this.notify.showError(err?.error || 'Failed to load profile data');
|
||||
},
|
||||
() => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
this.LoadSwitchUserId();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Backend maps EMPLOYEE.STATUS = 1 to the literal 'Live' (see EmployeeDA.GetSelfServiceBasicData).
|
||||
// Employees know this state as "Active", so present it that way.
|
||||
private displayStatus(raw: string): string {
|
||||
return /^live$/i.test(raw.trim()) ? 'Active' : raw.trim();
|
||||
}
|
||||
|
||||
// Calendar-accurate elapsed time from joining date to today, e.g. "17 years 1 month 25 days".
|
||||
private formatServiceLength(from: Date): string {
|
||||
const now = new Date();
|
||||
let years = now.getFullYear() - from.getFullYear();
|
||||
let months = now.getMonth() - from.getMonth();
|
||||
let days = now.getDate() - from.getDate();
|
||||
|
||||
if (days < 0) {
|
||||
months -= 1;
|
||||
const prevMonthDays = new Date(now.getFullYear(), now.getMonth(), 0).getDate();
|
||||
days += prevMonthDays;
|
||||
}
|
||||
if (months < 0) {
|
||||
years -= 1;
|
||||
months += 12;
|
||||
}
|
||||
|
||||
const parts: string[] = [];
|
||||
if (years > 0) parts.push(years + (years === 1 ? ' year' : ' years'));
|
||||
if (months > 0) parts.push(months + (months === 1 ? ' month' : ' months'));
|
||||
if (days > 0) parts.push(days + (days === 1 ? ' day' : ' days'));
|
||||
return parts.length ? parts.join(' ') : '0 days';
|
||||
}
|
||||
|
||||
private mapBasicData(b: any): void {
|
||||
const str = (v: any): string => (v != null ? String(v).trim() : '');
|
||||
|
||||
this.empName = str(b.fullName);
|
||||
this.empStatus = this.displayStatus(str(b.status));
|
||||
this.empDesignation = str(b.designation);
|
||||
this.empDepartment = str(b.department);
|
||||
this.empLocation = str(b.location);
|
||||
|
||||
this.employeeId = str(b.employeeNo);
|
||||
this.fullName = str(b.fullName);
|
||||
this.gender = str(b.gender);
|
||||
this.statusLabel = this.displayStatus(str(b.status));
|
||||
|
||||
const nid = str(b.nid);
|
||||
this.nationalIdFull = nid;
|
||||
this.nationalIdMasked = nid.length > 4 ? '••••••••' + nid.slice(-4) : (nid ? '••••••••' : '—');
|
||||
|
||||
const tin = str(b.tin);
|
||||
this.tinFull = tin;
|
||||
this.tinMasked = tin.length > 3 ? '•••••••' + tin.slice(-3) : (tin ? '•••••••' : '—');
|
||||
|
||||
if (b.birthDate) {
|
||||
const d = new Date(b.birthDate);
|
||||
if (!isNaN(d.getTime()))
|
||||
this.dateOfBirth = d.toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: 'numeric' });
|
||||
}
|
||||
|
||||
this.division = str(b.division);
|
||||
this.department = str(b.department);
|
||||
this.designation = str(b.designation);
|
||||
this.grade = str(b.grade);
|
||||
const lm = str(b.lineManager);
|
||||
const dash = lm.indexOf('-');
|
||||
this.manager = dash >= 0 ? lm.substring(dash + 1).trim() : lm;
|
||||
this.workLocation = str(b.location);
|
||||
|
||||
if (b.joiningDate) {
|
||||
const jd = new Date(b.joiningDate);
|
||||
if (!isNaN(jd.getTime())) {
|
||||
this.joiningDate = jd.toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: 'numeric' });
|
||||
this.yearsOfService = this.formatServiceLength(jd);
|
||||
}
|
||||
}
|
||||
|
||||
this.workEmail = str(b.emailAddress);
|
||||
this.mobile = str(b.mobileNo);
|
||||
}
|
||||
|
||||
private mapContactData(c: any): void {
|
||||
const str = (v: any): string => (v != null ? String(v).trim() : '');
|
||||
this.personalEmail = str(c.personalEmail);
|
||||
this.address = str(c.permanentAddress) || str(c.presentAddress);
|
||||
}
|
||||
|
||||
/** Same fallback as user-ss-dashboard when the employee has no photo on file. */
|
||||
onOwnPhotoError() {
|
||||
this.empPhoto = ApiService.DEFAULT_PHOTO;
|
||||
}
|
||||
|
||||
toggleAllAmounts(e: MouseEvent): void {
|
||||
e.stopPropagation();
|
||||
this.showAllAmounts = !this.showAllAmounts;
|
||||
}
|
||||
|
||||
toggleNationalId(e: MouseEvent): void {
|
||||
e.stopPropagation();
|
||||
this.showNationalId = !this.showNationalId;
|
||||
}
|
||||
|
||||
toggleTin(e: MouseEvent): void {
|
||||
e.stopPropagation();
|
||||
this.showTin = !this.showTin;
|
||||
}
|
||||
|
||||
copy(text: string): void {
|
||||
navigator.clipboard?.writeText(text).then(() => {
|
||||
this.notify.showSuccess('Copied to clipboard');
|
||||
});
|
||||
}
|
||||
|
||||
/* ── Switch User (same as GP_Master hress/payroll-home) ── */
|
||||
private LoadSwitchUserId() {
|
||||
this.authService.getSwitchUserId(EnumUserType.User).subscribe(
|
||||
(resp) => {
|
||||
if (resp == 0) {
|
||||
this.switchUserId = undefined;
|
||||
}
|
||||
else {
|
||||
this.switchUserId = resp;
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
},
|
||||
() => {
|
||||
});
|
||||
}
|
||||
|
||||
switchUser() {
|
||||
this.loadPayrollTypes();
|
||||
}
|
||||
|
||||
private loadPayrollTypes() {
|
||||
this.loadingPanel.ShowLoadingPanel = true;
|
||||
this.authService.getAdminPayrollTypes().subscribe(
|
||||
(resp) => {
|
||||
this.payrollTypes = resp;
|
||||
},
|
||||
() => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
},
|
||||
() => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
if (this.payrollTypes.length > 0) {
|
||||
this.showModal = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onPopUpClose() {
|
||||
this.showModal = false;
|
||||
}
|
||||
|
||||
selectAccessType(typeId: number): void {
|
||||
this.selectedPayrollTypeID = typeId;
|
||||
this.processSwitchUser();
|
||||
}
|
||||
|
||||
private processSwitchUser() {
|
||||
this.loadingPanel.ShowLoadingPanel = true;
|
||||
var currentUser;
|
||||
this.authService.GetCurrentUser().subscribe(
|
||||
(item: any) => {
|
||||
currentUser = item;
|
||||
},
|
||||
(errmenu: any) => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
},
|
||||
() => {
|
||||
currentUser.UserType = EnumUserType.User;
|
||||
const data = {
|
||||
user: currentUser,
|
||||
payrollTypeId: this.selectedPayrollTypeID,
|
||||
};
|
||||
this.authService.SwtichUserMode(data).subscribe(
|
||||
(resp: any) => {
|
||||
localStorage.setItem('token', resp);
|
||||
ApiService.AuthenticationToken = resp;
|
||||
},
|
||||
(err: any) => {
|
||||
this.notify.showError('Invalid Login-ID or Password');
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
},
|
||||
() => {
|
||||
const jwtHelper = new JwtHelperService();
|
||||
const user = jwtHelper.decodeToken(localStorage.getItem('token'));
|
||||
this.appMain.IsSelfService();
|
||||
if (user.ChangePasswordAtNextLogon === 'True' && this.apiService.isSSO !== true) {
|
||||
localStorage.removeItem('menuList');
|
||||
this.auth.menuEvent.emit(false);
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
this.router.navigate(['/authentication/change-password']);
|
||||
} else {
|
||||
this.authService.GetRolePermissionbyUserID().subscribe(
|
||||
(menu: any) => {
|
||||
localStorage.setItem('menuList', JSON.stringify(menu));
|
||||
this.router.navigate(['/']);
|
||||
},
|
||||
(errmenu: any) => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
},
|
||||
() => {
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
this.loadBookmark();
|
||||
this.auth.menuEvent.emit(true);
|
||||
});
|
||||
}
|
||||
this.loadingPanel.ShowLoadingPanel = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private loadBookmark() {
|
||||
this.authService.getBookmarks().subscribe(
|
||||
(resp: any) => {
|
||||
this.bookmarks = resp;
|
||||
},
|
||||
(x) => {
|
||||
},
|
||||
() => {
|
||||
localStorage.removeItem('bookmark');
|
||||
localStorage.setItem('bookmark', JSON.stringify(this.bookmarks));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -54,6 +54,7 @@ import { TrainingNeedAnalysisLmComponent } from './training-need-analysis-lm/tra
|
|||
import { CoreHrDashboardComponent } from '../core-hr/core-hr-dashboard/core-hr-dashboard/core-hr-dashboard.component';
|
||||
import { SelfServiceDashboardComponent } from './self-service-dashboard/self-service-dashboard.component';
|
||||
import { UserSSDashboardComponent } from './user-ssdashboard/user-ssdashboard.component';
|
||||
import { BRACSelfServiceComponent } from './brac-self-service/brac-self-service.component';
|
||||
import { CompanyUpdatesComponent } from './company-updates/company-updates.component';
|
||||
import { CandidateSelectionOfferLetterComponent } from '../recruitment/candidate-selection-offer-letter/candidate-selection-offer-letter.component';
|
||||
import { TaxMasterComponent } from '../payroll-tax/tax-master/tax-master.component';
|
||||
|
|
@ -63,7 +64,7 @@ export const routes: Routes = [
|
|||
{ path: 'self-profile', component: SelfProfileComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'ess-dashboard', component: EssDashboardComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'selfservice-dashboard', component: SelfServiceDashboardComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'self-dashboard', component: UserSSDashboardComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'self-dashboard', component: BRACSelfServiceComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'company-updates', component: CompanyUpdatesComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'landing-page', component: LandingPageComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'leave-approve', component: LeaveApproveComponent, canActivate: [AuthGuard] },
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ import { EssTrainingScheduleComponent } from './ess-training-schedule/ess-traini
|
|||
import { TrainingNeedAnalysisLmComponent } from './training-need-analysis-lm/training-need-analysis-lm.component';
|
||||
import { SelfServiceDashboardComponent } from './self-service-dashboard/self-service-dashboard.component';
|
||||
import { UserSSDashboardComponent } from './user-ssdashboard/user-ssdashboard.component';
|
||||
import { BRACSelfServiceComponent } from './brac-self-service/brac-self-service.component';
|
||||
import { RecruitmentModule } from '../recruitment/recruitment.module';
|
||||
import { TalentManagementModule } from '../talent-management/talent-management.module';
|
||||
import { CandidateSelectionOfferLetterComponent } from '../recruitment/candidate-selection-offer-letter/candidate-selection-offer-letter.component';
|
||||
|
|
@ -122,7 +123,7 @@ import { ChunkPipe } from '../helper/chunk.pipe';
|
|||
GatemanApprovalComponent,MyTeamComponent, LeaveHistoryComponent, ScheduleMailLogComponent,
|
||||
CordinatorDashboardComponent, ProratedApproveComponent, PfExceptionComponent, MemberBalanceLedgerComponent,
|
||||
EssTrainingCalenderComponent, EssTrainingScheduleComponent, TrainingNeedAnalysisLmComponent, SelfServiceDashboardComponent,
|
||||
UserSSDashboardComponent, CompanyUpdatesComponent,
|
||||
UserSSDashboardComponent, BRACSelfServiceComponent, CompanyUpdatesComponent,
|
||||
EmployeeDictionaryComponent, IndependentDevelopmentPlanComponent, MyIdpComponent,
|
||||
EssComponentUploaderComponent, EssComponentApprovalComponent
|
||||
],
|
||||
|
|
|
|||
|
|
@ -201,6 +201,29 @@ namespace HRM.UI.Controllers.Ess
|
|||
return Ok(items);
|
||||
}
|
||||
|
||||
[HttpGet("getUserProfile")]
|
||||
public ActionResult GetUserProfile()
|
||||
{
|
||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||
int employeeId = currentUser.EmployeeID.GetValueOrDefault();
|
||||
try
|
||||
{
|
||||
DataSet basicDs = new HRM.DA.EmployeeService().GetSelfServiceBasicData(employeeId);
|
||||
DataSet contactDs = new HRM.DA.EmployeeService().GetSelfServiceContactData(employeeId);
|
||||
|
||||
var result = new
|
||||
{
|
||||
basic = basicDs.Tables.Count > 0 ? basicDs.Tables[0] : new DataTable(),
|
||||
contact = contactDs.Tables.Count > 0 ? contactDs.Tables[0] : new DataTable()
|
||||
};
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("updateStatusToRejected")]
|
||||
public ActionResult UpdateStatusToRejected(ProfileUpdateRequest item)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user