Skip to content

Feature/t226 inventory dashboard charts - #65

Merged
ThienlocTran merged 3 commits into
devfrom
feature/T226-inventory-dashboard-charts
Aug 4, 2026
Merged

ThienlocTran merged 3 commits into
devfrom
feature/T226-inventory-dashboard-charts

Conversation

@25ThienNgoc

@25ThienNgoc 25ThienNgoc commented Aug 1, 2026 •

Copy link
Copy Markdown
Collaborator

check giúp tui

Summary by CodeRabbit

  • Tính năng mới

    • Bổ sung tổng quan dashboard với số liệu phê duyệt, tồn kho và cảnh báo.
    • Thêm biểu đồ tồn kho cùng trạng thái tải, lỗi và tải lại dữ liệu.
    • Hiển thị trạng thái rỗng khi khu vực truy cập nhanh không có mục phù hợp.
    • Bổ sung khả năng tải dữ liệu tổng quan dashboard.
  • Cải tiến

    • Hiển thị chính xác loại phiếu và nhãn đối tác trong danh sách, màn hình chi tiết.
    • Cải thiện xử lý phiên đăng nhập hết hạn và điều hướng đăng nhập.
    • Chỉ hiển thị danh sách phê duyệt sau khi hoàn tất tải dữ liệu.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f990ebfa-3f8f-4aaa-b222-4b3abf38afdb

📥 Commits

Reviewing files that changed from the base of the PR and between 12e2168 and f614837.

📒 Files selected for processing (2)
  • src/services/dashboardService.js
  • src/views/DashboardView.vue

📝 Walkthrough

Walkthrough

PR thêm API tổng quan, biểu đồ ApexCharts và các trạng thái tải, lỗi, rỗng cho dashboard. Giao diện phê duyệt lấy loại phiếu và nhãn đối tác từ từng bản ghi.

Changes

Dashboard và dịch vụ API

Layer / File(s) Summary
Dịch vụ API tổng quan
src/services/dashboardService.js
Thêm Axios client với VITE_API_BASE_URL, timeout 15 giây, xác thực request và chuẩn hóa lỗi HTTP. Thêm getDashboardOverview() gọi /api/dashboard/overview.
Tải và hiển thị dashboard
src/views/DashboardView.vue
Tải overview, sản phẩm và kho đồng thời. Thêm biểu đồ, KPI phê duyệt, trạng thái loading, lỗi, thử lại và rỗng. Thêm chuyển hướng khi overview trả về 401 và trạng thái không có quyền truy cập nhanh.

Giao diện phê duyệt

Layer / File(s) Summary
Hiển thị dữ liệu phiếu phê duyệt
src/views/ApprovalsView.vue
Bảng và modal lấy loại phiếu từ từng bản ghi. Tiêu đề, huy hiệu và nhãn đối tác thay đổi theo phiếu đang mở.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: thienloctran

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Tiêu đề mô tả rõ thay đổi chính: bổ sung biểu đồ cho dashboard tồn kho.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/T226-inventory-dashboard-charts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 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/services/dashboardService.js`:
- Around line 4-7: Update the axios configuration in dashboardClient to include
the project-standard request timeout, ensuring stalled dashboard requests reject
and reach the existing catch/fallback flow. Keep the current baseURL and headers
unchanged, and reuse the established timeout configuration symbol or convention
if one exists.

In `@src/views/DashboardView.vue`:
- Around line 48-55: Update the chartSeries computed value in DashboardView.vue
to include totalStock only when the user has /inventory permission,
pendingApprovalsTotal only when they have /approvals or
/pending-export-approvals permission, and inventoryAlerts only when they have
/alerts permission. Preserve the corresponding labels and alignment for included
metrics, and render the chart’s empty state when no permitted metrics remain,
ensuring ADMIN/MANAGER/EMPLOYEE visibility matches the existing permission
checks.
- Around line 40-55: Update pendingApprovalsTotal so it safely handles a missing
pendingTasks object, not just a missing dashboardOverview value. Use optional
access or an equivalent fallback for both importReceipts and exportReceipts
while preserving the existing zero defaults; keep chartSeries unchanged.
🪄 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: fff01e2d-084c-4f99-b93e-f4992bbabf4b

📥 Commits

Reviewing files that changed from the base of the PR and between 7b51677 and 12e2168.

📒 Files selected for processing (3)
  • src/services/dashboardService.js
  • src/views/ApprovalsView.vue
  • src/views/DashboardView.vue

Comment thread src/services/dashboardService.js
Comment thread src/views/DashboardView.vue Outdated
Comment thread src/views/DashboardView.vue Outdated
@ThienlocTran
ThienlocTran merged commit 5d5f6c2 into dev Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants