mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
added format command and added trailing commas to reduce conflicts
This commit is contained in:
@@ -21,7 +21,7 @@ import { SettingSchemaModal, type SettingsSchemaModalRef } from "./SettingSchema
|
||||
|
||||
export type SettingProps<
|
||||
Schema extends TObject = TObject,
|
||||
Props = Schema extends TObject<infer TProperties> ? TProperties : any
|
||||
Props = Schema extends TObject<infer TProperties> ? TProperties : any,
|
||||
> = {
|
||||
schema: Schema;
|
||||
config: any;
|
||||
@@ -51,7 +51,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
prefix = "/",
|
||||
options,
|
||||
path = [],
|
||||
properties
|
||||
properties,
|
||||
}: SettingProps<Schema>) {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const { actions } = useBknd();
|
||||
@@ -67,7 +67,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
e.preventDefault();
|
||||
onSave();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"e",
|
||||
@@ -75,7 +75,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
if (!editing) {
|
||||
onToggleEdit();
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"Escape",
|
||||
@@ -83,8 +83,8 @@ export function Setting<Schema extends TObject = any>({
|
||||
if (editing) {
|
||||
onToggleEdit();
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
const exclude = useMemo(
|
||||
@@ -94,7 +94,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
.filter(([, value]) => value.hide || value.extract)
|
||||
.map(([key]) => key)
|
||||
: [],
|
||||
[properties]
|
||||
[properties],
|
||||
);
|
||||
|
||||
const goBack = useEvent((replace?: boolean) => {
|
||||
@@ -178,7 +178,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
description={`Configuration at path ${path.join(".")} doesn't exist.`}
|
||||
primary={{
|
||||
children: "Go back",
|
||||
onClick: () => goBack()
|
||||
onClick: () => goBack(),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -197,19 +197,19 @@ export function Setting<Schema extends TObject = any>({
|
||||
label: "Inspect local schema",
|
||||
onClick: () => {
|
||||
schemaLocalModalRef.current?.open();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Inspect schema",
|
||||
onClick: () => {
|
||||
schemaModalRef.current?.open();
|
||||
}
|
||||
},
|
||||
},
|
||||
deleteAllowed && {
|
||||
label: "Delete",
|
||||
destructive: true,
|
||||
onClick: handleDelete
|
||||
}
|
||||
onClick: handleDelete,
|
||||
},
|
||||
]}
|
||||
position="bottom-end"
|
||||
>
|
||||
@@ -255,7 +255,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
label: ucFirst(sub),
|
||||
href: `${prefix}/${sub}`.replace(/\/+/g, "/"),
|
||||
active: selectedSubKey === sub,
|
||||
badge: Object.keys(extracted[sub]?.config ?? {}).length
|
||||
badge: Object.keys(extracted[sub]?.config ?? {}).length,
|
||||
}))}
|
||||
/>
|
||||
<div className="flex flex-grow flex-col gap-3 p-3">
|
||||
@@ -271,7 +271,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
if (!value || typeof value !== "object") {
|
||||
return {
|
||||
key,
|
||||
value
|
||||
value,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ export function Setting<Schema extends TObject = any>({
|
||||
return {
|
||||
key,
|
||||
[fistValueKey]: firstValueKeyValue,
|
||||
value: _value
|
||||
value: _value,
|
||||
};
|
||||
});
|
||||
const newSetting = properties?.[key]?.new;
|
||||
@@ -331,12 +331,12 @@ export function Setting<Schema extends TObject = any>({
|
||||
tabs={[
|
||||
{
|
||||
title: "Schema",
|
||||
json: reducedSchema
|
||||
json: reducedSchema,
|
||||
},
|
||||
{
|
||||
title: "Config",
|
||||
json: reducedConfig
|
||||
}
|
||||
json: reducedConfig,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<SettingSchemaModal
|
||||
@@ -345,12 +345,12 @@ export function Setting<Schema extends TObject = any>({
|
||||
tabs={[
|
||||
{
|
||||
title: "Schema",
|
||||
json: schema
|
||||
json: schema,
|
||||
},
|
||||
{
|
||||
title: "Config",
|
||||
json: config
|
||||
}
|
||||
json: config,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -26,7 +26,7 @@ export const SettingNewModal = ({
|
||||
anyOfValues,
|
||||
path,
|
||||
prefixPath,
|
||||
generateKey
|
||||
generateKey,
|
||||
}: SettingsNewModalProps) => {
|
||||
const [location, navigate] = useLocation();
|
||||
const [formSchema, setFormSchema] = useState(schema);
|
||||
@@ -44,8 +44,8 @@ export const SettingNewModal = ({
|
||||
if (generateKey && typeof generateKey === "function") {
|
||||
handleKeyNameChange({
|
||||
target: {
|
||||
value: generateKey(data)
|
||||
}
|
||||
value: generateKey(data),
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("form change", data);
|
||||
@@ -69,7 +69,7 @@ export const SettingNewModal = ({
|
||||
if (await actions.add(module as any, addPath, data)) {
|
||||
setTimeout(() => {
|
||||
navigate(prefixPath + newKey, {
|
||||
replace: true
|
||||
replace: true,
|
||||
});
|
||||
}, 500);
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ export const SettingNewModal = ({
|
||||
onClick: () => {
|
||||
setFormSchema(item);
|
||||
open();
|
||||
}
|
||||
},
|
||||
};
|
||||
})
|
||||
: [];
|
||||
|
||||
@@ -26,7 +26,7 @@ export const SettingSchemaModal = forwardRef<SettingsSchemaModalRef, SettingSche
|
||||
useImperativeHandle(ref, () => ({
|
||||
open,
|
||||
close,
|
||||
isOpen: opened
|
||||
isOpen: opened,
|
||||
}));
|
||||
|
||||
if (!tab) return null;
|
||||
@@ -69,5 +69,5 @@ export const SettingSchemaModal = forwardRef<SettingsSchemaModalRef, SettingSche
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ function SettingsSidebar() {
|
||||
const modules = Object.keys(schema).map((key) => {
|
||||
return {
|
||||
title: schema[key].title ?? ucFirst(key),
|
||||
key
|
||||
key,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -86,25 +86,25 @@ const uiSchema = {
|
||||
server: {
|
||||
cors: {
|
||||
allow_methods: {
|
||||
"ui:widget": "checkboxes"
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
allow_headers: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
}
|
||||
}
|
||||
}
|
||||
orderable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
media: {
|
||||
adapter: {
|
||||
"ui:options": {
|
||||
label: false
|
||||
}
|
||||
label: false,
|
||||
},
|
||||
/*type: {
|
||||
"ui:widget": "hidden"
|
||||
}*/
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const SettingRoutesRoutes = () => {
|
||||
@@ -112,7 +112,7 @@ const SettingRoutesRoutes = () => {
|
||||
|
||||
console.log("flows", {
|
||||
schema: schema.flows,
|
||||
config: config.flows
|
||||
config: config.flows,
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@@ -8,37 +8,37 @@ const uiSchema = {
|
||||
jwt: {
|
||||
basepath: {
|
||||
"ui:options": {
|
||||
label: false
|
||||
}
|
||||
label: false,
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
}
|
||||
}
|
||||
orderable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
strategies: {
|
||||
additionalProperties: {
|
||||
"ui:widget": "select",
|
||||
type: {
|
||||
"ui:widget": "hidden"
|
||||
}
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
},
|
||||
type: {
|
||||
"ui:widget": "hidden"
|
||||
}
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
},
|
||||
roles: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
orderable: false,
|
||||
},
|
||||
permissions: {
|
||||
items: {
|
||||
"ui:widget": "checkboxes"
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
"ui:widget": "checkboxes"
|
||||
}
|
||||
}
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const AuthSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
@@ -122,7 +122,7 @@ export const AuthSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
}
|
||||
return;
|
||||
},
|
||||
reloadOnSave: true
|
||||
reloadOnSave: true,
|
||||
}}
|
||||
properties={{
|
||||
strategies: {
|
||||
@@ -131,8 +131,8 @@ export const AuthSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
return Object.values(
|
||||
transformObject(strategies, (s, name) => ({
|
||||
key: name,
|
||||
type: s.type
|
||||
}))
|
||||
type: s.type,
|
||||
})),
|
||||
);
|
||||
},
|
||||
new: {
|
||||
@@ -142,16 +142,16 @@ export const AuthSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
return data.type === "password"
|
||||
? "password"
|
||||
: data.config.name?.toLowerCase() || "";
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
roles: {
|
||||
extract: true,
|
||||
new: {
|
||||
schema: roleSchema,
|
||||
uiSchema: uiSchema.roles
|
||||
}
|
||||
}
|
||||
uiSchema: uiSchema.roles,
|
||||
},
|
||||
},
|
||||
}}
|
||||
prefix={`${prefix}/auth`}
|
||||
path={["auth"]}
|
||||
|
||||
@@ -9,33 +9,33 @@ export const dataFieldsUiSchema = {
|
||||
config: {
|
||||
fillable: {
|
||||
"ui:options": {
|
||||
wrap: true
|
||||
wrap: true,
|
||||
},
|
||||
anyOf: [
|
||||
{},
|
||||
{
|
||||
"ui:widget": "checkboxes"
|
||||
}
|
||||
]
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
],
|
||||
},
|
||||
hidden: {
|
||||
"ui:options": {
|
||||
wrap: true
|
||||
wrap: true,
|
||||
},
|
||||
anyOf: [
|
||||
{},
|
||||
{
|
||||
"ui:widget": "checkboxes"
|
||||
}
|
||||
]
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
],
|
||||
},
|
||||
schema: {
|
||||
"ui:field": "JsonField"
|
||||
"ui:field": "JsonField",
|
||||
},
|
||||
ui_schema: {
|
||||
"ui:field": "JsonField"
|
||||
}
|
||||
}
|
||||
"ui:field": "JsonField",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const fieldsAnyOfValues = fieldSpecs
|
||||
@@ -43,29 +43,29 @@ const fieldsAnyOfValues = fieldSpecs
|
||||
.reduce((acc, s) => {
|
||||
acc[s.type] = {
|
||||
label: s.label,
|
||||
icon: s.icon
|
||||
icon: s.icon,
|
||||
};
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
const relationAnyOfValues = {
|
||||
"1:1": {
|
||||
label: "One-to-One"
|
||||
label: "One-to-One",
|
||||
},
|
||||
"n:1": {
|
||||
label: "Many-to-One"
|
||||
label: "Many-to-One",
|
||||
},
|
||||
"m:n": {
|
||||
label: "Many-to-Many"
|
||||
label: "Many-to-Many",
|
||||
},
|
||||
poly: {
|
||||
label: "Polymorphic"
|
||||
}
|
||||
label: "Polymorphic",
|
||||
},
|
||||
};
|
||||
|
||||
export const DataSettings = ({
|
||||
schema,
|
||||
config
|
||||
config,
|
||||
}: { schema: ModuleSchemas["data"]; config: ModuleConfigs["data"] }) => {
|
||||
const { app } = useBknd();
|
||||
const basepath = app.getAdminConfig().basepath;
|
||||
@@ -110,7 +110,7 @@ export const DataSettings = ({
|
||||
return "Modifying the primary field may result in strange behaviors.";
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
}}
|
||||
uiSchema={dataFieldsUiSchema}
|
||||
/>
|
||||
@@ -128,8 +128,8 @@ export const DataSettings = ({
|
||||
|
||||
const fieldsSchema = {
|
||||
anyOf: editSchema.properties.fields.additionalProperties.anyOf.filter(
|
||||
(s) => s.properties.type.const !== "primary"
|
||||
)
|
||||
(s) => s.properties.type.const !== "primary",
|
||||
),
|
||||
} as any;
|
||||
|
||||
return (
|
||||
@@ -142,7 +142,7 @@ export const DataSettings = ({
|
||||
return "Modifying the system entities may result in strange behaviors.";
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
}}
|
||||
properties={{
|
||||
fields: {
|
||||
@@ -154,17 +154,17 @@ export const DataSettings = ({
|
||||
acc.push({
|
||||
property: key,
|
||||
type: value.type,
|
||||
required: value.config?.required ? "Yes" : "No"
|
||||
required: value.config?.required ? "Yes" : "No",
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
[] as any[],
|
||||
),
|
||||
new: {
|
||||
schema: fieldsSchema,
|
||||
uiSchema: dataFieldsUiSchema,
|
||||
anyOfValues: fieldsAnyOfValues
|
||||
}
|
||||
}
|
||||
anyOfValues: fieldsAnyOfValues,
|
||||
},
|
||||
},
|
||||
}}
|
||||
path={["data", "entities", entity]}
|
||||
prefix={`${prefix}/data/entities/${entity}`}
|
||||
@@ -247,22 +247,22 @@ export const DataSettings = ({
|
||||
acc.push({
|
||||
name: key,
|
||||
type: value.type,
|
||||
fields: Object.keys(value.fields ?? {}).length
|
||||
fields: Object.keys(value.fields ?? {}).length,
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
[] as any[],
|
||||
),
|
||||
new: {
|
||||
schema: schema.properties.entities.additionalProperties as any,
|
||||
uiSchema: {
|
||||
fields: {
|
||||
"ui:widget": "hidden"
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
type: {
|
||||
"ui:widget": "hidden"
|
||||
}
|
||||
}
|
||||
}
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
relations: {
|
||||
extract: true,
|
||||
@@ -276,12 +276,12 @@ export const DataSettings = ({
|
||||
data.config?.mappedBy,
|
||||
data.config?.inversedBy,
|
||||
data.config?.connectionTable,
|
||||
data.config?.connectionTableMappedName
|
||||
data.config?.connectionTableMappedName,
|
||||
].filter(Boolean);
|
||||
|
||||
return [...new Set(parts)].join("_");
|
||||
},
|
||||
anyOfValues: relationAnyOfValues
|
||||
anyOfValues: relationAnyOfValues,
|
||||
},
|
||||
tableValues: (config: any) =>
|
||||
transform(
|
||||
@@ -291,11 +291,11 @@ export const DataSettings = ({
|
||||
name: key,
|
||||
type: value.type,
|
||||
source: value.source,
|
||||
target: value.target
|
||||
target: value.target,
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
)
|
||||
[] as any[],
|
||||
),
|
||||
},
|
||||
indices: {
|
||||
extract: true,
|
||||
@@ -307,32 +307,32 @@ export const DataSettings = ({
|
||||
name: key,
|
||||
entity: value.entity,
|
||||
fields: value.fields.join(", "),
|
||||
unique: value.unique ? "Yes" : "No"
|
||||
unique: value.unique ? "Yes" : "No",
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
[] as any[],
|
||||
),
|
||||
new: {
|
||||
schema: newIndex,
|
||||
uiSchema: {
|
||||
fields: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
}
|
||||
}
|
||||
orderable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
generateKey: (data: any) => {
|
||||
const parts = [
|
||||
"idx",
|
||||
data.entity,
|
||||
data.unique && "unique",
|
||||
...data.fields.filter(Boolean)
|
||||
...data.fields.filter(Boolean),
|
||||
].filter(Boolean);
|
||||
|
||||
return parts.join("_");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
prefix={`${prefix}/data`}
|
||||
path={["data"]}
|
||||
|
||||
@@ -7,26 +7,26 @@ const uiSchema = {
|
||||
jwt: {
|
||||
basepath: {
|
||||
"ui:options": {
|
||||
label: false
|
||||
}
|
||||
label: false,
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
}
|
||||
}
|
||||
orderable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
strategies: {
|
||||
additionalProperties: {
|
||||
"ui:widget": "select",
|
||||
type: {
|
||||
"ui:widget": "hidden"
|
||||
}
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
},
|
||||
type: {
|
||||
"ui:widget": "hidden"
|
||||
}
|
||||
}
|
||||
"ui:widget": "hidden",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const FlowsSettings = ({ schema, config }) => {
|
||||
@@ -91,9 +91,9 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
uiSchema={{
|
||||
params: {
|
||||
render: {
|
||||
"ui:field": "LiquidJsField"
|
||||
}
|
||||
}
|
||||
"ui:field": "LiquidJsField",
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -124,7 +124,7 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
tasks: {
|
||||
extract: true,
|
||||
new: {
|
||||
schema: newTask
|
||||
schema: newTask,
|
||||
},
|
||||
tableValues: (config: any) =>
|
||||
transform(
|
||||
@@ -132,17 +132,17 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
(acc, value, key) => {
|
||||
acc.push({
|
||||
name: key,
|
||||
type: value.type
|
||||
type: value.type,
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
)
|
||||
[] as any[],
|
||||
),
|
||||
},
|
||||
connections: {
|
||||
extract: true,
|
||||
new: {
|
||||
schema: newConnection,
|
||||
generateKey: crypto.randomUUID() as string
|
||||
generateKey: crypto.randomUUID() as string,
|
||||
},
|
||||
tableValues: (config: any) =>
|
||||
transform(
|
||||
@@ -152,12 +152,12 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
id: key,
|
||||
source: value.source,
|
||||
target: value.target,
|
||||
condition: value.config.condition?.type
|
||||
condition: value.config.condition?.type,
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
)
|
||||
}
|
||||
[] as any[],
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -176,7 +176,7 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
flows: {
|
||||
extract: true,
|
||||
new: {
|
||||
schema: schema.properties.flows.additionalProperties as any
|
||||
schema: schema.properties.flows.additionalProperties as any,
|
||||
|
||||
/*uiSchema: {
|
||||
fields: {
|
||||
@@ -193,12 +193,12 @@ export const FlowsSettings = ({ schema, config }) => {
|
||||
trigger: value.trigger.type,
|
||||
mode: value.trigger.config.mode,
|
||||
start_task: value.start_task,
|
||||
responding_task: value.responding_task
|
||||
responding_task: value.responding_task,
|
||||
});
|
||||
},
|
||||
[] as any[]
|
||||
)
|
||||
}
|
||||
[] as any[],
|
||||
),
|
||||
},
|
||||
}}
|
||||
prefix={`${prefix}/flows`}
|
||||
path={["flows"]}
|
||||
|
||||
@@ -6,14 +6,14 @@ import { Route } from "wouter";
|
||||
const uiSchema = {
|
||||
cors: {
|
||||
allow_methods: {
|
||||
"ui:widget": "checkboxes"
|
||||
"ui:widget": "checkboxes",
|
||||
},
|
||||
allow_headers: {
|
||||
"ui:options": {
|
||||
orderable: false
|
||||
}
|
||||
}
|
||||
}
|
||||
orderable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const ServerSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
@@ -39,7 +39,7 @@ export const ServerSettings = ({ schema: _unsafe_copy, config }) => {
|
||||
return "The admin settings are read-only as they are overriden. Remaining server configuration can be edited.";
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
}}
|
||||
schema={schema}
|
||||
uiSchema={uiSchema}
|
||||
|
||||
@@ -5,11 +5,11 @@ import { cloneDeep, omit, pick } from "lodash-es";
|
||||
export function extractSchema<
|
||||
Schema extends TObject,
|
||||
Keys extends keyof Schema["properties"],
|
||||
Config extends Static<Schema>
|
||||
Config extends Static<Schema>,
|
||||
>(
|
||||
schema: Schema,
|
||||
config: Config,
|
||||
keys: Keys[]
|
||||
keys: Keys[],
|
||||
): [
|
||||
JSONSchema7,
|
||||
Partial<Config>,
|
||||
@@ -19,7 +19,7 @@ export function extractSchema<
|
||||
config: Config[K];
|
||||
schema: Schema["properties"][K];
|
||||
};
|
||||
}
|
||||
},
|
||||
] {
|
||||
if (!schema.properties) {
|
||||
return [{ ...schema }, config, {} as any];
|
||||
@@ -28,7 +28,7 @@ export function extractSchema<
|
||||
const newSchema = cloneDeep(schema);
|
||||
const updated = {
|
||||
...newSchema,
|
||||
properties: omit(newSchema.properties, keys)
|
||||
properties: omit(newSchema.properties, keys),
|
||||
};
|
||||
if (updated.required) {
|
||||
updated.required = updated.required.filter((key) => !keys.includes(key as any));
|
||||
@@ -40,7 +40,7 @@ export function extractSchema<
|
||||
// @ts-ignore
|
||||
config: config[key],
|
||||
// @ts-ignore
|
||||
schema: newSchema.properties[key]
|
||||
schema: newSchema.properties[key],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user