@appcorp/fusion-storybook 0.3.57 → 0.3.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -631,44 +631,25 @@ export const useStudentFeeModule = () => {
|
|
|
631
631
|
// 1.4.8 HEADER & ROW ACTIONS
|
|
632
632
|
// ============================================================================
|
|
633
633
|
const headerActions = useMemo(() => [
|
|
634
|
-
{
|
|
635
|
-
enabled: true,
|
|
636
|
-
handleOnClick: handleCreateMonthly,
|
|
637
|
-
label: t("actionsButtonCreateMonthly"),
|
|
638
|
-
order: 1,
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
enabled: true,
|
|
642
|
-
handleOnClick: handleCreateSingleEntry,
|
|
643
|
-
label: t("actionsButtonSingleEntry"),
|
|
644
|
-
order: 2,
|
|
645
|
-
},
|
|
646
634
|
{
|
|
647
635
|
enabled: true,
|
|
648
636
|
handleOnClick: handleMoreActions,
|
|
649
637
|
label: t("actionsButtonMoreActions"),
|
|
650
|
-
order:
|
|
638
|
+
order: 1,
|
|
651
639
|
},
|
|
652
640
|
{
|
|
653
641
|
enabled: true,
|
|
654
642
|
handleOnClick: handleFilters,
|
|
655
643
|
label: t("actionsButtonFilters"),
|
|
656
|
-
order:
|
|
644
|
+
order: 2,
|
|
657
645
|
},
|
|
658
646
|
{
|
|
659
647
|
enabled: true,
|
|
660
648
|
handleOnClick: handleCreate,
|
|
661
649
|
label: t("actionsButtonAdd"),
|
|
662
|
-
order:
|
|
650
|
+
order: 3,
|
|
663
651
|
},
|
|
664
|
-
], [
|
|
665
|
-
handleCreateMonthly,
|
|
666
|
-
handleCreateSingleEntry,
|
|
667
|
-
handleMoreActions,
|
|
668
|
-
handleFilters,
|
|
669
|
-
handleCreate,
|
|
670
|
-
t,
|
|
671
|
-
]);
|
|
652
|
+
], [handleMoreActions, handleFilters, handleCreate, t]);
|
|
672
653
|
const rowActions = useMemo(() => [
|
|
673
654
|
{
|
|
674
655
|
enabled: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { downloadFromUrl } from "@react-pakistan/util-functions/general/download-from-url";
|
|
4
4
|
import { showErrorToast, showSuccessToast, showInfoToast, } from "@appcorp/shadcn/lib/toast-utils";
|
|
5
5
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
@@ -7,14 +7,16 @@ import converter from "json-2-csv";
|
|
|
7
7
|
import { Timeline } from "../../components/timeline";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
9
9
|
import { STUDENT_FEE_API_ROUTES } from "../../constants";
|
|
10
|
-
import { STUDENT_FEE_ACTION_TYPES,
|
|
10
|
+
import { STUDENT_FEE_ACTION_TYPES, useStudentFeeModule } from "./context";
|
|
11
11
|
import { useRef, useEffect, useCallback } from "react";
|
|
12
|
+
import { Button } from "@appcorp/shadcn/components/ui/button";
|
|
13
|
+
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
12
14
|
const workspace = getCachedWorkspaceSync();
|
|
13
15
|
const POLL_INTERVAL_MS = 2000;
|
|
14
16
|
const POLL_TIMEOUT_MS = 300000;
|
|
15
17
|
const PAGE_LIMIT = 5000;
|
|
16
18
|
const handleGetAllRecords = async (schoolId, pageLimit) => {
|
|
17
|
-
const response = await fetch(`${STUDENT_FEE_API_ROUTES.UNIT}?pageLimit=${pageLimit}¤tPage=1&schoolId=${schoolId}
|
|
19
|
+
const response = await fetch(`${STUDENT_FEE_API_ROUTES.UNIT}?pageLimit=${pageLimit}¤tPage=1&schoolId=${schoolId}&studentComputerNumber=true`);
|
|
18
20
|
const result = await response.json();
|
|
19
21
|
const csv = await converter.json2csv(result.items || [], {});
|
|
20
22
|
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
@@ -82,7 +84,7 @@ t, errors) {
|
|
|
82
84
|
}
|
|
83
85
|
export const StudentFeeMoreActions = () => {
|
|
84
86
|
const t = useTranslations("studentFee");
|
|
85
|
-
const { dispatch } =
|
|
87
|
+
const { dispatch, handleCreateMonthly, handleCreateSingleEntry } = useStudentFeeModule();
|
|
86
88
|
const abortRef = useRef(null);
|
|
87
89
|
useEffect(() => {
|
|
88
90
|
return () => {
|
|
@@ -230,5 +232,5 @@ export const StudentFeeMoreActions = () => {
|
|
|
230
232
|
title: t("uploadTheCompletedCsvToTheSystem"),
|
|
231
233
|
},
|
|
232
234
|
];
|
|
233
|
-
return (
|
|
235
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Button, { disabled: new Date().getDate() !== 1, onClick: handleCreateMonthly, children: t('actionsButtonCreateMonthly') }), _jsx(Button, { onClick: handleCreateSingleEntry, children: t('actionsButtonSingleEntry') }), _jsx(Separator, {}), _jsx(Timeline, { events: update, heading: t("bulkUpdate"), handleOnBulkCreate: handleBulkUpdate })] }));
|
|
234
236
|
};
|