From f0cbf2554866bd09d369e51a3073537962875c9a Mon Sep 17 00:00:00 2001 From: Rizky Date: Mon, 24 Jun 2024 03:32:53 -0700 Subject: [PATCH] fix --- comps/md/MasterDetail.tsx | 17 ++--------------- comps/md/gen/md-gen.ts | 13 ++----------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/comps/md/MasterDetail.tsx b/comps/md/MasterDetail.tsx index ef99b7e..7252d57 100755 --- a/comps/md/MasterDetail.tsx +++ b/comps/md/MasterDetail.tsx @@ -1,4 +1,5 @@ import { useLocal } from "@/utils/use-local"; +import { parseGenField } from "lib/gen/utils"; import { FC, useRef } from "react"; import { ModeFull } from "./mode/full"; import { ModeHSplit } from "./mode/h-split"; @@ -9,15 +10,8 @@ import { masterDetailApplyParams, masterDetailParseHash as masterDetailParseParams, } from "./utils/md-hash"; -import { MDLocalInternal, MDProps } from "./utils/typings"; import { mdRenderLoop } from "./utils/md-render-loop"; -import { parseGenField } from "lib/gen/utils"; -import { toast } from "sonner"; -import { Loader2 } from "lucide-react"; -import get from "lodash.get"; -const w = window as unknown as { - generating_prasi_md: Record; -}; +import { MDLocalInternal, MDProps } from "./utils/typings"; export const MasterDetail: FC = (arg) => { const { @@ -102,13 +96,6 @@ export const MasterDetail: FC = (arg) => { } } - if (get(w, "generating_prasi_md.master_detail")) - return ( -
- - Loading Master Detail... -
- ); return (
; -}; - +const w = window as any; export const generateMasterDetail: GenFn<{ item: PrasiItem; table: string; fields: any; }> = async (modify, data, arg) => { const { item } = arg; - // w.generating_prasi_md = { - // master_detail: true, - // }; - // const result: any = {}; - // modify(result); + await generateList(arg, data, false); await generateMDForm(arg, data, false); await item.edit.commit(); - // delete w.generating_prasi_md["master_detail"]; - // modify({}); };