-
-
From Date
+
+
+
+ From Date
+
+
+
+ To Date
+
+
+
Load
-
-
-
-
- To Date
-
-
-
-
-
- Load
-
-
-
+
-
-
-
- {{ badGrid.filteredCount | number }} of {{ badGrid.rows.length | number }} records
-
-
- Export to Excel
- Export to PDF
-
+
+
+
+
+
+
+ {{ badGrid.filteredCount | number }} of {{ badGrid.rows.length | number }} records
+
+
+ Export to Excel
+ Export to PDF
+
-
-
-
-
-
+
+
+
+
+
-
- {{ badGrid.loaded ? 'No bad login attempt found for this date range.' : 'Select a date range and press Load.' }}
-
+
+
+
+ {{ badGrid.loaded ? 'No bad login attempt found for this date range.' : 'Select a date range and press Load.' }}
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+ @for (tab of historyTabs; track tab.type) {
+
+ {{ tab.title }}
+
+
+
+
+ From Date
+
+
+
+ To Date
+
+
+
Load
+
+
+
+
+
+
+
+
+
+
+ {{ tab.grid.filteredCount | number }} of {{ tab.grid.rows.length | number }} records
+
+
+ Export to Excel
+ Export to PDF
+
+
+ @for (col of tab.allColumns; track col.field) {
+ @if (col.isDate) {
+
+ } @else {
+
+ }
+ }
+
+
+
+
+ {{ tab.grid.loaded ? 'No change found for this date range.' : 'Select a date range and press Load.' }}
+
+
+
+
+ @for (col of tab.allColumns; track col.field) {
+ @if (col.isDate) {
+
+ } @else {
+
+ }
+ }
+
+
+
+
+
+
+
+
+
+ }
+
diff --git a/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.scss b/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.scss
index 16ce36b..246bf3d 100644
--- a/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.scss
+++ b/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.scss
@@ -1,18 +1,252 @@
-.audit-trail-filter {
- margin: 0.5rem 0 0.75rem;
+@use '../../../styles/abstracts/tokens' as *;
+
+// Tab colours: the same boxed tabs as Employee Bulk Upload (employee-bulk-upload.component.scss).
+$sal-tab-text: #2C4A6B;
+$sal-tab-bg: #F4F8FC;
+$sal-tab-hover: #D8E4F0;
+$sal-tab-border: #C9D8E8;
+$sal-tab-active-border: #9DB4CC;
+
+:host {
+ @include empcard-host-vars;
+}
+
+.sal-page {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+
+ // The loading panel is not a card: keep it out of the flex gap (its overlay is absolute).
+ > app-loading-panel {
+ display: contents;
+ }
+}
+
+/* ── card shell ─────────────────────────────────────────────────── */
+.sal-card {
+ background: var(--brand-card-bg);
+ border: 1px solid var(--brand-card-border);
+ border-radius: 20px;
+ box-shadow: var(--brand-card-shadow);
+ padding: 18px 20px;
+ position: relative;
+}
+
+/* ── page header ────────────────────────────────────────────────── */
+.sal-header {
+ display: flex;
align-items: center;
+ gap: 14px;
}
-.audit-trail-label {
- margin: auto;
+.sal-header-ico {
+ flex: 0 0 auto;
+ width: 44px;
+ height: 44px;
+ border-radius: 12px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: $sal-tab-hover;
+ color: $sal-tab-text;
+
+ i {
+ font-size: 1.35rem;
+ }
}
-.audit-trail-search {
+.sal-header-text {
+ min-width: 0;
+
+ h2 {
+ margin: 0;
+ font-size: 1.2rem;
+ font-weight: 700;
+ color: var(--brand-text);
+ }
+
+ p {
+ margin: 2px 0 0;
+ font-size: 0.85rem;
+ color: var(--brand-text-sub);
+ }
+}
+
+/* ── tabs ───────────────────────────────────────────────────────── */
+/*
+ * Each tab a bordered box, the open one white with a blue top edge. The tab items are rendered
+ * by kendo-tabstrip, hence ::ng-deep.
+ */
+:host ::ng-deep kendo-tabstrip.sal-tabs {
+ border: 0;
+ background: transparent;
+
+ > .k-tabstrip-items-wrapper {
+ border-bottom: 1px solid #E2E8F0;
+ background: transparent;
+ }
+
+ > .k-tabstrip-items-wrapper .k-tabstrip-item {
+ display: inline-flex;
+ align-items: center;
+ margin: 0 6px -1px 0;
+ padding: 10px 16px;
+ border: 1px solid $sal-tab-border;
+ border-radius: 10px 10px 0 0;
+ background: $sal-tab-bg;
+ color: $sal-tab-text;
+ font-weight: 700;
+ white-space: nowrap;
+ transition: background .15s ease, border-color .15s ease;
+
+ &:hover {
+ background: $sal-tab-hover;
+ }
+
+ &.k-active {
+ background: #FFFFFF;
+ border-color: $sal-tab-active-border;
+ border-bottom-color: #FFFFFF;
+ box-shadow: inset 0 3px 0 $sal-tab-text;
+ }
+
+ .k-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ padding: 0;
+ color: inherit;
+ }
+ }
+
+ // Scroll arrows when the tabs do not fit.
+ > .k-tabstrip-items-wrapper .k-tabstrip-prev,
+ > .k-tabstrip-items-wrapper .k-tabstrip-next {
+ color: $sal-tab-text;
+ }
+
+ > .k-tabstrip-content {
+ padding: 10px 0 0;
+ border: 0;
+ background: transparent;
+
+ &:focus,
+ &.k-focus {
+ outline: none;
+ box-shadow: none;
+ }
+ }
+}
+
+/* ── tab body: filter bar + grid ────────────────────────────────── */
+.sal-body {
+ display: flex;
+ flex-direction: column;
+ gap: 14px;
+}
+
+.sal-filter {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: flex-end;
+ gap: 12px 16px;
+ padding: 12px 14px;
+ border: 1px solid var(--brand-card-border);
+ border-radius: 14px;
+ background: $sal-tab-bg;
+}
+
+.sal-field {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ width: 220px;
+
+ label {
+ font-size: 0.78rem;
+ font-weight: 600;
+ letter-spacing: .02em;
+ text-transform: uppercase;
+ color: var(--brand-text-sub);
+ }
+
+ kendo-datepicker {
+ width: 100%;
+ }
+
+ @media (max-width: 576px) {
+ width: 100%;
+ }
+}
+
+.sal-load {
+ min-width: 120px;
+
+ @media (max-width: 576px) {
+ width: 100%;
+ }
+}
+
+:host ::ng-deep kendo-grid.sal-grid {
+ border-radius: 12px;
+ overflow: hidden;
+
+ .k-grid-toolbar {
+ gap: 10px;
+ padding: 10px 12px;
+ }
+
+ .k-grid-header .k-header {
+ font-weight: 700;
+ }
+}
+
+.sal-search {
+ position: relative;
+ display: inline-flex;
+ align-items: center;
width: 280px;
+ max-width: 100%;
+
+ i {
+ position: absolute;
+ left: 10px;
+ z-index: 1;
+ font-size: 0.85rem;
+ color: var(--brand-text-muted);
+ pointer-events: none;
+ }
+
+ input {
+ width: 100%;
+ padding-left: 30px;
+ }
}
-.audit-trail-count {
- margin-left: 0.5rem;
- font-size: 0.875rem;
- opacity: 0.75;
+.sal-count {
+ padding: 3px 10px;
+ border-radius: 999px;
+ background: $sal-tab-bg;
+ border: 1px solid $sal-tab-border;
+ font-size: 0.8rem;
+ color: $sal-tab-text;
+ white-space: nowrap;
+
+ strong {
+ font-weight: 700;
+ }
+}
+
+.sal-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ padding: 28px 0;
+ color: var(--brand-text-muted);
+
+ i {
+ font-size: 1.6rem;
+ }
}
diff --git a/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.ts b/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.ts
index 88a2187..73f8b63 100644
--- a/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.ts
+++ b/HRM.UI/ClientApp/src/app/authentication/system-audittrail/system.audittrail.component.ts
@@ -6,7 +6,7 @@ import { ApiService } from '../../app.api.service';
import { AuthService } from '../../_services/auth/auth.service';
import { HRMNotificationService } from '../../app.notification.service';
import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service';
-import { UserLogInInfo, BadLoginAttemptInfo } from '../../_models/Authentication/auditTrail';
+import { UserLogInInfo, BadLoginAttemptInfo, EnumSystemAuditHistory, SystemAuditHistory } from '../../_models/Authentication/auditTrail';
/** Rows per virtual "page" - enough to fill the grid viewport a few times over. */
const PAGE_SIZE = 60;
@@ -24,22 +24,48 @@ export interface AuditTrailRow {
deviceId: string;
}
+/** One row of a change-history grid (Z_ tables), the same shape for every history tab. */
+export interface AuditHistoryRow {
+ auditDate: Date;
+ auditType: string;
+ loginID: string;
+ name: string;
+ code: string;
+ userType: string;
+ roleName: string;
+ roleType: string;
+ menu: string;
+ accessType: string;
+ activities: string;
+ actionBy: string;
+}
+
+/** A column of a change-history tab. */
+export interface AuditHistoryColumn {
+ field: keyof AuditHistoryRow;
+ title: string;
+ width: number;
+ isDate?: boolean;
+}
+
/**
* State of one audit-trail grid: all loaded rows, the toolbar search, and the
* grid's sort / filter / virtual-scroll state. Everything is done client side over
* the rows of the selected date range.
*/
-export class AuditTrailGrid {
- rows: AuditTrailRow[] = [];
- private searched: AuditTrailRow[] = [];
+export class AuditTrailGrid