Parcourir la source

update project, invoice, search results

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui il y a 1 an
Parent
révision
1e49164f2c
4 fichiers modifiés avec 12 ajouts et 4 suppressions
  1. +7
    -2
      src/components/CreateProject/ProjectTotalFee.tsx
  2. +1
    -0
      src/components/InvoiceSearch/InvoiceSearch.tsx
  3. +1
    -1
      src/components/ProjectSearch/ProjectSearch.tsx
  4. +3
    -1
      src/components/SearchResults/SearchResults.tsx

+ 7
- 2
src/components/CreateProject/ProjectTotalFee.tsx Voir le fichier

@@ -39,12 +39,17 @@ const ProjectTotalFee: React.FC<Props> = ({ taskGroups }) => {
})}
<Divider sx={{ paddingBlockStart: 2 }} />
<Stack direction="row" justifyContent="space-between">
<Typography variant="h6">{t("Project Total Fee")}</Typography>
<Typography variant="h6">{t("Sum of Payment Milestone Fee")}</Typography>
<Typography>{moneyFormatter.format(projectTotal)}</Typography>
</Stack>
<Divider sx={{ paddingBlockStart: 2 }} />
<Stack direction="row" justifyContent="space-between">
<Typography variant="h6">{t("Expected Total Fee")}</Typography>
<Typography>{moneyFormatter.format(expectedTotalFee)}</Typography>
</Stack>
{projectTotal !== expectedTotalFee && (
<Typography variant="caption" color="warning.main" alignSelf="flex-end">
{t("Project total fee should be same as the expected total fee!")}
{t("Sum of Payment Milestone Fee should be same as the expected total fee!")}
</Typography>
)}
</Stack>


+ 1
- 0
src/components/InvoiceSearch/InvoiceSearch.tsx Voir le fichier

@@ -526,6 +526,7 @@ const InvoiceSearch: React.FC<Props> = ({ issuedInvoice, receivedInvoice, invoic
<SearchResults<invoiceList>
items={filteredIvoices}
columns={combinedColumns}
autoRedirectToFirstPage
/>
}
{/* {


+ 1
- 1
src/components/ProjectSearch/ProjectSearch.tsx Voir le fichier

@@ -34,7 +34,7 @@ const ProjectSearch: React.FC<Props> = ({ projects, projectCategories, abilities
label: t("Client name"),
paramName: "client",
type: "autocomplete",
options: uniqBy(projects.map((project) => ({value: project.client, label: project.client})), "value"),
options: uniqBy(projects.map((project) => ({value: project.client, label: project.client})), "value").sort((a, b) => a.value >= b.value ? 1 : -1),
},
{
label: t("Project category"),


+ 3
- 1
src/components/SearchResults/SearchResults.tsx Voir le fichier

@@ -43,6 +43,7 @@ interface Props<T extends ResultWithId> {
items: T[];
columns: Column<T>[];
noWrapper?: boolean;
autoRedirectToFirstPage?: boolean;
}

function isActionColumn<T extends ResultWithId>(
@@ -55,6 +56,7 @@ function SearchResults<T extends ResultWithId>({
items,
columns,
noWrapper,
autoRedirectToFirstPage,
}: Props<T>) {
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
@@ -63,7 +65,7 @@ function SearchResults<T extends ResultWithId>({
// When filtering the seraching critera, update the page to 0
// Please removce when the search Result has error
useEffect(() => {
setPage(0);
if (autoRedirectToFirstPage === true) setPage(0);
}, [items]);

const handleChangePage: TablePaginationProps["onPageChange"] = (


Chargement…
Annuler
Enregistrer