Repository navigation
Feature/t224 pending approvals UI - #62
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSidebar chuyển sang menu theo section và quyền truy cập. Màn hình phê duyệt hỗ trợ phiếu nhập, phiếu xuất, lọc theo kho và trạng thái, cùng luồng xem, duyệt và từ chối. ChangesĐiều hướng sidebar
Quy trình phê duyệt
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/views/ApprovalsView.vue`:
- Around line 566-595: Remove one of the duplicate approve/reject action groups
in the detail modal: either the “Tác vụ duyệt nhanh” card around
`handleApprove`/`openRejectModal` or the `modal-foot` controls around the same
handlers. Preserve a single pending-approval action location and its existing
`isPendingApproval` condition and behavior.
- Around line 95-114: Move warehouse filtering to the server-backed approval
fetches: pass filters.warehouse to getPendingApprovals and
getPendingExportReceipts, source warehouseOptions from the warehouse API rather
than current-page receipts, and make totalElements reflect or be hidden while
filtered. In the documentType change handler, reset filters.warehouse to an
empty value and page to 0 so the new document type does not inherit the previous
warehouse filter.
- Around line 87-90: Cập nhật statusLabels để CHO_DUYET_CAP_1 và CHO_DUYET_CAP_2
có nhãn riêng, lần lượt thể hiện “Chờ cấp 1” và “Chờ cấp 2”, để badge bảng và
modal chi tiết phản ánh đúng cấp phê duyệt.
- Around line 281-285: Cập nhật thông báo lỗi trong nhánh catch của luồng từ
chối thuộc ApprovalsView để dùng đúng loại phiếu đang được xử lý, tránh luôn
hiển thị “phiếu nhập” khi từ chối phiếu xuất. Giữ nguyên việc đặt
rejectState.submitting, xử lý rejectState.error và chuyển hướng 401.
- Around line 66-75: Update the columns definition in ApprovalsView so the
supplierName column label is dynamic: use “Khách hàng” (or the established
equivalent) when documentType is “out”, and retain “Nhà cung cấp” for other
document types.
- Around line 496-515: Gate both Approve and Reject buttons in the row action
markup with isPendingApproval(row.status) in addition to the existing
running-state check. Add the same early-return guard to openRejectModal before
its existing modal/API flow, while preserving handleApprove’s current behavior
and the remaining modal logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 83e8733c-2813-4bbb-b68c-6fdb4b17e327
📒 Files selected for processing (3)
src/components/AppSidebar.vuesrc/style.csssrc/views/ApprovalsView.vue
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/views/ApprovalsView.vue`:
- Around line 101-104: Update fetchPendingApprovals and its filter-triggering
flow to maintain an incrementing request token, capturing the token for each
request and applying receipts.value only when it still matches the latest token.
Ensure stale responses cannot overwrite results after documentType, warehouse,
or status changes, and preserve the corresponding document type with each
displayed row so confirmApprove and confirmReject cannot act on an ID using a
later documentType.value.
- Around line 101-104: Update the onMounted initialization in ApprovalsView so
the independent loadWarehouseOptions and fetchPendingApprovals calls execute
concurrently via Promise.all, while preserving both operations’ completion
before the mount callback finishes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b5364cfa-0733-4769-a296-4197f994f82d
📒 Files selected for processing (3)
src/services/exportReceiptService.jssrc/services/importReceiptService.jssrc/views/ApprovalsView.vue
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/views/ApprovalsView.vue`:
- Around line 193-199: Update openDetail to capture receipt.documentType in a
local type value and create a request token before awaiting the detail request;
use both captured values when building and applying the response. Only update
detailState when the token is still current, and increment the token in
closeDetail to invalidate pending requests when the modal closes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 26e8f9b8-b64a-4813-8fcb-cf3ed538e6fb
📒 Files selected for processing (1)
src/views/ApprovalsView.vue
check và merge code giúp tui
Summary by CodeRabbit
Tính năng mới
Cải tiến giao diện
Sửa lỗi