소스 검색

update report

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui 1 년 전
부모
커밋
084ffa577a
11개의 변경된 파일39개의 추가작업 그리고 39개의 파일을 삭제
  1. +4
    -4
      src/app/(main)/analytics/ProjectCashFlowReport/page.tsx
  2. +3
    -3
      src/app/api/reports/actions.ts
  3. +3
    -3
      src/app/api/reports/index.ts
  4. +1
    -1
      src/components/Breadcrumb/Breadcrumb.tsx
  5. +0
    -18
      src/components/GenerateEX02ProjectCashFlowReport/GenerateEX02ProjectCashFlowReportWrapper.tsx
  6. +0
    -1
      src/components/GenerateEX02ProjectCashFlowReport/index.ts
  7. +6
    -6
      src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx
  8. +2
    -2
      src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReportLoading.tsx
  9. +18
    -0
      src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReportWrapper.tsx
  10. +1
    -0
      src/components/GenerateProjectCashFlowReport/index.ts
  11. +1
    -1
      src/components/NavigationContent/NavigationContent.tsx

src/app/(main)/analytics/EX02ProjectCashFlowReport/page.tsx → src/app/(main)/analytics/ProjectCashFlowReport/page.tsx 파일 보기

@@ -2,10 +2,10 @@ import { Metadata } from "next";
import { Suspense } from "react";
import { I18nProvider } from "@/i18n";
import { fetchProjects } from "@/app/api/projects";
import GenerateEX02ProjectCashFlowReport from "@/components/GenerateEX02ProjectCashFlowReport";
import GenerateProjectCashFlowReport from "@/components/GenerateProjectCashFlowReport";

export const metadata: Metadata = {
title: "EX02 - Project Cash Flow Report",
title: "Project Cash Flow Report",
};

const ProjectCashFlowReport: React.FC = async () => {
@@ -14,8 +14,8 @@ const ProjectCashFlowReport: React.FC = async () => {
return (
<>
<I18nProvider namespaces={["report", "common"]}>
<Suspense fallback={<GenerateEX02ProjectCashFlowReport.Loading />}>
<GenerateEX02ProjectCashFlowReport />
<Suspense fallback={<GenerateProjectCashFlowReport.Loading />}>
<GenerateProjectCashFlowReport />
</Suspense>
</I18nProvider>
</>

+ 3
- 3
src/app/api/reports/actions.ts 파일 보기

@@ -1,7 +1,7 @@
"use server";

import { serverFetchBlob, serverFetchJson } from "@/app/utils/fetchUtil";
import { EX02ProjectCashFlowReportRequest } from ".";
import { ProjectCashFlowReportRequest } from ".";
import { BASE_API_URL } from "@/config/api";

export interface FileResponse {
@@ -9,9 +9,9 @@ export interface FileResponse {
blobValue: Uint8Array;
}

export const fetchEX02ProjectCashFlowReport = async (data: EX02ProjectCashFlowReportRequest) => {
export const fetchProjectCashFlowReport = async (data: ProjectCashFlowReportRequest) => {
const reportBlob = await serverFetchBlob<FileResponse>(
`${BASE_API_URL}/reports/EX02-ProjectCashFlowReport`,
`${BASE_API_URL}/reports/ProjectCashFlowReport`,
{
method: "POST",
body: JSON.stringify(data),


+ 3
- 3
src/app/api/reports/index.ts 파일 보기

@@ -1,8 +1,8 @@
// EX02 - Project Cash Flow Report
export interface EX02ProjectCashFlowReportFilter {
// - Project Cash Flow Report
export interface ProjectCashFlowReportFilter {
project: string[];
}

export interface EX02ProjectCashFlowReportRequest {
export interface ProjectCashFlowReportRequest {
projectId: number;
}

+ 1
- 1
src/components/Breadcrumb/Breadcrumb.tsx 파일 보기

@@ -29,7 +29,7 @@ const pathToLabelMap: { [path: string]: string } = {
"/settings/position": "Position",
"/settings/position/new": "Create Position",
"/settings/salarys": "Salary",
"/analytics/EX02ProjectCashFlowReport": "EX02 - Project Cash Flow Report",
"/analytics/ProjectCashFlowReport": "Project Cash Flow Report",
};

const Breadcrumb = () => {


+ 0
- 18
src/components/GenerateEX02ProjectCashFlowReport/GenerateEX02ProjectCashFlowReportWrapper.tsx 파일 보기

@@ -1,18 +0,0 @@
import React from "react";
import GenerateEX02ProjectCashFlowReportLoading from "./GenerateEX02ProjectCashFlowReportLoading";
import { fetchProjects } from "@/app/api/projects";
import GenerateEX02ProjectCashFlowReport from "./GenerateEX02ProjectCashFlowReport";

interface SubComponents {
Loading: typeof GenerateEX02ProjectCashFlowReportLoading;
}

const GenerateEX02ProjectCashFlowReportWrapper: React.FC & SubComponents = async () => {
const projects = await fetchProjects();

return <GenerateEX02ProjectCashFlowReport projects={projects} />;
};

GenerateEX02ProjectCashFlowReportWrapper.Loading = GenerateEX02ProjectCashFlowReportLoading;

export default GenerateEX02ProjectCashFlowReportWrapper;

+ 0
- 1
src/components/GenerateEX02ProjectCashFlowReport/index.ts 파일 보기

@@ -1 +0,0 @@
export { default } from "./GenerateEX02ProjectCashFlowReportWrapper";

src/components/GenerateEX02ProjectCashFlowReport/GenerateEX02ProjectCashFlowReport.tsx → src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx 파일 보기

@@ -4,8 +4,8 @@ import React, { useMemo } from "react";
import SearchBox, { Criterion } from "../SearchBox";
import { useTranslation } from "react-i18next";
import { ProjectResult } from "@/app/api/projects";
import { EX02ProjectCashFlowReportFilter } from "@/app/api/reports";
import { fetchEX02ProjectCashFlowReport } from "@/app/api/reports/actions";
import { ProjectCashFlowReportFilter } from "@/app/api/reports";
import { fetchProjectCashFlowReport } from "@/app/api/reports/actions";
import { downloadFile } from "@/app/utils/commonUtil";
import { BASE_API_URL } from "@/config/api";

@@ -13,10 +13,10 @@ interface Props {
projects: ProjectResult[];
}

type SearchQuery = Partial<Omit<EX02ProjectCashFlowReportFilter, "id">>;
type SearchQuery = Partial<Omit<ProjectCashFlowReportFilter, "id">>;
type SearchParamNames = keyof SearchQuery;

const GenerateEX02ProjectCashFlowReport: React.FC<Props> = ({ projects }) => {
const GenerateProjectCashFlowReport: React.FC<Props> = ({ projects }) => {
const { t } = useTranslation();
const projectCombo = projects.map(project => `${project.code} - ${project.name}`)

@@ -35,7 +35,7 @@ const GenerateEX02ProjectCashFlowReport: React.FC<Props> = ({ projects }) => {

if (query.project.length > 0 && query.project.toLocaleLowerCase() !== "all") {
const projectIndex = projectCombo.findIndex(project => project === query.project)
const response = await fetchEX02ProjectCashFlowReport({ projectId: projects[projectIndex].id })
const response = await fetchProjectCashFlowReport({ projectId: projects[projectIndex].id })
if (response) {
downloadFile(new Uint8Array(response.blobValue), response.filename!!)
}
@@ -46,4 +46,4 @@ const GenerateEX02ProjectCashFlowReport: React.FC<Props> = ({ projects }) => {
);
};

export default GenerateEX02ProjectCashFlowReport;
export default GenerateProjectCashFlowReport;

src/components/GenerateEX02ProjectCashFlowReport/GenerateEX02ProjectCashFlowReportLoading.tsx → src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReportLoading.tsx 파일 보기

@@ -5,7 +5,7 @@ import Stack from "@mui/material/Stack";
import React from "react";

// Can make this nicer
export const GenerateEX02ProjectCashFlowReportLoading: React.FC = () => {
export const GenerateProjectCashFlowReportLoading: React.FC = () => {
return (
<>
<Card>
@@ -35,4 +35,4 @@ export const GenerateEX02ProjectCashFlowReportLoading: React.FC = () => {
);
};

export default GenerateEX02ProjectCashFlowReportLoading;
export default GenerateProjectCashFlowReportLoading;

+ 18
- 0
src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReportWrapper.tsx 파일 보기

@@ -0,0 +1,18 @@
import React from "react";
import GenerateProjectCashFlowReportLoading from "./GenerateProjectCashFlowReportLoading";
import { fetchProjects } from "@/app/api/projects";
import GenerateProjectCashFlowReport from "./GenerateProjectCashFlowReport";

interface SubComponents {
Loading: typeof GenerateProjectCashFlowReportLoading;
}

const GenerateProjectCashFlowReportWrapper: React.FC & SubComponents = async () => {
const projects = await fetchProjects();

return <GenerateProjectCashFlowReport projects={projects} />;
};

GenerateProjectCashFlowReportWrapper.Loading = GenerateProjectCashFlowReportLoading;

export default GenerateProjectCashFlowReportWrapper;

+ 1
- 0
src/components/GenerateProjectCashFlowReport/index.ts 파일 보기

@@ -0,0 +1 @@
export { default } from "./GenerateProjectCashFlowReportWrapper";

+ 1
- 1
src/components/NavigationContent/NavigationContent.tsx 파일 보기

@@ -118,7 +118,7 @@ const navigationItems: NavigationItem[] = [
{icon: <Analytics />, label:"Project Claims Report", path: "/analytics/ProjectClaimsReport"},
{icon: <Analytics />, label:"Project P&L Report", path: "/analytics/ProjectPLReport"},
{icon: <Analytics />, label:"Financial Status Report", path: "/analytics/FinancialStatusReport"},
{icon: <Analytics />, label:"EX02 - Project Cash Flow Report", path: "/analytics/EX02ProjectCashFlowReport"},
{icon: <Analytics />, label:"Project Cash Flow Report", path: "/analytics/ProjectCashFlowReport"},
],
},
{


불러오는 중...
취소
저장