@appcorp/fusion-storybook 0.3.44 → 0.3.46
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/admission/context/use-admission-module.js +4 -1
- package/base-modules/admission/form.js +3 -1
- package/base-modules/admission/more-actions.js +2 -2
- package/base-modules/admission/view.js +1 -1
- package/base-modules/attendance/context.js +2 -1
- package/base-modules/attendance/form.js +3 -3
- package/base-modules/attendance/more-actions.js +1 -1
- package/base-modules/attendance/page.js +1 -1
- package/base-modules/attendance/view.js +2 -2
- package/base-modules/campus/context.js +2 -1
- package/base-modules/campus/more-actions.js +2 -1
- package/base-modules/class/cache.d.ts +3 -3
- package/base-modules/class/cache.js +1 -1
- package/base-modules/class/context.js +2 -1
- package/base-modules/class/more-actions.js +1 -1
- package/base-modules/course/context.js +2 -1
- package/base-modules/course/form.js +1 -1
- package/base-modules/course/more-actions.js +2 -1
- package/base-modules/course/view.js +1 -3
- package/base-modules/discount-code/cache.d.ts +3 -3
- package/base-modules/discount-code/cache.js +1 -1
- package/base-modules/discount-code/context.js +2 -1
- package/base-modules/enrollment/context.js +2 -1
- package/base-modules/enrollment/form.js +4 -3
- package/base-modules/enrollment/more-actions.js +1 -1
- package/base-modules/enrollment/page.js +2 -1
- package/base-modules/enrollment/view.js +3 -3
- package/base-modules/expense/context.js +2 -1
- package/base-modules/expense/more-actions.js +1 -1
- package/base-modules/expense/page.js +1 -1
- package/base-modules/expense/view.js +2 -4
- package/base-modules/family/context.js +2 -1
- package/base-modules/family/more-actions.js +1 -1
- package/base-modules/family-member/context.js +2 -1
- package/base-modules/family-member/more-actions.js +2 -2
- package/base-modules/family-member/view.js +1 -1
- package/base-modules/fee-structure/cache.d.ts +3 -3
- package/base-modules/fee-structure/cache.js +1 -1
- package/base-modules/fee-structure/context.js +2 -1
- package/base-modules/fee-structure/form.js +1 -1
- package/base-modules/fee-structure/more-actions.js +1 -1
- package/base-modules/push-campaign/cache.d.ts +9 -0
- package/base-modules/push-campaign/cache.js +16 -0
- package/base-modules/push-campaign/constants.d.ts +24 -0
- package/base-modules/push-campaign/constants.js +11 -0
- package/base-modules/push-campaign/context/module-base.d.ts +181 -0
- package/base-modules/push-campaign/context/module-base.js +45 -0
- package/base-modules/push-campaign/context/use-push-campaign-module.d.ts +66 -0
- package/base-modules/push-campaign/context/use-push-campaign-module.js +451 -0
- package/base-modules/push-campaign/context.d.ts +2 -0
- package/base-modules/push-campaign/context.js +3 -0
- package/base-modules/push-campaign/filter.d.ts +1 -0
- package/base-modules/push-campaign/filter.js +43 -0
- package/base-modules/push-campaign/form.d.ts +1 -0
- package/base-modules/push-campaign/form.js +21 -0
- package/base-modules/push-campaign/page.d.ts +28 -0
- package/base-modules/push-campaign/page.js +152 -0
- package/base-modules/push-campaign/validate.d.ts +11 -0
- package/base-modules/push-campaign/validate.js +11 -0
- package/base-modules/push-campaign/view.d.ts +1 -0
- package/base-modules/push-campaign/view.js +26 -0
- package/base-modules/rbac/context.js +2 -1
- package/base-modules/school/cache.js +1 -1
- package/base-modules/school/context.js +1 -1
- package/base-modules/section/cache.d.ts +3 -3
- package/base-modules/section/cache.js +1 -1
- package/base-modules/section/context.js +2 -1
- package/base-modules/section/more-actions.js +1 -1
- package/base-modules/student-fee/context/use-student-fee-module.js +4 -1
- package/base-modules/student-fee/form.js +2 -1
- package/base-modules/student-fee/more-actions.js +1 -1
- package/base-modules/student-fee/page.js +1 -1
- package/base-modules/student-fee/single-entry.js +1 -1
- package/base-modules/student-fee/view.js +4 -4
- package/base-modules/student-profile/cache.d.ts +3 -3
- package/base-modules/student-profile/cache.js +1 -1
- package/base-modules/student-profile/context/use-student-profile-module.js +4 -1
- package/base-modules/student-profile/form.js +1 -1
- package/base-modules/student-profile/more-actions.js +1 -1
- package/base-modules/student-profile/page.js +1 -1
- package/base-modules/student-profile/view.js +1 -1
- package/base-modules/subject/cache.d.ts +3 -3
- package/base-modules/subject/cache.js +1 -1
- package/base-modules/subject/context.js +2 -1
- package/base-modules/subject/more-actions.js +1 -1
- package/base-modules/teacher/cache.d.ts +3 -3
- package/base-modules/teacher/cache.js +1 -1
- package/base-modules/teacher/context.js +2 -1
- package/base-modules/teacher/more-actions.js +1 -1
- package/base-modules/teacher/view.js +1 -1
- package/base-modules/user/cache.d.ts +3 -3
- package/base-modules/user/cache.js +1 -1
- package/base-modules/user/context/use-user-module.js +4 -1
- package/base-modules/user/more-actions.js +2 -1
- package/base-modules/workspace/cache.js +2 -1
- package/base-modules/workspace/context.js +1 -1
- package/base-modules/workspace/view.js +1 -1
- package/base-modules/workspace-user/context.js +5 -2
- package/base-modules/workspace-user/more-actions.js +2 -2
- package/constants.d.ts +6 -0
- package/constants.js +6 -0
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/communication.d.ts +28 -0
- package/types/enums.d.ts +1 -0
- package/types/enums.js +1 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslations } from "next-intl";
|
|
4
|
-
import { downloadFromUrl
|
|
4
|
+
import { downloadFromUrl } from "@react-pakistan/util-functions/general/download-from-url";
|
|
5
|
+
import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
|
|
5
6
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
6
7
|
import converter from "json-2-csv";
|
|
7
8
|
import { Timeline } from "../../components/timeline";
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Cache utilities for workspace data using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { getCachedSingleItem, getCachedSingleItemSync, invalidateCache,
|
|
6
|
+
import { getCachedSingleItem, getCachedSingleItemSync, invalidateCache, } from "@react-pakistan/util-functions/general/generic-cache";
|
|
7
|
+
import { ONE_YEAR_IN_MS } from "@react-pakistan/util-functions/constants/cache-time";
|
|
7
8
|
import { WORKSPACE_API_ROUTES } from "../../constants";
|
|
8
9
|
import { LS_KEYS } from "../../constants";
|
|
9
10
|
// ============================================================================
|
|
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from "react";
|
|
22
22
|
import { useTheme } from "next-themes";
|
|
23
23
|
import { useTranslations } from "next-intl";
|
|
24
|
-
import { validateForm } from "@react-pakistan/util-functions";
|
|
24
|
+
import { validateForm } from "@react-pakistan/util-functions/general/validate-form";
|
|
25
25
|
import { useModuleEntityV2, } from "@react-pakistan/util-functions/hooks/use-module-entity-v2";
|
|
26
26
|
import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
|
|
27
27
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
@@ -12,7 +12,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@app
|
|
|
12
12
|
import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
13
13
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
14
14
|
import { Building2, Globe, FileText, Image as LucideImage, CheckCircle2, XCircle, Calendar, CreditCard, Users, BookOpen, GraduationCap, Home, HardDrive, Clock, Shield, } from "lucide-react";
|
|
15
|
-
import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
15
|
+
import { DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions/general/format-date";
|
|
16
16
|
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
17
17
|
export const WorkspaceView = () => {
|
|
18
18
|
const { state } = useWorkspaceModule();
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"use client";
|
|
21
21
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
22
22
|
import { useTheme } from "next-themes";
|
|
23
|
-
import { isCreatedOrUpdated
|
|
23
|
+
import { isCreatedOrUpdated } from "@react-pakistan/util-functions/general/is-created-or-updated";
|
|
24
|
+
import { validateForm } from "@react-pakistan/util-functions/general/validate-form";
|
|
24
25
|
import { useModuleEntityV2, } from "@react-pakistan/util-functions/hooks/use-module-entity-v2";
|
|
25
26
|
import { useDebounce } from "@react-pakistan/util-functions/hooks/use-debounce";
|
|
26
27
|
import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
|
|
@@ -183,7 +184,9 @@ export const useWorkspaceUserModule = () => {
|
|
|
183
184
|
var _a;
|
|
184
185
|
const isCreated = isCreatedOrUpdated(data);
|
|
185
186
|
if (error) {
|
|
186
|
-
showToast(isCreated
|
|
187
|
+
showToast(isCreated
|
|
188
|
+
? t("messagesWorkspaceUserCreateFailed")
|
|
189
|
+
: t("messagesWorkspaceUserUpdateFailed"), TOAST_VARIANT.ERROR);
|
|
187
190
|
return;
|
|
188
191
|
}
|
|
189
192
|
if (data) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { API_METHODS } from "@react-pakistan/util-functions";
|
|
3
|
+
import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
|
|
4
4
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
5
5
|
import converter from "json-2-csv";
|
|
6
6
|
import { Timeline } from "../../components/timeline";
|
|
7
|
-
import { downloadFromUrl } from "@react-pakistan/util-functions";
|
|
7
|
+
import { downloadFromUrl } from "@react-pakistan/util-functions/general/download-from-url";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
9
9
|
export const WorkspaceUserMoreActions = () => {
|
|
10
10
|
const t = useTranslations("workspaceUser");
|
package/constants.d.ts
CHANGED
|
@@ -60,6 +60,11 @@ export declare const FEE_STRUCTURE_API_ROUTES: {
|
|
|
60
60
|
export declare const PLAN_API_ROUTES: {
|
|
61
61
|
readonly UNIT: "/api/v1/plan";
|
|
62
62
|
};
|
|
63
|
+
export declare const PUSH_CAMPAIGN_API_ROUTES: {
|
|
64
|
+
readonly UNIT: "/api/v1/push-campaign";
|
|
65
|
+
readonly START: "/api/v1/push-campaign/start";
|
|
66
|
+
readonly AI_CHECK: "/api/v1/push-campaign/ai-check";
|
|
67
|
+
};
|
|
63
68
|
export declare const RBAC_API_ROUTES: Record<string, string>;
|
|
64
69
|
export declare const SCHOOL_API_ROUTES: Record<string, string>;
|
|
65
70
|
export declare const SECTION_API_ROUTES: {
|
|
@@ -136,6 +141,7 @@ export declare const DASHBOARD_ROUTES: {
|
|
|
136
141
|
USER_MANAGEMENT: string;
|
|
137
142
|
USER: string;
|
|
138
143
|
WHATSAPP_BROADCAST: string;
|
|
144
|
+
PUSH_CAMPAIGN: string;
|
|
139
145
|
WORKSPACE_USER: string;
|
|
140
146
|
WORKSPACE: string;
|
|
141
147
|
};
|
package/constants.js
CHANGED
|
@@ -65,6 +65,11 @@ export const FEE_STRUCTURE_API_ROUTES = {
|
|
|
65
65
|
export const PLAN_API_ROUTES = {
|
|
66
66
|
UNIT: "/api/v1/plan",
|
|
67
67
|
};
|
|
68
|
+
export const PUSH_CAMPAIGN_API_ROUTES = {
|
|
69
|
+
UNIT: "/api/v1/push-campaign",
|
|
70
|
+
START: "/api/v1/push-campaign/start",
|
|
71
|
+
AI_CHECK: "/api/v1/push-campaign/ai-check",
|
|
72
|
+
};
|
|
68
73
|
export const RBAC_API_ROUTES = {
|
|
69
74
|
UNIT: "/api/v1/role",
|
|
70
75
|
PERMISSIONS_LIST: "/api/v1/permission",
|
|
@@ -157,6 +162,7 @@ export const DASHBOARD_ROUTES = {
|
|
|
157
162
|
USER_MANAGEMENT: "/user-management",
|
|
158
163
|
USER: "/user-management/user",
|
|
159
164
|
WHATSAPP_BROADCAST: "/communication/whatsapp-broadcast",
|
|
165
|
+
PUSH_CAMPAIGN: "/communication/push-campaign",
|
|
160
166
|
WORKSPACE_USER: "/user-management/workspace-user",
|
|
161
167
|
WORKSPACE: "/account/workspace",
|
|
162
168
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/fusion-storybook",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.46",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build-storybook": "storybook build",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@radix-ui/react-slider": "^1.3.6",
|
|
60
60
|
"@radix-ui/react-slot": "^1.2.4",
|
|
61
61
|
"@radix-ui/react-toast": "^1.2.15",
|
|
62
|
-
"@react-pakistan/util-functions": "^
|
|
62
|
+
"@react-pakistan/util-functions": "^2.0.2",
|
|
63
63
|
"@storybook/addon-a11y": "^10.3.4",
|
|
64
64
|
"@storybook/addon-docs": "^10.3.4",
|
|
65
65
|
"@storybook/addon-onboarding": "^10.3.4",
|