diff --git a/frontend/src/components/resources/procedure/config2.tsx b/frontend/src/components/resources/procedure/config2.tsx index 8d48b78b1..461a68cf5 100644 --- a/frontend/src/components/resources/procedure/config2.tsx +++ b/frontend/src/components/resources/procedure/config2.tsx @@ -1,12 +1,5 @@ -import { ConfigItem } from "@components/config/util"; -import { Section } from "@components/layouts"; -import { useRead, useWrite } from "@lib/hooks"; +import { useRead } from "@lib/hooks"; import { Types } from "@monitor/client"; -import { Card, CardHeader } from "@ui/card"; -import { Input } from "@ui/input"; -import { useState } from "react"; -import { CopyGithubWebhook } from "../common"; -import { Switch } from "@radix-ui/react-switch"; export const ProcedureConfig = ({ id }: { id: string }) => { const procedure = useRead("GetProcedure", { procedure: id }).data; @@ -19,58 +12,70 @@ const ProcedureConfigInner = ({ }: { procedure: Types.Procedure; }) => { - const [branch, setBranch] = useState("main"); - const [config, setConfig] = useState>({}); - const perms = useRead("GetPermissionLevel", { - target: { type: "Procedure", id: procedure._id?.$oid! }, - }).data; - const global_disabled = - useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const { mutateAsync } = useWrite("UpdateProcedure"); - const stages = config.stages || procedure.config.stages || []; + // const [branch, setBranch] = useState("main"); + // const [config, setConfig] = useState>({}); + // const perms = useRead("GetPermissionLevel", { + // target: { type: "Procedure", id: procedure._id?.$oid! }, + // }).data; + // const global_disabled = + // useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; + // const { mutateAsync } = useWrite("UpdateProcedure"); + // const stages = config.stages || procedure.config.stages || []; - const disabled = global_disabled || perms !== Types.PermissionLevel.Write; + // const disabled = global_disabled || perms !== Types.PermissionLevel.Write; + return <>{procedure.name} - return ( - <> -
- - - -
-
-
-
- Listen on branch: -
- setBranch(e.target.value)} - className="w-[200px]" - /> -
- -
-
-
Enabled:
- - setConfig({ ...config, webhook_enabled }) - } - disabled={disabled} - /> -
-
-
-
-
-
- - ); + // return ( + // <> + // { + // await mutateAsync({ id: procedure._id!.$oid, config }); + // setConfig({}); + // }} + // onReset={() => setConfig({})} + // > + //
+ //
+ //
+ // + // + // + //
+ //
+ //
+ //
+ // Listen on branch: + //
+ // setBranch(e.target.value)} + // className="w-[200px]" + // /> + //
+ // + //
+ //
+ //
Enabled:
+ // + // setConfig({ ...config, webhook_enabled }) + // } + // disabled={disabled} + // /> + //
+ //
+ //
+ //
+ //
+ //
+ // + // ); };