+
{{'loadingTransactionLogs' | translate}}
@@ -56,7 +73,12 @@
-
+
| {{ log.logId }} |
{{ log.porOrgacode }} |
{{ log.transactionID }} |
@@ -69,6 +91,31 @@
+
+
+
+
+
+
+
+
+ {{ 'page' | translate }} {{ currentPage }} {{ 'of' | translate }} {{ getTotalPages() }} ({{ totalCount }} {{ 'totalItems' | translate }})
+
+
+
+
+
+
+
diff --git a/src/app/transaction-logs/transaction-logs.component.ts b/src/app/transaction-logs/transaction-logs.component.ts
index 1b4f450..902073d 100644
--- a/src/app/transaction-logs/transaction-logs.component.ts
+++ b/src/app/transaction-logs/transaction-logs.component.ts
@@ -4,62 +4,83 @@ import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { ExcelExportService } from '../shared/services/excel-export.service';
import { TRANSACTION_LOGS_FILE_NAME } from '../utils/app.constants';
-
-interface TransactionLog {
- logId: number;
- porOrgacode: string;
- drMbmbkmsnumber: string;
- crMbmbkmsnumber: string;
- crPcaglacode: string;
- drPcaGlacode: string;
- ppmPymdcode: string;
- sgtGntrdate: string;
- sgtGntrcreateat: string;
- channelCode: string;
- transactionID: string;
- createdAt: string;
- updatedAt: string;
-}
+import { pageSizeOptions } from '../utils/app.constants';
+import { NgSelectModule } from '@ng-select/ng-select';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { TransactionLogFilterPipe } from '../shared/pipes/transactionLogFilter.pipe';
+import {TransactionLog} from "../models/user"
@Component({
selector: 'app-transaction-logs',
templateUrl: './transaction-logs.component.html',
providers: [TransactionLogService],
- imports:[CommonModule, TranslateModule]
+ imports: [CommonModule, TranslateModule, NgSelectModule, FormsModule, ReactiveFormsModule, TransactionLogFilterPipe, ]
})
export class TransactionLogsComponent implements OnInit {
-
+ currentPage: number = 1;
+ totalCount: number = 0;
+ renewalDataExpanded: boolean = true;
+ pageSizeOptions = pageSizeOptions;
+ itemsPerPage: number = 5;
logs: TransactionLog[] = [];
isLoading = false;
errorMessage: string = '';
+ searchText: string = '';
constructor(
private transactionLogService: TransactionLogService,
private excelExportService: ExcelExportService
) {}
- ngOnInit(): void {
- this.loadLogs();
+ get logs$(){
+ return this.transactionLogService.logs$;
}
+ ngOnInit(): void {
+ this.transactionLogService.loadLogs();
- loadLogs() {
- this.isLoading = true;
- this.errorMessage = '';
-
- this.transactionLogService.getTransactionLogs().subscribe({
- next: (res) => {
- this.logs = res;
- this.isLoading = false;
- },
- error: (err) => {
- console.error('Failed to load transaction logs', err);
- this.errorMessage = 'Failed to load transaction logs. Please try again.';
- this.isLoading = false;
- }
+ this.transactionLogService.logs$.subscribe((logs: TransactionLog[]) => {
+ this.logs = logs;
});
+
+ this.transactionLogService.currentPage$.subscribe((page) => {
+ this.currentPage = page;
+ });
+
+ this.transactionLogService.totalCount$.subscribe((count) => {
+ this.totalCount = count;
+ });
+
+ this.transactionLogService.itemsPerPage$.subscribe((size) => {
+ this.itemsPerPage = size;
+ });
+ }
+
+ onSearch(value: string): void {
+ this.searchText = value;
+}
+
+ get paginatedLogs(): TransactionLog[] {
+ const start = (this.currentPage - 1) * this.itemsPerPage;
+ const end = start + this.itemsPerPage;
+ return this.logs.slice(start, end);
}
exportDataInExcel(){
this.excelExportService.exportExcel(this.logs, TRANSACTION_LOGS_FILE_NAME)
}
+ getTotalPages(): number {
+ return this.transactionLogService.getTotalPages();
+ }
+ onPageSizeChange(pageSize: number): void {
+ this.transactionLogService.setItemsPerPage(pageSize);
+ }
+
+ nextPage(): void {
+ this.transactionLogService.nextPage();
+ }
+
+ previousPage(): void {
+ this.transactionLogService.previousPage();
+ }
+
}
\ No newline at end of file
diff --git a/src/app/user-management/setup-user/setup-user.component.html b/src/app/user-management/setup-user/setup-user.component.html
index ad2e749..5564195 100644
--- a/src/app/user-management/setup-user/setup-user.component.html
+++ b/src/app/user-management/setup-user/setup-user.component.html
@@ -126,13 +126,13 @@
-
+
- {{ 'fieldRequired' | translate }}
+ {{ 'fieldRequired' | translate }}
diff --git a/src/app/user-management/setup-user/setup-user.component.ts b/src/app/user-management/setup-user/setup-user.component.ts
index befccb4..a411383 100644
--- a/src/app/user-management/setup-user/setup-user.component.ts
+++ b/src/app/user-management/setup-user/setup-user.component.ts
@@ -81,7 +81,7 @@ export class SetupUserComponent implements OnInit {
const newUser : SetupUser = {
userId: this.userForm.value.userId,
userFullname: this.userForm.value.userFullname,
- email: `${this.userForm.value.userId}@dummy.com`,
+ email: this.userForm.value.email,
role: this.userForm.value.userRole,
porOrgacode: this.storageService.getItem('POR_ORGACODE'),
password: this.userForm.value.defaultPassword
@@ -138,7 +138,7 @@ ngOnInit(): void {
userFullname: ['', [Validators.required, Validators.maxLength(500)]],
defaultPassword: ['', Validators.required],
email: ['', [Validators.required, Validators.email]],
- userRole: ['', Validators.required]
+ userRole: [null, Validators.required]
});
this.userService.loadUsers();
diff --git a/src/app/user-management/third-party-registration/third-party-registration.component.html b/src/app/user-management/third-party-registration/third-party-registration.component.html
index d1b352d..f64df10 100644
--- a/src/app/user-management/third-party-registration/third-party-registration.component.html
+++ b/src/app/user-management/third-party-registration/third-party-registration.component.html
@@ -282,9 +282,10 @@
-
-
+
+
+
diff --git a/src/app/user-permissions/user-permissions.component.html b/src/app/user-permissions/user-permissions.component.html
index 40440f4..536512d 100644
--- a/src/app/user-permissions/user-permissions.component.html
+++ b/src/app/user-permissions/user-permissions.component.html
@@ -12,17 +12,10 @@
-
+
+
+
diff --git a/src/app/user-permissions/user-permissions.component.ts b/src/app/user-permissions/user-permissions.component.ts
index 0efc51a..8af7d0a 100644
--- a/src/app/user-permissions/user-permissions.component.ts
+++ b/src/app/user-permissions/user-permissions.component.ts
@@ -10,10 +10,11 @@ import { URIKey } from '../utils/uri-enums';
import { HttpErrorResponse, HttpParams } from '@angular/common/http';
import { FormConstants, HiddenValues, SuccessMessages } from '../utils/enums';
import { CommonModule } from '@angular/common';
+import { NgSelectModule } from '@ng-select/ng-select';
@Component({
selector: 'app-user-permissions',
- imports: [TranslateModule, ReactiveFormsModule, CommonModule],
+ imports: [TranslateModule, ReactiveFormsModule, CommonModule, TranslateModule, NgSelectModule],
templateUrl: './user-permissions.component.html',
styleUrl: './user-permissions.component.scss'
})
@@ -27,7 +28,7 @@ export class UserPermissionsComponent {
constructor(private credentialService: CredentialService, private fb: FormBuilder, private httpService: HttpURIService, private i18nService: I18NService) {
this.permission = this.fb.group({
allocation: [''],
- userCode: [''],
+ userCode: [null],
userRole: [''],
});
diff --git a/src/assets/data/sideMenu.json b/src/assets/data/sideMenu.json
index ac2ab5c..c1a3f6d 100644
--- a/src/assets/data/sideMenu.json
+++ b/src/assets/data/sideMenu.json
@@ -103,6 +103,13 @@
"checked": false,
"expanded": false,
"children": []
+ },
+ {
+ "name": "transactionLogs",
+ "route": "/home/transactionLogs",
+ "checked": false,
+ "expanded": false,
+ "children": []
}
]
},
diff --git a/src/styles.scss b/src/styles.scss
index e3fc20b..c67a1a1 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -166,7 +166,7 @@ ng-select.form-select-sm {
border: none !important;
}
.ng-select .ng-select-container{
- width: 98% !important;
+ width: 100% !important;
}
#downloadReport {
--
2.32.0