@appcorp/fusion-storybook 0.1.29 → 0.1.30

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.
@@ -27,7 +27,7 @@ import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-ut
27
27
  import { useTranslations } from "next-intl";
28
28
  import { CLASS_API_ROUTES, pageLimit } from "./constants";
29
29
  import { classFormValidation } from "./validate";
30
- import { getCachedClasses, getCachedClassesSync, invalidateClassesCache, isClassesCacheStale, } from "./cache";
30
+ import { getCachedClasses, invalidateClassesCache } from "./cache";
31
31
  import { getCachedWorkspaceSync } from "../workspace/cache";
32
32
  import { Edit, Eye, Filter, MoreHorizontal, Plus, Trash2 } from "lucide-react";
33
33
  // ============================================================================
@@ -399,33 +399,20 @@ export const useClassModule = () => {
399
399
  useEffect(() => {
400
400
  if (!schoolId)
401
401
  return;
402
- // Use sync cache for initial load to prevent UI hanging
403
- const cachedData = getCachedClassesSync();
404
- if (cachedData && !isClassesCacheStale()) {
405
- // Cache is fresh, use it immediately
406
- const { count, items } = cachedData;
407
- dispatch({
408
- type: CLASS_ACTION_TYPES.SET_ITEMS,
409
- payload: { items: items || [], count: count || 0 },
410
- });
411
- }
412
- else {
413
- // Cache is stale or empty, fetch async
414
- (async () => {
415
- try {
416
- const { count, items } = await getCachedClasses({
417
- params: listParams,
418
- });
419
- dispatch({
420
- type: CLASS_ACTION_TYPES.SET_ITEMS,
421
- payload: { items: items || [], count: count || 0 },
422
- });
423
- }
424
- catch (_a) {
425
- showToast(t("messagesFetchFailed"), TOAST_VARIANT.ERROR);
426
- }
427
- })();
428
- }
402
+ (async () => {
403
+ try {
404
+ const { count, items } = await getCachedClasses({
405
+ params: listParams,
406
+ });
407
+ dispatch({
408
+ type: CLASS_ACTION_TYPES.SET_ITEMS,
409
+ payload: { items: items || [], count: count || 0 },
410
+ });
411
+ }
412
+ catch (_a) {
413
+ showToast(t("messagesFetchFailed"), TOAST_VARIANT.ERROR);
414
+ }
415
+ })();
429
416
  }, [listParams, schoolId, showToast, t, dispatch]);
430
417
  // ============================================================================
431
418
  // RETURN
@@ -12,7 +12,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { useMemo } from "react";
13
13
  import { COMPONENT_TYPE } from "@appcorp/shadcn/components/enhanced-table";
14
14
  import { createGenericModulePage, } from "@react-pakistan/util-functions/factory/generic-component-factory";
15
- import { useClassModule, ClassProvider, CLASS_ACTION_TYPES, CLASS_DRAWER, } from "./context";
15
+ import { useClassModule, ClassProvider, CLASS_ACTION_TYPES } from "./context";
16
16
  import { ClassFilter } from "./filter";
17
17
  import { ClassForm } from "./form";
18
18
  import { ClassMoreActions } from "./more-actions";
@@ -39,7 +39,7 @@ const createComponentInstances = () => ({
39
39
  moreActions: _jsx(ClassMoreActions, {}),
40
40
  view: _jsx(ClassView, {}),
41
41
  });
42
- const createClassConfig = ({ cancelLabel, dispatch, drawer, drawerTitle, labelActions, labelCode, labelDescription, labelId, labelName, labelStatus, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
42
+ const createClassConfig = ({ cancelLabel, dispatch, drawerTitle, labelActions, labelCode, labelDescription, labelId, labelName, labelStatus, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
43
43
  const components = createComponentInstances();
44
44
  return {
45
45
  moduleName: "class",
@@ -61,7 +61,6 @@ const createClassConfig = ({ cancelLabel, dispatch, drawer, drawerTitle, labelAc
61
61
  tableDescription,
62
62
  tableTitle,
63
63
  viewContent: components.view,
64
- size: drawer === CLASS_DRAWER.FORM_DRAWER ? "full" : "small",
65
64
  onClearFilters: () => dispatch({ type: CLASS_ACTION_TYPES.RESET_FORM }),
66
65
  };
67
66
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",