Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 89cab4f

Browse files
committed
naming and query columns fixed
1 parent ca3f0a4 commit 89cab4f

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
import { FormulaFunctions } from "automations/formula_functions/FormulaFunctions";
22
import { IGenerateObject } from "automations/IGenerateObject";
33
import { LocalSettings } from "cdm/SettingsModel";
4-
import { RowDataType } from "cdm/FolderModel";
5-
import { Literal } from "obsidian-dataview";
64
export class FormulaGenerator implements IGenerateObject {
7-
public formula_functions: FormulaFunctions;
5+
public js_functions: FormulaFunctions;
86

97
constructor(private config: LocalSettings) {
10-
this.formula_functions = new FormulaFunctions(config);
8+
this.js_functions = new FormulaFunctions(config);
119
}
1210

13-
private async generate_formula_functions(): Promise<Record<string, unknown>> {
11+
private async generate_js_functions(): Promise<Record<string, unknown>> {
1412

15-
return await this.formula_functions.generate_object(this.config);
13+
return await this.js_functions.generate_object(this.config);
1614
}
1715

1816
async generate_object(): Promise<Record<string, unknown>> {
1917
const final_object: Record<string, any> = {};
2018
Object.assign(final_object, {
21-
js: await this.generate_formula_functions(),
19+
js: await this.generate_js_functions(),
2220
});
23-
console.log("sasdinal_object");
2421
return final_object;
2522
}
2623
}

src/automations/formula_functions/ScriptFunctions.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,12 @@ export class UserScriptFunctions implements IGenerateObject {
5050
if (!formula_function) {
5151
const msg = `Failed to load user script ${file.path}. No exports detected.`;
5252
LOGGER.error(msg);
53-
new Notice(
54-
msg
55-
, 3000);
56-
throw new Error(msg);
53+
return;
5754
}
5855
if (!(formula_function instanceof Function)) {
5956
const msg = `Failed to load user script ${file.path}. Default export is not a function.`
6057
LOGGER.error(msg);
61-
new Notice(
62-
msg
63-
, 3000);
64-
throw new Error(msg);
58+
return;
6559
}
6660
user_script_functions.set(`${file.basename}`, formula_function);
6761
}

src/helpers/QueryHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { LOGGER } from "services/Logger";
55
export function generateDataviewTableQuery(columns: TableColumn[], fromQuery: string): string {
66
return `TABLE ${columns
77
.filter((col) => !col.isMetadata)
8-
.map((col) => col.key)
8+
.map((col) => `"${col.key}"`)
99
.join(",")},${DatabaseCore.DATAVIEW_FILE},${DatabaseCore.FRONTMATTER_KEY} ${fromQuery}`
1010
}
1111

0 commit comments

Comments
 (0)