@appcorp/fusion-storybook 0.5.9 → 0.5.13
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/base-modules/attendance/context/use-attendance-module.d.ts +60 -0
- package/base-modules/attendance/context/use-attendance-module.js +449 -0
- package/base-modules/attendance/context.d.ts +36 -52
- package/base-modules/attendance/context.js +22 -376
- package/base-modules/attendance/date.d.ts +10 -0
- package/base-modules/attendance/date.js +23 -0
- package/base-modules/attendance/filter.js +22 -6
- package/base-modules/attendance/form.js +53 -42
- package/base-modules/attendance/more-actions.js +10 -233
- package/base-modules/attendance/page.js +45 -31
- package/base-modules/attendance/validate.d.ts +3 -1
- package/base-modules/attendance/validate.js +7 -2
- package/base-modules/attendance/view.js +18 -9
- package/base-modules/campus/context/use-campus-module.d.ts +57 -0
- package/base-modules/campus/context/use-campus-module.js +447 -0
- package/base-modules/campus/context.d.ts +21 -54
- package/base-modules/campus/context.js +18 -442
- package/base-modules/campus/filter.js +1 -1
- package/base-modules/campus/form.js +6 -4
- package/base-modules/campus/page.d.ts +0 -2
- package/base-modules/campus/page.js +10 -18
- package/base-modules/campus/validate.js +4 -1
- package/base-modules/campus/view.js +2 -2
- package/constants.d.ts +3 -3
- package/constants.js +0 -2
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/user-management.d.ts +0 -1
- package/utils/resolve-rbac-permissions.js +5 -4
- package/base-modules/campus/more-actions.d.ts +0 -1
- package/base-modules/campus/more-actions.js +0 -40
|
@@ -15,9 +15,9 @@ import { formatValue } from "@react-pakistan/util-functions/general/format-value
|
|
|
15
15
|
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
16
16
|
export const CampusView = () => {
|
|
17
17
|
const { state } = useCampusModule();
|
|
18
|
-
const { address, city, code, country, enabled, name, phone, state: campusState, } = state;
|
|
18
|
+
const { address, city, code, country, classCount, enabled, name, phone, state: campusState, studentCount, teacherCount, } = state;
|
|
19
19
|
const t = useTranslations("campus");
|
|
20
20
|
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(Building2, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _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("viewSectionCampusDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCampusInformation") })] }), _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: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAddress") }), _jsx("p", { className: "text-base", children: formatValue(address) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCity") }), _jsx("p", { className: "text-base", children: formatValue(city) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldState") }), _jsx("p", { className: "text-base", children: formatValue(campusState) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCountry") }), _jsx("p", { className: "text-base", children: formatValue(country) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPhone") }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
21
21
|
? t("viewFieldStatusActive")
|
|
22
|
-
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
22
|
+
: t("viewFieldStatusInactive") })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassesCount") }), _jsx("p", { className: "text-base", children: classCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeachersCount") }), _jsx("p", { className: "text-base", children: teacherCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStudentsCount") }), _jsx("p", { className: "text-base", children: studentCount })] })] }) })] })] }));
|
|
23
23
|
};
|
package/constants.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ export declare const REPORTS_API_ROUTES: {
|
|
|
10
10
|
};
|
|
11
11
|
export declare const ATTENDANCE_API_ROUTES: {
|
|
12
12
|
readonly UNIT: "/api/v1/attendance";
|
|
13
|
-
readonly BULK: "/api/v1/attendance/bulk";
|
|
14
|
-
readonly BULK_STATUS: (jobId: string) => string;
|
|
15
13
|
readonly AUTO_POST: "/api/v1/attendance/auto-post";
|
|
16
14
|
readonly AUTO_POST_STATUS: (jobId: string) => string;
|
|
17
15
|
};
|
|
@@ -25,7 +23,9 @@ export declare const DOCUMENT_UPLOAD_API_ROUTES: {
|
|
|
25
23
|
readonly UNIT: "/api/v1/document-upload";
|
|
26
24
|
};
|
|
27
25
|
export declare const STORAGE_WAKE_URL = "https://storage.edupilotpro.com/";
|
|
28
|
-
export declare const CAMPUS_API_ROUTES:
|
|
26
|
+
export declare const CAMPUS_API_ROUTES: {
|
|
27
|
+
readonly UNIT: "/api/v1/campus";
|
|
28
|
+
};
|
|
29
29
|
export declare const CLASS_API_ROUTES: {
|
|
30
30
|
readonly UNIT: "/api/v1/class";
|
|
31
31
|
readonly BULK: "/api/v1/class/bulk";
|
package/constants.js
CHANGED
|
@@ -13,8 +13,6 @@ export const REPORTS_API_ROUTES = {
|
|
|
13
13
|
// ============================================================================
|
|
14
14
|
export const ATTENDANCE_API_ROUTES = {
|
|
15
15
|
UNIT: "/api/v1/attendance",
|
|
16
|
-
BULK: "/api/v1/attendance/bulk",
|
|
17
|
-
BULK_STATUS: (jobId) => `/api/v1/attendance/bulk/${jobId}`,
|
|
18
16
|
AUTO_POST: "/api/v1/attendance/auto-post",
|
|
19
17
|
AUTO_POST_STATUS: (jobId) => `/api/v1/attendance/auto-post/${jobId}`,
|
|
20
18
|
};
|