mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix enum field causing issues when created in modal + changed data empty button text/target
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { readFile } from "node:fs/promises";
|
import { readFile } from "node:fs/promises";
|
||||||
import { serveStatic } from "@hono/node-server/serve-static";
|
import { serveStatic } from "@hono/node-server/serve-static";
|
||||||
|
import type { BkndConfig } from "bknd";
|
||||||
import { App } from "../../App";
|
import { App } from "../../App";
|
||||||
import type { BkndConfig } from "../index";
|
|
||||||
|
|
||||||
async function getHtml() {
|
async function getHtml() {
|
||||||
return readFile("index.html", "utf8");
|
return readFile("index.html", "utf8");
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ export function objectDepth(object: object): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function objectCleanEmpty<Obj extends { [key: string]: any }>(obj: Obj): Obj {
|
export function objectCleanEmpty<Obj extends { [key: string]: any }>(obj: Obj): Obj {
|
||||||
|
if (!obj) return obj;
|
||||||
return Object.entries(obj).reduce((acc, [key, value]) => {
|
return Object.entries(obj).reduce((acc, [key, value]) => {
|
||||||
if (value && Array.isArray(value) && value.some((v) => typeof v === "object")) {
|
if (value && Array.isArray(value) && value.some((v) => typeof v === "object")) {
|
||||||
const nested = value.map(objectCleanEmpty);
|
const nested = value.map(objectCleanEmpty);
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ export function DataEmpty() {
|
|||||||
const [navigate] = useNavigate();
|
const [navigate] = useNavigate();
|
||||||
|
|
||||||
function handleButtonClick() {
|
function handleButtonClick() {
|
||||||
navigate(routes.settings.path(["data", "entities"]), { absolute: true });
|
//navigate(routes.settings.path(["data", "entities"]), { absolute: true });
|
||||||
|
navigate(routes.data.schema.root());
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -129,7 +130,7 @@ export function DataEmpty() {
|
|||||||
Icon={IconDatabase}
|
Icon={IconDatabase}
|
||||||
title="No entity selected"
|
title="No entity selected"
|
||||||
description="Please select an entity from the left sidebar or create a new one to continue."
|
description="Please select an entity from the left sidebar or create a new one to continue."
|
||||||
buttonText="Create Entity"
|
buttonText="Go to schema"
|
||||||
buttonOnClick={handleButtonClick}
|
buttonOnClick={handleButtonClick}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ registries.media.add("local", {
|
|||||||
|
|
||||||
const connection = new LibsqlConnection(
|
const connection = new LibsqlConnection(
|
||||||
createClient({
|
createClient({
|
||||||
url: "file:.db/show.db"
|
url: "file:.db/new.db"
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user