Inspector operation changed
parent
74246639e3
commit
c3e22fae22
|
|
@ -33,7 +33,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { OperateByInspector } from "@/utils/inspectorApi";
|
import { OperateByInspector } from "@/utils/inspectorApi";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { Decrypt, formatBytes } from "@/lib/utils";
|
import { Decrypt, formatBytes } from "@/lib/utils";
|
||||||
import { useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { getOptions } from "@/utils/commonApi";
|
import { getOptions } from "@/utils/commonApi";
|
||||||
import AttachmentsDialog from "./AttachmentsDialog";
|
import AttachmentsDialog from "./AttachmentsDialog";
|
||||||
import { DialogTrigger } from "./ui/dialog";
|
import { DialogTrigger } from "./ui/dialog";
|
||||||
|
|
@ -53,6 +53,7 @@ export default function InspectorOperations({
|
||||||
key2: any;
|
key2: any;
|
||||||
}) {
|
}) {
|
||||||
const [file, setFile] = useState<File[]>([]);
|
const [file, setFile] = useState<File[]>([]);
|
||||||
|
const [check, setCheck] = useState<any>(false);
|
||||||
|
|
||||||
// Queries
|
// Queries
|
||||||
const { data, isLoading, refetch } = useQuery({
|
const { data, isLoading, refetch } = useQuery({
|
||||||
|
|
@ -275,15 +276,24 @@ export default function InspectorOperations({
|
||||||
<FormItem className="">
|
<FormItem className="">
|
||||||
<FormControl dir="rtl">
|
<FormControl dir="rtl">
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
onValueChange={field.onChange}
|
onValueChange={(value) => {
|
||||||
|
console.log(field.value);
|
||||||
|
field.onChange(value);
|
||||||
|
setCheck(false);
|
||||||
|
}}
|
||||||
// defaultValue={field.value}
|
// defaultValue={field.value}
|
||||||
className="flex space-y-1 text-sm"
|
className="flex space-y-1 text-sm"
|
||||||
>
|
>
|
||||||
<FormItem className="flex items-center space-x-3 space-y-0">
|
<FormItem className="flex items-center space-x-3 space-y-0">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
|
onClick={() => {
|
||||||
|
// @ts-expect-error
|
||||||
|
form.setValue("type", "private");
|
||||||
|
}}
|
||||||
value="private"
|
value="private"
|
||||||
className="ml-2 "
|
className="ml-2 "
|
||||||
|
checked={form.getValues("type") == "private"}
|
||||||
disabled={possibleOperations.length == 0}
|
disabled={possibleOperations.length == 0}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
@ -294,6 +304,7 @@ export default function InspectorOperations({
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value="public"
|
value="public"
|
||||||
className="ml-2 "
|
className="ml-2 "
|
||||||
|
checked={form.getValues("type") == "public"}
|
||||||
disabled={possibleOperations.length == 0}
|
disabled={possibleOperations.length == 0}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
@ -315,7 +326,15 @@ export default function InspectorOperations({
|
||||||
<FormItem className="flex-1 ">
|
<FormItem className="flex-1 ">
|
||||||
{/* <FormLabel>Email</FormLabel> */}
|
{/* <FormLabel>Email</FormLabel> */}
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={(value) => {
|
||||||
|
field.onChange(value);
|
||||||
|
setCheck(false);
|
||||||
|
if (value == "2") {
|
||||||
|
setCheck(true);
|
||||||
|
// @ts-expect-error
|
||||||
|
form.setValue("type", "public");
|
||||||
|
}
|
||||||
|
}}
|
||||||
defaultValue={field.value}
|
defaultValue={field.value}
|
||||||
dir="rtl"
|
dir="rtl"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue