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

Commit de19826

Browse files
committed
Merge branch 'control_errors'
2 parents ca272df + 52dd34e commit de19826

File tree

50 files changed

+126
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+126
-98
lines changed

src/DatabaseView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export class DatabaseView extends TextFileView implements HoverParent {
6464
if (file) {
6565
this.file = file;
6666
this.plugin.removeView(this);
67-
this.plugin.addView(this, this.data);
67+
this.plugin.addView(this);
6868
} else {
6969
this.register(
7070
this.containerEl.onWindowMigrated(() => {
7171
this.plugin.removeView(this);
72-
this.plugin.addView(this, this.data);
72+
this.plugin.addView(this);
7373
})
7474
);
7575
}
@@ -93,7 +93,7 @@ export class DatabaseView extends TextFileView implements HoverParent {
9393
return;
9494
}
9595

96-
this.plugin.addView(this, data);
96+
this.plugin.addView(this);
9797
}
9898

9999
getIcon() {

src/cdm/ServicesModel.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@ export abstract class TypeParser<T> {
2323
return this;
2424
}
2525

26-
public beforeParse(...args: unknown[]) {
27-
// Do nothing
28-
}
29-
3026
public parse(wrapped: WrappedLiteral): T {
31-
this.beforeParse();
3227
return wrapped.value as T;
3328
}
3429

3530
public parseLiteral = (wrapped: WrappedLiteral): T => {
36-
this.beforeParse();
3731
const parsed = this.parse(wrapped);
3832
return parsed;
3933
}

src/cdm/TableStateInterface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export interface AutomationState {
106106
getFormula: (name: string) => unknown;
107107
runFormula: (input: string, row: RowDataType, dbbConfig: LocalSettings) => Literal;
108108
dispatchFooter: (column: TableColumn, colValues: Literal[]) => Literal;
109-
dispatchRollup: (configColumn: ConfigColumn, relation: Literal, ddbbConfig: LocalSettings) => Literal;
109+
dispatchRollup: (configColumn: ConfigColumn, relation: Literal) => Literal;
110110
},
111111
actions: {
112112
loadFormulas: (ddbbConfig: LocalSettings) => Promise<void>;

src/commands/addDatabaseHelper/databaseHelperCreationModal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class DatabaseHelperCreationModalManager {
6262
});
6363
});
6464
const sourceOptions: Record<string, string> = {};
65-
Object.entries(SourceDataTypes).forEach(([key, value]) => {
65+
Object.entries(SourceDataTypes).forEach(([, value]) => {
6666
sourceOptions[value] = t(value);
6767
});
6868

@@ -149,7 +149,7 @@ export class DatabaseHelperCreationModalManager {
149149
}
150150

151151
tagHandler(containerEl: HTMLElement) {
152-
const tagArray: Record<string, number> = (app.metadataCache as unknown as any).getTags();
152+
const tagArray: Record<string, number> = app.metadataCache.getTags();
153153
if (tagArray) {
154154
const tagRecords: Record<string, string> = {};
155155
// Order tagRecord by key (tag name)

src/components/behavior/ArrowKeysNavigation.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@ const onKeyDownArrowKeys: KeyboardEventHandler<HTMLDivElement> = (event) => {
1212
const index = Array.from(currentTr.children).indexOf(currentTd);
1313

1414
switch (event.key) {
15-
case "ArrowLeft":
15+
case "ArrowLeft": {
1616
// Left pressed
1717
const TdLeft = currentTd.previousElementSibling;
1818
if (!TdLeft) break;
1919
const TdLeftTabIndex = TdLeft.getElementsByClassName(c('tabIndex'))[0] as TabIndexElement;
2020
if (!TdLeftTabIndex) break;
2121
TdLeftTabIndex.focus();
2222
break;
23-
case "ArrowRight":
23+
}
24+
25+
case "ArrowRight": {
2426
// Right pressed
2527
const TdRight = currentTd.nextElementSibling;
2628
if (!TdRight) break;
2729
const TdRightTabIndex = TdRight.getElementsByClassName(c('tabIndex'))[0] as TabIndexElement;
2830
if (!TdRightTabIndex) break;
2931
TdRightTabIndex.focus();
3032
break;
31-
case "ArrowUp":
33+
}
34+
case "ArrowUp": {
3235
// Up pressed
3336
const TrUp = currentTr
3437
.previousElementSibling
@@ -41,7 +44,8 @@ const onKeyDownArrowKeys: KeyboardEventHandler<HTMLDivElement> = (event) => {
4144
if (!TdUp) break;
4245
TdUp.focus();
4346
break;
44-
case "ArrowDown":
47+
}
48+
case "ArrowDown": {
4549
// Down pressed
4650
const TrDown = currentTr
4751
.nextElementSibling
@@ -54,6 +58,7 @@ const onKeyDownArrowKeys: KeyboardEventHandler<HTMLDivElement> = (event) => {
5458
if (TdDown === undefined) break;
5559
TdDown.focus();
5660
break;
61+
}
5762
}
5863
}
5964

src/components/cellTypes/Editor/filepicker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,14 @@ async function getBlocks(
310310
}
311311

312312
try {
313+
const cachedMetadata = app.metadataCache.getFileCache(file);
314+
313315
const blockCache = await (app.metadataCache as any).blockCache.getForFile(
314316
new MockRunnable(),
315317
file
316318
);
317319

318-
if (!blockCache?.blocks) {
320+
if (!cachedMetadata?.blocks) {
319321
return callback([]);
320322
}
321323

src/components/cellTypes/RollupCell.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ const RollupCell = (mdProps: CellComponentProps) => {
3636
return;
3737
}
3838
const rollupResponse = formulaInfo
39-
.dispatchRollup(
40-
tableColumn.config,
41-
relation as Literal,
42-
configInfo.getLocalSettings()
43-
)
39+
.dispatchRollup(tableColumn.config, relation as Literal)
4440
.toString();
4541

4642
MarkdownService.renderMarkdown(

src/components/modals/TextModal.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export class TextModal extends Modal {
4141
createForm(): void {
4242
const div = this.contentEl.createDiv();
4343
div.addClass(c("prompt-modal"));
44-
let textInput;
45-
textInput = new TextComponent(div);
44+
const textInput = new TextComponent(div);
4645
this.value = this.default_value ?? "";
4746
textInput.inputEl.addClass(c("text-modal"));
4847
textInput.setPlaceholder(this.placeholder);

src/components/modals/addRow/AddRowModal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class AddRowModal extends Modal {
1616
state: AddRowModalProps;
1717
dataState: Partial<DataState>;
1818
configState: Partial<ConfigState>;
19-
enableReset: boolean = false;
19+
enableReset = false;
2020
constructor(
2121
props: AddRowModalProps
2222
) {

src/components/modals/addRow/handlers/FilenameTextHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Setting } from "obsidian";
44
import { AbstractHandlerClass } from "patterns/chain/AbstractHandler";
55

66
export class FilenameTextHandler extends AbstractHandlerClass<AddRowModalHandlerResponse> {
7-
settingTitle: string = t("add_row_modal_filename_text_title");
8-
textElId: string = "AddRowModalManager-addRow-input";
7+
settingTitle = t("add_row_modal_filename_text_title");
8+
textElId = "AddRowModalManager-addRow-input";
99
handle(
1010
response: AddRowModalHandlerResponse
1111
): AddRowModalHandlerResponse {

0 commit comments

Comments
 (0)