diff --git a/cope2n-fe/Dockerfile b/cope2n-fe/Dockerfile index a0a89a9..f0b31ef 100644 --- a/cope2n-fe/Dockerfile +++ b/cope2n-fe/Dockerfile @@ -2,7 +2,7 @@ FROM node:21-alpine AS build WORKDIR /app/ COPY --chown=node:node package*.json ./ -RUN npm install +RUN npm install -g npm@10.4.0 && npm install COPY --chown=node:node . . RUN npm run build RUN npm cache clean --force @@ -18,4 +18,4 @@ COPY --from=build /app/run.sh /app/ COPY --from=build /app/nginx.conf /configs/ RUN chmod +x /app/run.sh -CMD ["/app/run.sh"] \ No newline at end of file +CMD ["/app/run.sh"] diff --git a/cope2n-fe/nginx.conf b/cope2n-fe/nginx.conf new file mode 100644 index 0000000..33cf790 --- /dev/null +++ b/cope2n-fe/nginx.conf @@ -0,0 +1,35 @@ +server { + # listen {{port}}; + # listen [::]:{{port}}; + # server_name localhost; + client_max_body_size 100M; + + location ~ ^/api { + proxy_pass {{proxy_server}}; + proxy_read_timeout 300; + proxy_connect_timeout 300; + proxy_send_timeout 300; + } + + location /static/drf_spectacular_sidecar/ { + alias /backend-static/drf_spectacular_sidecar/; + } + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } + + location ~ ^/static/drf_spectacular_sidecar/swagger-ui-dist { + proxy_pass {{proxy_server}}; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} \ No newline at end of file diff --git a/cope2n-fe/run.sh b/cope2n-fe/run.sh new file mode 100644 index 0000000..fd8cab9 --- /dev/null +++ b/cope2n-fe/run.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# update port and BD proxy +sed "s#{{proxy_server}}#$VITE_PROXY#g" /configs/nginx.conf > /etc/nginx/conf.d/default.conf +# run up +nginx -g 'daemon off;' \ No newline at end of file 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 af544ed..3292d8e 100644 --- a/cope2n-fe/src/components/report-detail/report-overview-table.tsx +++ b/cope2n-fe/src/components/report-detail/report-overview-table.tsx @@ -30,15 +30,19 @@ const columns: TableColumnsType = [ width: '100px', render: (_, record) => { if (record.subSidiaries === '+') return ''; - return record.subSidiaries; + return String(record.subSidiaries).toUpperCase(); }, filters: [ - { text: 'all', value: 'all' }, - { text: 'sesp', value: 'sesp' }, - { text: 'seau', value: 'seau' }, + { text: 'ALL', value: 'ALL' }, + { text: 'SEAU', value: 'SEAU' }, + { text: 'SESP', value: 'SESP' }, + { text: 'SME', value: 'SME' }, + { text: 'SEPCO', value: 'SEPCO' }, + { text: 'TSE', value: 'TSE' }, + { text: 'SEIN', value: 'SEIN' }, ], filterMode: 'menu', - onFilter: (value: string, record) => record.subSidiaries.includes(value), + onFilter: (value: string, record) => record.subSidiaries.includes(String(value).toUpperCase()), }, { title: 'OCR extraction date', @@ -216,23 +220,11 @@ const columns: TableColumnsType = [ ]; interface ReportOverViewTableProps { - pagination: { - page: number; - page_size: number; - }; - setPagination: React.Dispatch< - React.SetStateAction<{ - page: number; - page_size: number; - }> - >; isLoading: boolean; data: any; } const ReportOverViewTable: React.FC = ({ - pagination, - setPagination, isLoading, data, }) => { @@ -270,20 +262,6 @@ const ReportOverViewTable: React.FC = ({ bordered size='small' scroll={{ x: 2000 }} - pagination={{ - current: pagination.page, - pageSize: 10, - total: dataSubsRows?.length, - // showTotal: (total, range) => - // `${range[0]}-${range[1]} of ${total} items`, - onChange: (page, pageSize) => { - setPagination({ - page, - page_size: pageSize || 10, - }); - }, - showSizeChanger: false, - }} /> ); diff --git a/cope2n-fe/src/components/report-detail/report-table.tsx b/cope2n-fe/src/components/report-detail/report-table.tsx index cf7f511..1b51e11 100644 --- a/cope2n-fe/src/components/report-detail/report-table.tsx +++ b/cope2n-fe/src/components/report-detail/report-table.tsx @@ -37,15 +37,42 @@ const ReportTable: React.FC = () => { title: 'ID', dataIndex: 'ID', key: 'ID', - sorter: (a, b) => a.ID - b.ID, }, { - title: 'Created Date', + title: 'Report Date', dataIndex: 'Created Date', key: 'Created Date', render: (_, record) => { return {record['Created Date'].toString().split('T')[0]}; }, + width: 110, + }, + { + title: 'Start Date', + dataIndex: 'Start Date', + key: 'Start Date', + render: (_, record) => { + return {record['Start Date'].toString().split('T')[0]}; + }, + width: 110, + }, + { + title: 'End Date', + dataIndex: 'End Date', + key: 'End Date', + render: (_, record) => { + return {record['End Date'].toString().split('T')[0]}; + }, + width: 110, + }, + { + title: 'Subsidiary', + dataIndex: 'Subsidiary', + key: 'Subsidiary', + render: (_, record) => { + return {String(record['Subsidiary']).toUpperCase()}; + }, + width: 110, }, { title: 'No. Requests', @@ -149,7 +176,7 @@ const ReportTable: React.FC = () => { title: 'Actions', dataIndex: 'actions', key: 'actions', - width: 200, + width: 240, render: (_, record) => { return (
@@ -159,7 +186,7 @@ const ReportTable: React.FC = () => { }} style={{ marginRight: 10 }} > - Detail + Details */} - {/* */} + + } />
- + { + setSubsidiary(value); + }} /> -
diff --git a/cope2n-fe/src/pages/inference/index.tsx b/cope2n-fe/src/pages/inference/index.tsx index 7bd18f1..82f24a4 100644 --- a/cope2n-fe/src/pages/inference/index.tsx +++ b/cope2n-fe/src/pages/inference/index.tsx @@ -64,6 +64,9 @@ const InferencePage = () => { +

+ {t`Upload files to process. The requests here will not be used in accuracy or payment calculations.`} +

diff --git a/cope2n-fe/src/pages/reports/index.tsx b/cope2n-fe/src/pages/reports/index.tsx index a4d8ec9..b2baa2c 100644 --- a/cope2n-fe/src/pages/reports/index.tsx +++ b/cope2n-fe/src/pages/reports/index.tsx @@ -105,9 +105,13 @@ const ReportsPage = () => { placeholder='Select a subsidiary' style={{ width: 200 }} options={[ - { value: 'all', label: 'ALL' }, - { value: 'sesp', label: 'SESP' }, - { value: 'seau', label: 'SEAU' }, + { value: 'ALL', label: 'ALL' }, + { value: 'SEAU', label: 'SEAU' }, + { value: 'SESP', label: 'SESP' }, + { value: 'SME', label: 'SME' }, + { value: 'SEPCO', label: 'SEPCO' }, + { value: 'TSE', label: 'TSE' }, + { value: 'SEIN', label: 'SEIN' }, ]} /> diff --git a/cope2n-fe/src/pages/reports/report_detail/index.tsx b/cope2n-fe/src/pages/reports/report_detail/index.tsx index 57d4eb7..2d33357 100644 --- a/cope2n-fe/src/pages/reports/report_detail/index.tsx +++ b/cope2n-fe/src/pages/reports/report_detail/index.tsx @@ -1,4 +1,4 @@ -import { DownloadOutlined } from '@ant-design/icons'; +import { DownloadOutlined, ArrowLeftOutlined } from '@ant-design/icons'; import { t } from '@lingui/macro'; import { Button, @@ -271,14 +271,32 @@ const ReportDetail = () => { URL.revokeObjectURL(anchorElement.href); }; + const handleBack = () => { + window.history.back(); + }; + return ( <> {t`Report ${id.slice(0, 16)}...`} + <> + + + + {t`Report Details`} + } extra={