@appcorp/fusion-storybook 0.5.39 → 0.6.1
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.
- package/attendance-register/documents/download.d.ts +2 -0
- package/attendance-register/documents/download.js +13 -0
- package/attendance-register/documents/image-text.d.ts +37 -0
- package/attendance-register/documents/image-text.js +103 -0
- package/attendance-register/documents/pdf.d.ts +40 -0
- package/attendance-register/documents/pdf.js +425 -0
- package/attendance-register/documents/zip-files.d.ts +2 -0
- package/attendance-register/documents/zip-files.js +5 -0
- package/attendance-register/documents/zip.d.ts +13 -0
- package/attendance-register/documents/zip.js +29 -0
- package/attendance-register/domain/calendar.d.ts +28 -0
- package/attendance-register/domain/calendar.js +150 -0
- package/attendance-register/domain/locale.d.ts +26 -0
- package/attendance-register/domain/locale.js +87 -0
- package/attendance-register/domain/register.d.ts +50 -0
- package/attendance-register/domain/register.js +116 -0
- package/attendance-register/domain/student-import.d.ts +51 -0
- package/attendance-register/domain/student-import.js +231 -0
- package/attendance-register/domain/week.d.ts +40 -0
- package/attendance-register/domain/week.js +90 -0
- package/attendance-register/index.d.ts +21 -0
- package/attendance-register/index.js +19 -0
- package/attendance-register/react/register-preview.d.ts +34 -0
- package/attendance-register/react/register-preview.js +88 -0
- package/attendance-register/react/use-attendance-register.d.ts +33 -0
- package/attendance-register/react/use-attendance-register.js +106 -0
- package/attendance-register/types.d.ts +90 -0
- package/attendance-register/types.js +22 -0
- package/base-modules/admission/context/use-admission-module.d.ts +3 -0
- package/base-modules/admission/context/use-admission-module.js +41 -5
- package/base-modules/attendance/page.d.ts +2 -0
- package/base-modules/attendance/page.js +21 -1
- package/base-modules/student-profile/context/use-student-profile-module.js +4 -0
- package/base-modules/workspace/context.d.ts +6 -36
- package/base-modules/workspace/context.js +1 -20
- package/base-modules/workspace/view.js +12 -9
- package/constants.d.ts +2 -0
- package/constants.js +2 -0
- package/package.json +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/user-management.d.ts +2 -12
- package/utils/student-usage-api.d.ts +6 -0
- package/utils/student-usage-api.js +16 -0
- package/utils/student-usage.d.ts +20 -0
- package/utils/student-usage.js +40 -0
|
@@ -10,13 +10,14 @@ import { useTranslations } from "next-intl";
|
|
|
10
10
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@appcorp/shadcn/components/ui/card";
|
|
11
11
|
import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
12
12
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
13
|
-
import {
|
|
13
|
+
import { Progress } from "@appcorp/shadcn/components/ui/progress";
|
|
14
|
+
import { Building2, Globe, FileText, Image as LucideImage, CheckCircle2, XCircle, Calendar, CreditCard, Users, GraduationCap, Clock, Shield, } from "lucide-react";
|
|
14
15
|
import { DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions/general/format-date";
|
|
15
16
|
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
16
17
|
import { secretKeys } from "./constants";
|
|
17
18
|
const APP_DOMAIN = process.env.NEXT_PUBLIC_APP_DOMAIN || "edupilotpro.com";
|
|
18
19
|
export const WorkspaceView = () => {
|
|
19
|
-
var _a, _b, _c;
|
|
20
|
+
var _a, _b, _c, _d;
|
|
20
21
|
const { state, workspace } = useWorkspaceModule();
|
|
21
22
|
const t = useTranslations("workspace");
|
|
22
23
|
const appDomain = APP_DOMAIN;
|
|
@@ -39,19 +40,21 @@ export const WorkspaceView = () => {
|
|
|
39
40
|
return "—";
|
|
40
41
|
return interval.charAt(0).toUpperCase() + interval.slice(1).toLowerCase();
|
|
41
42
|
};
|
|
42
|
-
// Helper function to format storage
|
|
43
|
-
const formatStorage = (mb) => {
|
|
44
|
-
if (mb < 1024)
|
|
45
|
-
return `${mb} MB`;
|
|
46
|
-
return `${(mb / 1024).toFixed(1)} GB`;
|
|
47
|
-
};
|
|
48
43
|
return (_jsxs("div", { className: "space-y-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formNameLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.name) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formSubdomainLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.subdomain) }), state.subdomain && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldUrlPrefix"), state.subdomain, ".", appDomain] }))] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDescriptionLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.description) === "—"
|
|
49
44
|
? t("viewTextDescriptionNotProvided")
|
|
50
45
|
: state.description })] }), state.logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LucideImage, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formLogoLabel") })] }), _jsx("div", { className: "mt-2", children: _jsx("img", { src: state.logo, alt: t("viewFieldLogoAlt"), width: 64, height: 64, className: "h-16 w-16 rounded border object-contain", onError: (e) => {
|
|
51
46
|
e.currentTarget.style.display = "none";
|
|
52
47
|
} }) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { variant: state.enabled ? "default" : "destructive", className: "gap-1", children: [state.enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), state.enabled
|
|
53
48
|
? t("viewStatusEnabled")
|
|
54
|
-
: t("viewStatusDisabled")] })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionPlanBilling") })] }), _jsx(CardDescription, { children: t("viewPlanBillingDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanIdLabel") })] }), _jsx("p", { className: "text-base", children: planName })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanStartDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planStartDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanEndDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planEndDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldBillingIntervalLabel") })] }), _jsx("p", { className: "text-base", children: formatBillingInterval(state.billingInterval) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAgreedPriceLabel") })] }), _jsx("p", { className: "text-base", children: formatCurrency(state.agreedPrice, state.agreedCurrency) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCurrencyLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.agreedCurrency) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionUsageStats") })] }), _jsx(CardDescription, { children: t("viewUsageStatsDescription") })] }), _jsx(Separator, {}),
|
|
49
|
+
: t("viewStatusDisabled")] })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionPlanBilling") })] }), _jsx(CardDescription, { children: t("viewPlanBillingDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanIdLabel") })] }), _jsx("p", { className: "text-base", children: planName })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanStartDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planStartDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanEndDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planEndDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldBillingIntervalLabel") })] }), _jsx("p", { className: "text-base", children: formatBillingInterval(state.billingInterval) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAgreedPriceLabel") })] }), _jsx("p", { className: "text-base", children: formatCurrency(state.agreedPrice, state.agreedCurrency) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCurrencyLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.agreedCurrency) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionUsageStats") })] }), _jsx(CardDescription, { children: t("viewUsageStatsDescription") })] }), _jsx(Separator, {}), _jsxs(CardContent, { className: "pt-6", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStudentsLabel") })] }), _jsxs("p", { className: "text-primary mt-1 text-3xl font-bold", children: [state.studentsCount, _jsxs("span", { className: "text-muted-foreground ml-1 text-base font-medium", children: ["/ ", (_d = state.studentLimit) !== null && _d !== void 0 ? _d : t("viewUnlimitedLabel")] })] })] }), _jsx("p", { className: "text-muted-foreground text-sm", children: state.studentLimit === null
|
|
50
|
+
? t("viewUnlimitedDescription")
|
|
51
|
+
: t("viewStudentsRemaining", {
|
|
52
|
+
remaining: Math.max(state.studentLimit - state.studentsCount, 0),
|
|
53
|
+
}) })] }), state.studentLimit !== null && (_jsx(Progress, { className: "mt-4", value: state.studentLimit > 0
|
|
54
|
+
? Math.min(Math.round((state.studentsCount / state.studentLimit) * 100), 100)
|
|
55
|
+
: state.studentsCount > 0
|
|
56
|
+
? 100
|
|
57
|
+
: 0 }))] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionSecrets") })] }), _jsx(CardDescription, { children: t("viewSecretsDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("div", { className: "space-y-4", children: _jsxs("div", { children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx(Shield, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSecretsJsonLabel") })] }), state.secrets ? (_jsx("div", { className: "space-y-2", children: visibleSecrets.length === 0 ? (_jsx("p", { className: "text-muted-foreground italic", children: t("viewFieldNoSecretsConfigured") })) : (visibleSecrets.map(([k, v]) => (_jsxs("div", { className: "bg-muted/10 border-border/60 flex items-center justify-between rounded-md border p-3", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: k }), _jsx("div", { className: "text-foreground/80 text-sm", children: typeof v === "string" && v.length > 0
|
|
55
58
|
? t("viewFieldSecretConfigured")
|
|
56
59
|
: "—" })] }, k)))) })) : (_jsx("p", { className: "text-muted-foreground italic", children: t("viewFieldNoSecretsConfigured") })), _jsx("p", { className: "text-muted-foreground mt-2 text-xs", children: t("viewFieldSecretsHelpText") })] }) }) })] })] }));
|
|
57
60
|
};
|
package/constants.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const ATTENDANCE_API_ROUTES: {
|
|
|
12
12
|
readonly UNIT: "/api/v1/attendance";
|
|
13
13
|
readonly AUTO_POST: "/api/v1/attendance/auto-post";
|
|
14
14
|
readonly AUTO_POST_STATUS: (jobId: string) => string;
|
|
15
|
+
readonly REGISTER: "/api/v1/attendance/register";
|
|
15
16
|
};
|
|
16
17
|
export declare const BULK_OPERATIONS_API_ROUTES: {
|
|
17
18
|
readonly LIST: "/api/v1/bulk-operations";
|
|
@@ -116,6 +117,7 @@ export declare const DASHBOARD_ROUTES: {
|
|
|
116
117
|
AI_ASSISTANT: string;
|
|
117
118
|
AI_ATTENDANCE: string;
|
|
118
119
|
ATTENDANCE: string;
|
|
120
|
+
ATTENDANCE_REGISTER: string;
|
|
119
121
|
BULK_OPERATIONS: string;
|
|
120
122
|
CLASS: string;
|
|
121
123
|
COMMUNICATION: string;
|
package/constants.js
CHANGED
|
@@ -15,6 +15,7 @@ export const ATTENDANCE_API_ROUTES = {
|
|
|
15
15
|
UNIT: "/api/v1/attendance",
|
|
16
16
|
AUTO_POST: "/api/v1/attendance/auto-post",
|
|
17
17
|
AUTO_POST_STATUS: (jobId) => `/api/v1/attendance/auto-post/${jobId}`,
|
|
18
|
+
REGISTER: "/api/v1/attendance/register",
|
|
18
19
|
};
|
|
19
20
|
export const BULK_OPERATIONS_API_ROUTES = {
|
|
20
21
|
LIST: "/api/v1/bulk-operations",
|
|
@@ -129,6 +130,7 @@ export const DASHBOARD_ROUTES = {
|
|
|
129
130
|
AI_ASSISTANT: "/tools/ai-assistant",
|
|
130
131
|
AI_ATTENDANCE: "/tools/ai-attendance",
|
|
131
132
|
ATTENDANCE: "/operational-tracking/attendance",
|
|
133
|
+
ATTENDANCE_REGISTER: "/tools/attendance-register",
|
|
132
134
|
BULK_OPERATIONS: "/apps/bulk-operations",
|
|
133
135
|
CLASS: "/academic-structure/class",
|
|
134
136
|
COMMUNICATION: "/communication",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/fusion-storybook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build-storybook": "storybook build",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -86,10 +86,12 @@
|
|
|
86
86
|
"eslint-config-next": "16",
|
|
87
87
|
"eslint-config-prettier": "^10.1.8",
|
|
88
88
|
"eslint-plugin-prettier": "^5.5.5",
|
|
89
|
+
"fflate": "^0.8.3",
|
|
89
90
|
"husky": "^9.1.7",
|
|
90
91
|
"jest": "^30.3.0",
|
|
91
92
|
"jest-environment-jsdom": "^30.3.0",
|
|
92
93
|
"json-2-csv": "^5.5.10",
|
|
94
|
+
"jspdf": "^4.2.1",
|
|
93
95
|
"libphonenumber-js": "^1.13.3",
|
|
94
96
|
"lint-staged": "^16.4.0",
|
|
95
97
|
"lucide-react": "^1.8.0",
|