This commit is contained in:
Benjamin Toby
2025-07-28 07:23:45 +01:00
parent a429436939
commit 8ac8b8eb51
49 changed files with 475 additions and 177 deletions
@@ -16,6 +16,8 @@ function grabTextFieldType(field, nullReturn) {
return "javascript";
if (field.shell)
return "shell";
if (field.markdown)
return "markdown";
if (nullReturn)
return undefined;
return "plain";
@@ -68,13 +68,14 @@ function default_1({ currentDbSchema, currentTableSchema, currentTableSchemaInde
/**
* Handle scenario where this table is a child of another
*/
if (currentTableSchema.childTable &&
currentTableSchema.childTableDbId &&
currentTableSchema.childTableDbId) {
const targetParentDatabase = (0, grab_required_database_schemas_1.grabPrimaryRequiredDbSchema)({
dbId: currentTableSchema.childTableDbId,
userId,
});
if (currentTableSchema.childTable && currentTableSchema.childTableDbId) {
const isParentDbCurrentDb = currentTableSchema.childTableDbId == newCurrentDbSchema.id;
const targetParentDatabase = isParentDbCurrentDb
? newCurrentDbSchema
: (0, grab_required_database_schemas_1.grabPrimaryRequiredDbSchema)({
dbId: currentTableSchema.childTableDbId,
userId,
});
const targetParentDatabaseTableIndex = targetParentDatabase === null || targetParentDatabase === void 0 ? void 0 : targetParentDatabase.tables.findIndex((tbl) => tbl.id == currentTableSchema.childTableId);
const targetParentDatabaseTable = typeof targetParentDatabaseTableIndex == "number"
? targetParentDatabaseTableIndex < 0
@@ -32,5 +32,7 @@ function setTextFieldType(field, type) {
return Object.assign(Object.assign({}, newField), { javascript: true });
if (type == "code")
return Object.assign(Object.assign({}, newField), { code: true });
if (type == "markdown")
return Object.assign(Object.assign({}, newField), { markdown: true });
return Object.assign({}, newField);
}