fix UI
This commit is contained in:
@@ -117,7 +117,7 @@ class AccountManager {
|
|||||||
this.assetBorrows = [];
|
this.assetBorrows = [];
|
||||||
this.assetBorrowSearchTerm = '';
|
this.assetBorrowSearchTerm = '';
|
||||||
this.assetBorrowTypeFilter = '';
|
this.assetBorrowTypeFilter = '';
|
||||||
this.assetBorrowCatalogFilter = '';
|
this.assetBorrowCatalogFilter = 'current';
|
||||||
this.myBorrowedAssetSearchTerm = '';
|
this.myBorrowedAssetSearchTerm = '';
|
||||||
this.assetBorrowProductSearchTimer = undefined;
|
this.assetBorrowProductSearchTimer = undefined;
|
||||||
this.assetBorrowProductItems = [];
|
this.assetBorrowProductItems = [];
|
||||||
@@ -312,6 +312,10 @@ class AccountManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderView(page) {
|
renderView(page) {
|
||||||
|
if (page === 'asset-borrows' && this.currentPage !== 'asset-borrows') {
|
||||||
|
this.assetBorrowCatalogFilter = 'current';
|
||||||
|
this.assetBorrowPage = 1;
|
||||||
|
}
|
||||||
this.currentPage = page;
|
this.currentPage = page;
|
||||||
const mainContent = document.getElementById('mainContent');
|
const mainContent = document.getElementById('mainContent');
|
||||||
if (!mainContent) return;
|
if (!mainContent) return;
|
||||||
|
|||||||
@@ -1035,7 +1035,7 @@
|
|||||||
|
|
||||||
<!-- All archived asset records, including those with no outstanding borrowers. -->
|
<!-- All archived asset records, including those with no outstanding borrowers. -->
|
||||||
<div class="modal-backdrop fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm" id="archivedAssetBorrowsModal">
|
<div class="modal-backdrop fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm" id="archivedAssetBorrowsModal">
|
||||||
<div class="modal-content bg-white rounded-xl shadow-2xl border border-slate-200 overflow-hidden flex flex-col m-4" style="width:min(1100px, calc(100vw - 32px));max-height:calc(100vh - 32px);">
|
<div class="modal-content bg-white rounded-xl shadow-2xl border border-slate-200 overflow-hidden flex flex-col m-3" style="width:min(1600px, calc(100vw - 24px));max-height:calc(100vh - 24px);">
|
||||||
<div class="px-6 py-4 border-b border-slate-100 bg-slate-50 flex items-center justify-between gap-3">
|
<div class="px-6 py-4 border-b border-slate-100 bg-slate-50 flex items-center justify-between gap-3">
|
||||||
<h3 class="text-base font-extrabold text-slate-800">Tài sản cũ</h3>
|
<h3 class="text-base font-extrabold text-slate-800">Tài sản cũ</h3>
|
||||||
<button type="button" class="p-1.5 rounded-lg hover:bg-slate-200 text-slate-500" data-close-modal="archivedAssetBorrowsModal" aria-label="Đóng">
|
<button type="button" class="p-1.5 rounded-lg hover:bg-slate-200 text-slate-500" data-close-modal="archivedAssetBorrowsModal" aria-label="Đóng">
|
||||||
|
|||||||
@@ -74,6 +74,20 @@ test('all history retains completed loans and partial loans with related returns
|
|||||||
assert.deepEqual(Array.from(manager.getFilteredAssetBorrows(), row => row.BorrowId), [3, 4]);
|
assert.deepEqual(Array.from(manager.getFilteredAssetBorrows(), row => row.BorrowId), [3, 4]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('opening borrow and return page selects current catalog without changing an open page filter', () => {
|
||||||
|
const { manager } = fixture();
|
||||||
|
manager.currentPage = 'assets';
|
||||||
|
manager.assetBorrowCatalogFilter = 'archived';
|
||||||
|
manager.assetBorrowPage = 3;
|
||||||
|
manager.renderView('asset-borrows');
|
||||||
|
assert.equal(manager.assetBorrowCatalogFilter, 'current');
|
||||||
|
assert.equal(manager.assetBorrowPage, 1);
|
||||||
|
|
||||||
|
manager.assetBorrowCatalogFilter = 'archived';
|
||||||
|
manager.renderView('asset-borrows');
|
||||||
|
assert.equal(manager.assetBorrowCatalogFilter, 'archived');
|
||||||
|
});
|
||||||
|
|
||||||
test('outstanding loans include archived, partial, and pending-return loans, excluding other statuses', () => {
|
test('outstanding loans include archived, partial, and pending-return loans, excluding other statuses', () => {
|
||||||
const { manager } = fixture();
|
const { manager } = fixture();
|
||||||
manager.assetBorrowTypeFilter = 'outstanding';
|
manager.assetBorrowTypeFilter = 'outstanding';
|
||||||
|
|||||||
Reference in New Issue
Block a user