From b5de5d768ea155e7218e2b60f1487a0c813007e9 Mon Sep 17 00:00:00 2001 From: Viet Anh Nguyen Date: Wed, 7 Feb 2024 10:37:41 +0700 Subject: [PATCH] Use GMT+8 for report date --- cope2n-fe/src/locales/en/messages.json | 7 ++++++- cope2n-fe/src/locales/vi/messages.json | 7 ++++++- cope2n-fe/src/pages/reports/index.tsx | 15 +++++++++++---- cope2n-fe/src/request/report.ts | 2 +- cope2n-fe/src/utils/metric-format.ts | 1 - 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cope2n-fe/src/locales/en/messages.json b/cope2n-fe/src/locales/en/messages.json index c5f0236..0cfbc92 100644 --- a/cope2n-fe/src/locales/en/messages.json +++ b/cope2n-fe/src/locales/en/messages.json @@ -1,12 +1,16 @@ { "Are you sure you want to leave without saving?": "Are you sure you want to leave without saving?", + "Back": "Back", "Back to Dashboard": "Back to Dashboard", "Create New Report": "Create New Report", "Dashboard": "Dashboard", "Date": "Date", + "Download": "Download", "Download Report": "Download Report", + "Duration": "Duration", "Email format is not correct": "Email format is not correct", "English": "English", + "Go to Reports": "Go to Reports", "Inference": "Inference", "Language": "Language", "Login": "Login", @@ -23,7 +27,7 @@ "Please enter a valid domain": "Please enter a valid domain", "Please specify a password": "Please specify a password", "Please specify a username": "Please specify a username", - "Report {0}...": "Report {0}...", + "Report Details": "Report Details", "Reports": "Reports", "Retry": "Retry", "Service temporarily unavailable.": "Service temporarily unavailable.", @@ -35,6 +39,7 @@ "This field must not have more than {MAX_EMAIL_LENGTH} characters": "This field must not have more than {MAX_EMAIL_LENGTH} characters", "This field must not have more than {MAX_STRING_LENGTH} characters": "This field must not have more than {MAX_STRING_LENGTH} characters", "This field must not have more than {MAX_USERNAME_LENGTH} characters": "This field must not have more than {MAX_USERNAME_LENGTH} characters", + "Upload files to process. The requests here will not be used in accuracy or payment calculations.": "Upload files to process. The requests here will not be used in accuracy or payment calculations.", "User log in successfully": "User log in successfully", "Username": "Username", "Username must not have more than {MAX_USERNAME_LENGTH} characters": "Username must not have more than {MAX_USERNAME_LENGTH} characters", diff --git a/cope2n-fe/src/locales/vi/messages.json b/cope2n-fe/src/locales/vi/messages.json index 4618c98..e277afd 100644 --- a/cope2n-fe/src/locales/vi/messages.json +++ b/cope2n-fe/src/locales/vi/messages.json @@ -1,12 +1,16 @@ { "Are you sure you want to leave without saving?": "Bạn có chắc chắn muốn rời đi mà không lưu lại không?", + "Back": "", "Back to Dashboard": "", "Create New Report": "", "Dashboard": "", "Date": "", + "Download": "", "Download Report": "", + "Duration": "", "Email format is not correct": "Định dạng email không hợp lệ", "English": "Tiếng Anh", + "Go to Reports": "", "Inference": "", "Language": "Ngôn ngữ", "Login": "Đăng nhập", @@ -23,7 +27,7 @@ "Please enter a valid domain": "Vui lòng nhập một tên miền hợp lệ", "Please specify a password": "Vui lòng nhập một mật khẩu", "Please specify a username": "Vui lòng nhập một tên tài khoản", - "Report {0}...": "", + "Report Details": "", "Reports": "", "Retry": "Thử lại", "Service temporarily unavailable.": "Dịch vụ máy chủ hiện tại không sẵn sàng.", @@ -35,6 +39,7 @@ "This field must not have more than {MAX_EMAIL_LENGTH} characters": "Độ dài chuỗi không được vượt quá {MAX_EMAIL_LENGTH} kí tự", "This field must not have more than {MAX_STRING_LENGTH} characters": "Độ dài chuỗi không được vượt quá {MAX_STRING_LENGTH} kí tự", "This field must not have more than {MAX_USERNAME_LENGTH} characters": "Độ dài chuỗi không được vượt quá {MAX_USERNAME_LENGTH} kí tự", + "Upload files to process. The requests here will not be used in accuracy or payment calculations.": "", "User log in successfully": "Đăng nhập thành công", "Username": "Tên tài khoản", "Username must not have more than {MAX_USERNAME_LENGTH} characters": "Tên tài khoản không được chứa nhiều hơn {MAX_USERNAME_LENGTH} kí tự", diff --git a/cope2n-fe/src/pages/reports/index.tsx b/cope2n-fe/src/pages/reports/index.tsx index b2baa2c..309753c 100644 --- a/cope2n-fe/src/pages/reports/index.tsx +++ b/cope2n-fe/src/pages/reports/index.tsx @@ -27,8 +27,8 @@ const ReportsPage = () => { .then((values) => { makeReportMutation .mutateAsync({ - end_date: values.dateRange[1].format('YYYY-MM-DDTHH:mm:ssZ'), - start_date: values.dateRange[0].format('YYYY-MM-DDTHH:mm:ssZ'), + end_date: values.dateRange[1].format('YYYY-MM-DD'), + start_date: values.dateRange[0].format('YYYY-MM-DD'), subsidiary: values.subsidiary, }) .then((data) => { @@ -77,16 +77,23 @@ const ReportsPage = () => { }} onCancel={handleCancel} > -
+ diff --git a/cope2n-fe/src/request/report.ts b/cope2n-fe/src/request/report.ts index 591ff38..d12f733 100644 --- a/cope2n-fe/src/request/report.ts +++ b/cope2n-fe/src/request/report.ts @@ -34,7 +34,7 @@ export async function getReportDetailList(params: ReportDetailListParams) { export async function makeReport(params: MakeReportParams) { const { end_date, start_date, subsidiary } = params; try { - const response = await API.get(`/ctel/make_report/`, { + const response = await API.post(`/ctel/make_report/`, { params: { start_date: start_date, end_date: end_date, diff --git a/cope2n-fe/src/utils/metric-format.ts b/cope2n-fe/src/utils/metric-format.ts index 689ff10..6e42167 100644 --- a/cope2n-fe/src/utils/metric-format.ts +++ b/cope2n-fe/src/utils/metric-format.ts @@ -1,5 +1,4 @@ export const formatPercent = (value: number) => { - console.log(value) if (value === 0) { return '-'; }