Skip to content

Commit

Permalink
chore: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed Apr 24, 2024
1 parent c68f5c2 commit b807799
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 1 addition & 3 deletions core/actions/http/action.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import * as z from "zod";

import { DependencyType } from "ui/auto-form";
import { FileText, Globe } from "ui/icon";
import { Globe } from "ui/icon";

import * as corePubFields from "../corePubFields";
import { defineAction } from "../types";
import { configOverride } from "./configOverride";
import { OutputMapFieldType } from "./outputMapFieldType";

export const action = defineAction({
Expand Down
4 changes: 3 additions & 1 deletion core/actions/http/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export const run = defineRun<typeof action>(async ({ pub, config, runParameters
const result = await res.json();

const setRunParameters = runParameters?.outputMap
? Object.entries(runParameters.outputMap).filter(([key, val]) => Boolean(val))
? Object.entries(runParameters.outputMap).filter((entry): entry is [string, string] =>
Boolean(entry[1])
)
: [];

if (setRunParameters.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion core/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type Action<
| {
schema: z.ZodType<RP>;
fieldConfig?: {
[K in keyof F]: Omit<F[K], "fieldType"> & {
[K in keyof F]: Omit<FieldConfigItem, "fieldType"> & {
fieldType?: RunParameterFieldTypeOverride;
};
};
Expand Down
7 changes: 4 additions & 3 deletions packages/ui/src/auto-form/fields/object.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import type { useForm } from "react-hook-form";

import * as React from "react";
import { useForm, useFormContext } from "react-hook-form";
import { useFormContext } from "react-hook-form";
import * as z from "zod";

import type { Dependency, FieldConfig, FieldConfigItem } from "../types";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../../accordion";
import { FormField } from "../../form";
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from "../config";
import resolveDependencies from "../dependencies";
import { Dependency, FieldConfig, FieldConfigItem } from "../types";
import { beautifyObjectName, getBaseSchema, getBaseType, zodToHtmlInputProps } from "../utils";
import AutoFormArray from "./array";

Expand Down Expand Up @@ -71,7 +73,6 @@ export default function AutoFormObject<SchemaType extends z.ZodObject<any, any>>
return null;
}

console.log(zodBaseType, fieldConfig);
if (zodBaseType === "ZodObject") {
return (
<AccordionItem value={name} key={key} className="border-none">
Expand Down

0 comments on commit b807799

Please sign in to comment.