@appcorp/fusion-storybook 0.4.45 → 0.4.47
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.
|
@@ -821,15 +821,15 @@ export const useAdmissionModule = () => {
|
|
|
821
821
|
// ============================================================================
|
|
822
822
|
// 1.4.9 EFFECTS
|
|
823
823
|
// ============================================================================
|
|
824
|
+
useEffect(() => {
|
|
825
|
+
listFetchNowRef.current = listFetchNow;
|
|
826
|
+
}, [listFetchNow]);
|
|
824
827
|
useEffect(() => {
|
|
825
828
|
var _a;
|
|
826
829
|
if (!(workspace === null || workspace === void 0 ? void 0 : workspace.id))
|
|
827
830
|
return;
|
|
828
831
|
(_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
|
|
829
832
|
}, [listParams, workspace === null || workspace === void 0 ? void 0 : workspace.id]);
|
|
830
|
-
useEffect(() => {
|
|
831
|
-
listFetchNowRef.current = listFetchNow;
|
|
832
|
-
}, [listFetchNow]);
|
|
833
833
|
// ============================================================================
|
|
834
834
|
// 1.4.10 RETURN
|
|
835
835
|
// ============================================================================
|
|
@@ -49,18 +49,24 @@ export const BulkOperationsView = () => {
|
|
|
49
49
|
return [];
|
|
50
50
|
return [...res.items].sort((a, b) => {
|
|
51
51
|
var _a, _b;
|
|
52
|
-
const order = {
|
|
52
|
+
const order = {
|
|
53
|
+
error: 0,
|
|
54
|
+
skipped: 1,
|
|
55
|
+
success: 2,
|
|
56
|
+
};
|
|
53
57
|
return ((_a = order[a.status]) !== null && _a !== void 0 ? _a : 3) - ((_b = order[b.status]) !== null && _b !== void 0 ? _b : 3);
|
|
54
58
|
});
|
|
55
59
|
}, [results]);
|
|
56
60
|
if (!jobId)
|
|
57
61
|
return null;
|
|
58
62
|
const fmt = (v) => v ? formatDate(v, DATE_FORMATS.LOCALE_DATE) : "—";
|
|
59
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ClipboardList, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionJobDetails") })] }), _jsx(CardDescription, { children: t("viewSectionJobDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldJobId") }), _jsx("p", { className: "font-mono text-
|
|
63
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ClipboardList, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionJobDetails") })] }), _jsx(CardDescription, { children: t("viewSectionJobDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldJobId") }), _jsx("p", { className: "text-right font-mono text-sm break-all", children: jobId })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldType") }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Layers, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-right text-sm", children: type })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: (_a = STATUS_VARIANT[status !== null && status !== void 0 ? status : "queued"]) !== null && _a !== void 0 ? _a : "secondary", children: status || "—" })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldExpiresIn") }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Timer, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-right text-sm", children: ttlSeconds != null ? formatSecs(ttlSeconds) : "—" })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldProgress") }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ListChecks, { className: "text-muted-foreground h-4 w-4" }), _jsxs("p", { className: "text-right text-sm", children: [processed !== null && processed !== void 0 ? processed : 0, " / ", total !== null && total !== void 0 ? total : 0] })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCreated") }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-right text-sm", children: fmt(createdAt) })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldUpdated") }), _jsx("p", { className: "text-right text-sm", children: fmt(updatedAt) })] }), webhookUrl ? (_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldWebhook") }), _jsx("p", { className: "text-right text-sm break-all", children: webhookUrl })] })) : null] }) })] }), jobResults ? (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ListChecks, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionResults") })] }), _jsx(CardDescription, { children: t("viewSectionResultsDescription") })] }), _jsx(Separator, {}), _jsxs(CardContent, { className: "pt-6", children: [_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTotal") }), _jsx("p", { className: "text-right text-sm", children: (_b = jobResults.total) !== null && _b !== void 0 ? _b : 0 })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 text-green-600" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCreated") })] }), _jsx("p", { className: "text-right text-sm", children: (_c = jobResults.created) !== null && _c !== void 0 ? _c : 0 })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 text-blue-600" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldUpdated") })] }), _jsx("p", { className: "text-right text-sm", children: (_d = jobResults.updated) !== null && _d !== void 0 ? _d : 0 })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSkipped") }), _jsx("p", { className: "text-right text-sm", children: (_e = jobResults.skipped) !== null && _e !== void 0 ? _e : 0 })] }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(XCircle, { className: "h-4 w-4 text-red-600" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldErrors") })] }), _jsx("p", { className: "text-right text-sm", children: (_g = (_f = jobResults.errors) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0 })] })] }), jobResults.errors && jobResults.errors.length > 0 ? (_jsxs("div", { className: "mt-4 space-y-2", children: [jobResults.errors.slice(0, 5).map((err, i) => {
|
|
60
64
|
var _a;
|
|
61
65
|
return (_jsxs("div", { className: "bg-destructive/10 text-destructive rounded-md px-3 py-2 text-xs", children: [_jsxs("span", { className: "font-medium", children: ["Row ", (_a = err.row) !== null && _a !== void 0 ? _a : "?", err.studentProfileId ? ` • ${err.studentProfileId}` : "", ":"] }), " ", err.error] }, i));
|
|
62
|
-
}), jobResults.errors.length > 5 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewErrorsMore", {
|
|
66
|
+
}), jobResults.errors.length > 5 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewErrorsMore", {
|
|
67
|
+
count: jobResults.errors.length - 5,
|
|
68
|
+
}) })) : null] })) : null] })] })) : null, sortedItems.length > 0 ? (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionItemResults") })] }), _jsx(CardDescription, { children: t("viewSectionItemResultsDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx(Accordion, { type: "multiple", className: "w-full", children: sortedItems.map((item) => {
|
|
63
69
|
var _a, _b, _c;
|
|
64
|
-
return (_jsxs(AccordionItem, { value: item.computerNumber, className: `border-l-4 ${(_a = ITEM_BORDER_COLOR[item.status]) !== null && _a !== void 0 ? _a : ""}`, children: [_jsx(AccordionTrigger, { className: "py-3 hover:no-underline", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "text-sm font-medium", children: [t("viewItemComputerNumber"), " ", item.computerNumber] }), _jsx(Badge, { variant: (_b = ITEM_STATUS_VARIANT[item.status]) !== null && _b !== void 0 ? _b : "secondary", children: t((_c = ITEM_STATUS_I18N[item.status]) !== null && _c !== void 0 ? _c : item.status) })] }) }), _jsx(AccordionContent, { className: "pb-4", children: _jsxs("div", { className: "space-y-4 pl-1", children: [_jsx("p", { className: "text-
|
|
70
|
+
return (_jsxs(AccordionItem, { value: item.computerNumber, className: `mb-2 border-l-4 px-4 ${(_a = ITEM_BORDER_COLOR[item.status]) !== null && _a !== void 0 ? _a : ""}`, children: [_jsx(AccordionTrigger, { className: "py-3 hover:no-underline", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "text-sm font-medium", children: [t("viewItemComputerNumber"), " ", item.computerNumber] }), _jsx(Badge, { variant: (_b = ITEM_STATUS_VARIANT[item.status]) !== null && _b !== void 0 ? _b : "secondary", children: t((_c = ITEM_STATUS_I18N[item.status]) !== null && _c !== void 0 ? _c : item.status) })] }) }), _jsx(AccordionContent, { className: "pb-4", children: _jsxs("div", { className: "space-y-4 pl-1", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: item.reason }), _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [_jsxs("div", { className: "bg-muted/50 rounded-md p-2 text-center", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewItemPendingMarkedPaid") }), _jsx("p", { className: "text-sm font-medium", children: item.pendingMarkedPaid })] }), _jsxs("div", { className: "bg-muted/50 rounded-md p-2 text-center", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewItemPaidAtUpdated") }), _jsx("p", { className: "text-sm font-medium", children: item.paidAtUpdated })] }), _jsxs("div", { className: "bg-muted/50 rounded-md p-2 text-center", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewItemSameDaySkipped") }), _jsx("p", { className: "text-sm font-medium", children: item.sameDaySkipped })] })] }), item.fees && item.fees.length > 0 ? (_jsxs("div", { children: [_jsx("p", { className: "text-muted-foreground mb-2 text-xs font-semibold tracking-wide uppercase", children: t("viewItemFees") }), _jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b text-left", children: [_jsx("th", { className: "text-muted-foreground px-3 py-2 text-xs font-medium", children: t("viewItemFeeId") }), _jsx("th", { className: "text-muted-foreground px-3 py-2 text-xs font-medium", children: t("viewItemFeeDueDate") }), _jsx("th", { className: "text-muted-foreground px-3 py-2 text-xs font-medium", children: t("viewItemFeeAmount") }), _jsx("th", { className: "text-muted-foreground px-3 py-2 text-xs font-medium", children: t("viewItemFeeFine") }), _jsx("th", { className: "text-muted-foreground px-3 py-2 text-xs font-medium", children: t("viewItemFeeAction") })] }) }), _jsx("tbody", { children: item.fees.map((fee) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-xs", children: fee.feeId }), _jsx("td", { className: "px-3 py-2", children: fee.dueDate }), _jsx("td", { className: "px-3 py-2", children: fee.amount }), _jsx("td", { className: "px-3 py-2", children: fee.fine }), _jsx("td", { className: "px-3 py-2", children: fee.action })] }, fee.feeId))) })] }) })] })) : null] }) })] }, item.computerNumber));
|
|
65
71
|
}) }) })] })) : null] }));
|
|
66
72
|
};
|