From e95f9c9f70282b2a21de0e9d8de404dc85f00308 Mon Sep 17 00:00:00 2001 From: Viet Anh Nguyen Date: Mon, 19 Feb 2024 11:02:21 +0700 Subject: [PATCH] Add review screen + Return - for 0 --- cope2n-fe/src/components/left-menu/index.tsx | 2 +- .../report-detail/report-overview-table.tsx | 11 +++- cope2n-fe/src/pages/reviews/index.tsx | 52 +++++++++---------- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/cope2n-fe/src/components/left-menu/index.tsx b/cope2n-fe/src/components/left-menu/index.tsx index 4c9206e..d0390dc 100644 --- a/cope2n-fe/src/components/left-menu/index.tsx +++ b/cope2n-fe/src/components/left-menu/index.tsx @@ -35,7 +35,7 @@ function LeftMenu() { const generalSubItems = [ getItem(t`Dashboard`, '/dashboard', ), getItem(t`Reports`, '/reports', ), - getItem(t`Review`, '/reviews', ), + // getItem(t`Review`, '/reviews', ), getItem(t`Inference`, '/inference', ), // getItem(t`Users`, '/users', ), ]; diff --git a/cope2n-fe/src/components/report-detail/report-overview-table.tsx b/cope2n-fe/src/components/report-detail/report-overview-table.tsx index 544a750..ab5fd25 100644 --- a/cope2n-fe/src/components/report-detail/report-overview-table.tsx +++ b/cope2n-fe/src/components/report-detail/report-overview-table.tsx @@ -69,7 +69,8 @@ const columns: TableColumnsType = [ width: '130px', className: 'hide-border-right', render: (_, record) => { - return {record.snImeiTC + record.invoiceTC}; + const value = record.snImeiTC + record.invoiceTC; + return {value ? value : '-'}; }, }, { @@ -81,12 +82,20 @@ const columns: TableColumnsType = [ key: 'snImeiTC', width: '50px', className: 'show-border-left', + render: (_, record) => { + const value = record.snImeiTC; + return {value ? value : '-'}; + }, }, { title: 'Invoice', dataIndex: 'invoiceTC', key: 'invoiceTC', width: '50px', + render: (_, record) => { + const value = record.invoiceTC; + return {value ? value : '-'}; + }, }, ], }, diff --git a/cope2n-fe/src/pages/reviews/index.tsx b/cope2n-fe/src/pages/reviews/index.tsx index 55ac845..616fb15 100644 --- a/cope2n-fe/src/pages/reviews/index.tsx +++ b/cope2n-fe/src/pages/reviews/index.tsx @@ -1,17 +1,11 @@ import { t } from '@lingui/macro'; -import { Button, message, Upload, Input, Table } from 'antd'; +import { Button, message, Upload, Input, Table } from 'antd'; import { SbtPageHeader } from 'components/page-header'; import { useState } from 'react'; import { Layout } from 'antd'; import FileViewer from '@cyntler/react-doc-viewer'; const { Sider, Content } = Layout; -const contentStyle: React.CSSProperties = { - textAlign: 'center', - color: '#fff', - backgroundColor: '#efefef', -}; - const siderStyle: React.CSSProperties = { backgroundColor: '#fafafa', padding: 10, @@ -78,7 +72,7 @@ const FileCard = ({ file, isSelected, onClick }) => {
{ overflow: 'hidden', width: '100%', maxWidth: '100%', - minHeight: 'calc(100vh - 200px)', + minHeight: 'calc(100vh - 100px)', + maxHeight: 'calc(100vh - 100px)', display: 'flex', padding: '8px', }}> - - +
{ retainURLParams: true, }, csvDelimiter: ",", // "," as default, - pdfZoom: { - defaultZoom: 1.1, // 1 as default, - zoomJump: 0.2, // 0.1 as default, - }, pdfVerticalScrollByDefault: true, // false as default }} />
@@ -152,30 +150,30 @@ const InferencePage = () => { display: "flex", flexDirection: "row", height: "100px", + flexGrow: 0, }}> {fileList.map((file, index) => ( { setSelectedFileId(index); } - }/> + } /> ))}
- -

Overview

- - - - - -
+ +

Overview

+ + + + + +
- ); };