Fix ESLint violations in CreateAuditDialog
- Fix import order for DialogRef type - Add explicit type parameter to useMutation - Remove unnecessary parens around single arrow function arg - Fix jsx-one-expression-per-line for MB text Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -9,9 +9,9 @@ import { useTranslate } from "@probo/i18n";
|
|||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
Button,
|
Button,
|
||||||
type DialogRef,
|
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
type DialogRef,
|
||||||
DialogFooter,
|
DialogFooter,
|
||||||
Field,
|
Field,
|
||||||
IconUpload,
|
IconUpload,
|
||||||
@@ -28,6 +28,7 @@ import { graphql } from "relay-runtime";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import type { CreateAuditDialogFrameworksQuery } from "#/__generated__/core/CreateAuditDialogFrameworksQuery.graphql";
|
import type { CreateAuditDialogFrameworksQuery } from "#/__generated__/core/CreateAuditDialogFrameworksQuery.graphql";
|
||||||
|
import type { CreateAuditDialogUploadReportMutation } from "#/__generated__/core/CreateAuditDialogUploadReportMutation.graphql";
|
||||||
import { ControlledField } from "#/components/form/ControlledField";
|
import { ControlledField } from "#/components/form/ControlledField";
|
||||||
import { useCreateAudit } from "#/hooks/graph/AuditGraph";
|
import { useCreateAudit } from "#/hooks/graph/AuditGraph";
|
||||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||||
@@ -114,7 +115,7 @@ export function CreateAuditDialog({
|
|||||||
const internalRef = useDialogRef();
|
const internalRef = useDialogRef();
|
||||||
const ref = externalRef ?? internalRef;
|
const ref = externalRef ?? internalRef;
|
||||||
const createAudit = useCreateAudit(connection);
|
const createAudit = useCreateAudit(connection);
|
||||||
const [uploadMutate] = useMutation(uploadAuditReportMutation);
|
const [uploadMutate] = useMutation<CreateAuditDialogUploadReportMutation>(uploadAuditReportMutation);
|
||||||
|
|
||||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||||
try {
|
try {
|
||||||
@@ -144,7 +145,7 @@ export function CreateAuditDialog({
|
|||||||
"input.file": file,
|
"input.file": file,
|
||||||
},
|
},
|
||||||
onCompleted: () => resolve(),
|
onCompleted: () => resolve(),
|
||||||
onError: (error) => reject(error),
|
onError: error => reject(error),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
toast({
|
toast({
|
||||||
@@ -203,7 +204,8 @@ export function CreateAuditDialog({
|
|||||||
{file.name}
|
{file.name}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-txt-tertiary text-xs">
|
<p className="text-txt-tertiary text-xs">
|
||||||
{(file.size / 1024 / 1024).toFixed(2)} MB
|
{(file.size / 1024 / 1024).toFixed(2)}
|
||||||
|
{" MB"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user