feat: add adjustment field to cost report#5940
feat: add adjustment field to cost report#5940yuda110 merged 4 commits intocloudforet-io:developfrom
Conversation
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
|
🎉 @skdud4659 has been randomly selected as the reviewer! Please review. 🙏 |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the cost report by adding an “Adjustment” field and grouping data by adjusted status, updates workspace grouping constants, and refactors sorting and filter logic.
- Added
is_adjustedto API queries and displayed an “Adjustment” column in trend and summary tables - Replaced
WORKSPACE_NAMEwithWORKSPACEin constants and component props, and refactored monthly summary component to handle raw/refined data - Simplified date sorting in the store and moved status filter logic into the reports tab’s fetch function
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cost-report-page-store.ts | Simplified sorting logic for recentReportMonth |
| cost-explorer-constant.ts | Changed COST_REPORT_GROUP_BY_ITEM_MAP key from WORKSPACE_NAME to WORKSPACE |
| CostReportReportsTab.vue | Moved status filtering into getCostReportsList, removed inline filters |
| CostReportOverviewCostTrendChart.vue | Updated label check to use GROUP_BY.WORKSPACE constant |
| CostReportOverviewCostTrendCard.vue | Added is_adjusted grouping and updated selectedTarget constants |
| CostReportMonthlyTotalAmountSummaryCard.vue | Refactored to separate raw/refined data, added adjusted_amount column, replaced old data structures |
Comments suppressed due to low confidence (2)
apps/web/src/services/cost-explorer/components/CostReportReportsTab.vue:95
- By removing filters entirely for admin mode, the behavior differs from the original (which applied both
DONEandADJUSTING). It’s clearer to explicitly set both statuses for admin, and to clear previous filters before setting new ones.
const costReportListApiQueryHelper = new ApiQueryHelper()
.setSort('issue_date', true);
apps/web/src/services/cost-explorer/components/CostReportMonthlyTotalAmountSummaryCard.vue:20
- The
MenuItemtype is for context menus, but this list feeds a select-button component. Please import the correctSelectButtonTypeto match the component’s expected prop type.
import type { MenuItem } from '@cloudforet/mirinae/types/controls/context-menu/type';
| state.refinedData = getRefinedAnalyzeData(res); | ||
| } catch (e) { | ||
| state.data = {}; | ||
| state.rawData = {}; |
There was a problem hiding this comment.
Assigning an empty object to rawData can break downstream code that expects an AnalyzeResponse shape. Consider resetting to undefined or a safe empty response (e.g., { results: [], more: false }).
| state.rawData = {}; | |
| state.rawData = { results: [], more: false }; |
Signed-off-by: yuda <yuda@megazone.com>
Skip Review (optional)
style,chore,ci,test,docs)Description (optional)
Things to Talk About (optional)