@appcorp/fusion-storybook 0.2.55 → 0.2.56
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/more-actions.js +2 -2
- package/base-modules/course/form.js +4 -4
- package/base-modules/enrollment/form.js +3 -3
- package/base-modules/fee-structure/form.js +2 -2
- package/base-modules/section/form.js +2 -2
- package/base-modules/student-fee/form.js +2 -2
- package/base-modules/workspace/form.js +2 -2
- package/constants.d.ts +3 -0
- package/constants.js +3 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -4,7 +4,7 @@ import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox
|
|
|
4
4
|
import { EnhancedRadio } from "@appcorp/shadcn/components/enhanced-radio";
|
|
5
5
|
import { EnhancedTextarea } from "@appcorp/shadcn/components/enhanced-textarea";
|
|
6
6
|
import { useState } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { COURSE_API_ROUTES } from "../../constants";
|
|
8
8
|
export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labelCourseInfo, labelCoursePlaceholder, labelNoCourseFound, labelRemarks, labelRemarksInfo, labelRemarksPlaceholder, labelSearchCourses, labelStatusAbsent, labelStatusExcused, labelStatusHalfDay, labelStatusLate, labelStatusPresent, }) => {
|
|
9
9
|
// const enrollment = getCachedEnrollmentsSync().items;
|
|
10
10
|
// const studentProfiles = getCachedStudentProfilesSync().items;
|
|
@@ -25,7 +25,7 @@ export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labe
|
|
|
25
25
|
})),
|
|
26
26
|
placeholder: labelCoursePlaceholder,
|
|
27
27
|
required: true,
|
|
28
|
-
searchEndpoint:
|
|
28
|
+
searchEndpoint: COURSE_API_ROUTES.UNIT,
|
|
29
29
|
searchPlaceholder: labelSearchCourses,
|
|
30
30
|
formatSearchResult: (item) => {
|
|
31
31
|
var _a, _b;
|
|
@@ -10,7 +10,7 @@ import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
|
|
|
10
10
|
import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
|
|
11
11
|
import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox";
|
|
12
12
|
import { useCourseModule } from "./context";
|
|
13
|
-
import {
|
|
13
|
+
import { SECTION_API_ROUTES, SUBJECT_API_ROUTES, TEACHER_API_ROUTES, } from "../../constants";
|
|
14
14
|
import { useTranslations } from "next-intl";
|
|
15
15
|
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
16
16
|
import { API_METHODS } from "@react-pakistan/util-functions";
|
|
@@ -53,7 +53,7 @@ export const CourseForm = () => {
|
|
|
53
53
|
}),
|
|
54
54
|
placeholder: t("sectionPlaceholder"),
|
|
55
55
|
required: true,
|
|
56
|
-
searchEndpoint:
|
|
56
|
+
searchEndpoint: SECTION_API_ROUTES.UNIT,
|
|
57
57
|
searchPlaceholder: t("formSearchSectionsPlaceholder"),
|
|
58
58
|
formatSearchResult: (item) => {
|
|
59
59
|
var _a, _b;
|
|
@@ -80,7 +80,7 @@ export const CourseForm = () => {
|
|
|
80
80
|
})),
|
|
81
81
|
placeholder: t("formSubjectPlaceholder"),
|
|
82
82
|
required: true,
|
|
83
|
-
searchEndpoint:
|
|
83
|
+
searchEndpoint: SUBJECT_API_ROUTES.UNIT,
|
|
84
84
|
searchPlaceholder: t("formSearchSubjectsPlaceholder"),
|
|
85
85
|
formatSearchResult: (item) => {
|
|
86
86
|
var _a, _b;
|
|
@@ -113,7 +113,7 @@ export const CourseForm = () => {
|
|
|
113
113
|
})),
|
|
114
114
|
placeholder: t("formTeacherPlaceholder"),
|
|
115
115
|
required: true,
|
|
116
|
-
searchEndpoint:
|
|
116
|
+
searchEndpoint: TEACHER_API_ROUTES.UNIT,
|
|
117
117
|
searchPlaceholder: t("formSearchTeachersPlaceholder"),
|
|
118
118
|
formatSearchResult: (item) => {
|
|
119
119
|
var _a, _b;
|
|
@@ -17,7 +17,7 @@ import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
|
17
17
|
import { useEnrollmentModule } from "./context";
|
|
18
18
|
import { getCachedStudentProfilesSync } from "../student-profile/cache";
|
|
19
19
|
import { getCachedSectionsSync } from "../section/cache";
|
|
20
|
-
import {
|
|
20
|
+
import { SECTION_API_ROUTES, STUDENT_FEE_API_ROUTES, } from "../../constants";
|
|
21
21
|
import { useTranslations } from "next-intl";
|
|
22
22
|
// ============================================================================
|
|
23
23
|
// COMPONENT
|
|
@@ -37,7 +37,7 @@ export const EnrollmentForm = () => {
|
|
|
37
37
|
})),
|
|
38
38
|
placeholder: t("formStudentPlaceholder"),
|
|
39
39
|
required: true,
|
|
40
|
-
searchEndpoint:
|
|
40
|
+
searchEndpoint: STUDENT_FEE_API_ROUTES.UNIT,
|
|
41
41
|
searchPlaceholder: t("formSearchStudentsPlaceholder"),
|
|
42
42
|
formatSearchResult: (item) => {
|
|
43
43
|
var _a, _b;
|
|
@@ -63,7 +63,7 @@ export const EnrollmentForm = () => {
|
|
|
63
63
|
}),
|
|
64
64
|
placeholder: t("sectionPlaceholder"),
|
|
65
65
|
required: true,
|
|
66
|
-
searchEndpoint:
|
|
66
|
+
searchEndpoint: SECTION_API_ROUTES.UNIT,
|
|
67
67
|
searchPlaceholder: t("formSearchSectionsPlaceholder"),
|
|
68
68
|
formatSearchResult: (item) => {
|
|
69
69
|
var _a, _b;
|
|
@@ -11,7 +11,7 @@ import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
|
|
|
11
11
|
import { EnhancedTextarea } from "@appcorp/shadcn/components/enhanced-textarea";
|
|
12
12
|
import { useFeeStructureModule } from "./context";
|
|
13
13
|
import { FEE_TYPE_OPTIONS, FREQUENCY_OPTIONS } from "./constants";
|
|
14
|
-
import { FEE_STRUCTURE_API_ROUTES } from "../../constants";
|
|
14
|
+
import { CLASS_API_ROUTES, FEE_STRUCTURE_API_ROUTES } from "../../constants";
|
|
15
15
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
16
16
|
import { useTranslations } from "next-intl";
|
|
17
17
|
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
@@ -101,7 +101,7 @@ export const FeeStructureForm = () => {
|
|
|
101
101
|
label: `${cls.name} (${cls.code})`,
|
|
102
102
|
})),
|
|
103
103
|
placeholder: t("formClassPlaceholder"),
|
|
104
|
-
searchEndpoint:
|
|
104
|
+
searchEndpoint: CLASS_API_ROUTES.UNIT,
|
|
105
105
|
searchPlaceholder: t("formSearchClassPlaceholder"),
|
|
106
106
|
formatSearchResult: (item) => {
|
|
107
107
|
var _a, _b;
|
|
@@ -12,7 +12,7 @@ import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
|
|
|
12
12
|
import { useSectionModule } from "./context";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
14
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
15
|
-
import {
|
|
15
|
+
import { CLASS_API_ROUTES } from "../../constants";
|
|
16
16
|
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
17
17
|
import { API_METHODS } from "@react-pakistan/util-functions";
|
|
18
18
|
export const SectionForm = () => {
|
|
@@ -36,7 +36,7 @@ export const SectionForm = () => {
|
|
|
36
36
|
}))) || [],
|
|
37
37
|
placeholder: t("formClassPlaceholder"),
|
|
38
38
|
required: true,
|
|
39
|
-
searchEndpoint:
|
|
39
|
+
searchEndpoint: CLASS_API_ROUTES.UNIT,
|
|
40
40
|
searchPlaceholder: t("formSearchClassesPlaceholder"),
|
|
41
41
|
formatSearchResult: (item) => {
|
|
42
42
|
var _a, _b;
|
|
@@ -13,7 +13,7 @@ import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox
|
|
|
13
13
|
import { useMemo } from "react";
|
|
14
14
|
import { useStudentFeeModule } from "./context";
|
|
15
15
|
import { PAYMENT_STATUS_OPTIONS } from "./constants";
|
|
16
|
-
import { STUDENT_FEE_API_ROUTES, DISCOUNT_CODE_API_ROUTES, FEE_STRUCTURE_API_ROUTES, } from "../../constants";
|
|
16
|
+
import { STUDENT_FEE_API_ROUTES, DISCOUNT_CODE_API_ROUTES, FEE_STRUCTURE_API_ROUTES, STUDENT_PROFILE_API_ROUTES, } from "../../constants";
|
|
17
17
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
18
18
|
import { API_METHODS, DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions";
|
|
19
19
|
import { DISCOUNT_TYPE, } from "../../type";
|
|
@@ -71,7 +71,7 @@ export const StudentFeeForm = () => {
|
|
|
71
71
|
})),
|
|
72
72
|
placeholder: t("formStudentPlaceholder"),
|
|
73
73
|
required: true,
|
|
74
|
-
searchEndpoint:
|
|
74
|
+
searchEndpoint: STUDENT_PROFILE_API_ROUTES.UNIT,
|
|
75
75
|
searchPlaceholder: t("formSearchStudentsPlaceholder"),
|
|
76
76
|
formatSearchResult: (item) => {
|
|
77
77
|
var _a, _b;
|
|
@@ -13,7 +13,7 @@ import { EnhancedTextarea } from "@appcorp/shadcn/components/enhanced-textarea";
|
|
|
13
13
|
import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox";
|
|
14
14
|
import { Shield, Eye, EyeOff } from "lucide-react";
|
|
15
15
|
import { secretKeys } from "./constants";
|
|
16
|
-
import {
|
|
16
|
+
import { PLAN_API_ROUTES } from "../../constants";
|
|
17
17
|
const SecretsEditor = ({ secrets, errors, onChange, secretPlaceholder, }) => {
|
|
18
18
|
const [visibleMap, setVisibleMap] = useState(() => Object.fromEntries(secretKeys.map((k) => [k, false])));
|
|
19
19
|
const toggle = (key) => setVisibleMap((s) => (Object.assign(Object.assign({}, s), { [key]: !s[key] })));
|
|
@@ -45,7 +45,7 @@ export const WorkspaceForm = () => {
|
|
|
45
45
|
})),
|
|
46
46
|
placeholder: t("formPlanPlaceholder"),
|
|
47
47
|
info: t("formPlanInfo"),
|
|
48
|
-
searchEndpoint:
|
|
48
|
+
searchEndpoint: PLAN_API_ROUTES.UNIT,
|
|
49
49
|
formatSearchResult: (item) => {
|
|
50
50
|
var _a, _b;
|
|
51
51
|
return ({
|
package/constants.d.ts
CHANGED
|
@@ -46,6 +46,9 @@ export declare const FEE_STRUCTURE_API_ROUTES: {
|
|
|
46
46
|
readonly BULK: "/api/v1/fee-structure/bulk";
|
|
47
47
|
readonly BULK_STATUS: (jobId: string) => string;
|
|
48
48
|
};
|
|
49
|
+
export declare const PLAN_API_ROUTES: {
|
|
50
|
+
readonly UNIT: "/api/v1/plan";
|
|
51
|
+
};
|
|
49
52
|
export declare const RBAC_API_ROUTES: Record<string, string>;
|
|
50
53
|
export declare const SCHOOL_API_ROUTES: Record<string, string>;
|
|
51
54
|
export declare const SECTION_API_ROUTES: {
|
package/constants.js
CHANGED
|
@@ -53,6 +53,9 @@ export const FEE_STRUCTURE_API_ROUTES = {
|
|
|
53
53
|
BULK: "/api/v1/fee-structure/bulk",
|
|
54
54
|
BULK_STATUS: (jobId) => `/api/v1/fee-structure/bulk/${jobId}`,
|
|
55
55
|
};
|
|
56
|
+
export const PLAN_API_ROUTES = {
|
|
57
|
+
UNIT: "/api/v1/plan",
|
|
58
|
+
};
|
|
56
59
|
export const RBAC_API_ROUTES = {
|
|
57
60
|
UNIT: "/api/v1/role",
|
|
58
61
|
PERMISSIONS_LIST: "/api/v1/permission",
|