@appcorp/fusion-storybook 0.4.64 → 0.4.66

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.
@@ -37,6 +37,18 @@ const ITEM_STATUS_I18N = {
37
37
  skipped: "viewItemStatusSkipped",
38
38
  success: "viewItemStatusSuccess",
39
39
  };
40
+ const RECORD_ACTION_VARIANT = {
41
+ created: "default",
42
+ skipped: "outline",
43
+ updated: "secondary",
44
+ };
45
+ const ATTENDANCE_STATUS_VARIANT = {
46
+ ABSENT: "destructive",
47
+ EXCUSED: "secondary",
48
+ HALF_DAY: "outline",
49
+ LATE: "outline",
50
+ PRESENT: "default",
51
+ };
40
52
  export const BulkOperationsView = () => {
41
53
  var _a, _b, _c, _d, _e, _f, _g;
42
54
  const { state } = useBulkOperationsContext();
@@ -65,8 +77,15 @@ export const BulkOperationsView = () => {
65
77
  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));
66
78
  }), jobResults.errors.length > 5 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewErrorsMore", {
67
79
  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) => {
69
- var _a, _b, _c;
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));
71
- }) }) })] })) : null] }));
80
+ }) })) : 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: type === "bulk-attendance-write"
81
+ ? sortedItems.map((item) => {
82
+ var _a, _b, _c, _d, _e, _f;
83
+ const att = item;
84
+ return (_jsxs(AccordionItem, { value: att.studentName, className: `mb-2 border-l-4 px-4 ${(_a = ITEM_BORDER_COLOR[att.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: [_jsx("span", { className: "text-sm font-medium", children: att.studentName }), _jsx(Badge, { variant: (_b = ATTENDANCE_STATUS_VARIANT[att.attendanceStatus]) !== null && _b !== void 0 ? _b : "secondary", children: att.attendanceStatus }), _jsx(Badge, { variant: (_c = ITEM_STATUS_VARIANT[att.status]) !== null && _c !== void 0 ? _c : "secondary", children: t((_d = ITEM_STATUS_I18N[att.status]) !== null && _d !== void 0 ? _d : att.status) })] }) }), _jsx(AccordionContent, { className: "pb-4", children: _jsxs("div", { className: "space-y-3 pl-1", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: att.reason }), _jsxs("div", { className: "grid grid-cols-2 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("viewItemRecordAction") }), _jsx(Badge, { variant: (_e = RECORD_ACTION_VARIANT[att.recordAction]) !== null && _e !== void 0 ? _e : "secondary", className: "mt-1", children: att.recordAction })] }), _jsxs("div", { className: "bg-muted/50 rounded-md p-2 text-center", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t("viewItemAttendanceStatus") }), _jsx(Badge, { variant: (_f = ATTENDANCE_STATUS_VARIANT[att.attendanceStatus]) !== null && _f !== void 0 ? _f : "secondary", className: "mt-1", children: att.attendanceStatus })] })] }), att.studentProfileId ? (_jsxs("div", { className: "bg-muted/50 rounded-md p-2", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: "Student Profile ID" }), _jsx("p", { className: "font-mono text-xs break-all", children: att.studentProfileId })] })) : null, att.error ? (_jsxs("div", { className: "bg-destructive/10 rounded-md p-2", children: [_jsx("p", { className: "text-destructive text-xs font-medium", children: "Error" }), _jsx("p", { className: "text-destructive text-xs", children: att.error })] })) : null] }) })] }, att.studentName));
85
+ })
86
+ : sortedItems.map((item) => {
87
+ var _a, _b, _c;
88
+ const fee = item;
89
+ return (_jsxs(AccordionItem, { value: fee.computerNumber, className: `mb-2 border-l-4 px-4 ${(_a = ITEM_BORDER_COLOR[fee.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"), " ", fee.computerNumber] }), _jsx(Badge, { variant: (_b = ITEM_STATUS_VARIANT[fee.status]) !== null && _b !== void 0 ? _b : "secondary", children: t((_c = ITEM_STATUS_I18N[fee.status]) !== null && _c !== void 0 ? _c : fee.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: fee.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: fee.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: fee.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: fee.sameDaySkipped })] })] }), fee.fees && fee.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: fee.fees.map((f) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-xs", children: f.feeId }), _jsx("td", { className: "px-3 py-2", children: f.dueDate }), _jsx("td", { className: "px-3 py-2", children: f.amount }), _jsx("td", { className: "px-3 py-2", children: f.fine }), _jsx("td", { className: "px-3 py-2", children: f.action })] }, f.feeId))) })] }) })] })) : null] }) })] }, fee.computerNumber));
90
+ }) }) })] })) : null] }));
72
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.4.64",
3
+ "version": "0.4.66",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",