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

Commit ea3291e

Browse files
committed
template
1 parent 38b2628 commit ea3291e

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/components/Cell.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export default function DefaultCell(cellProperties: Cell) {
6363
);
6464
break;
6565
case DataTypes.MARKDOWN:
66-
console.log("MARKDOWN initialValue", initialValue);
6766
containerCellRef.current.innerHTML = "";
6867
renderMarkdown(cellProperties, initialValue, containerCellRef.current);
6968
break;
@@ -91,7 +90,6 @@ export default function DefaultCell(cellProperties: Cell) {
9190
`useEffect hooked with dirtyCell. Value:${contextValue.value}`
9291
);
9392
//TODO - this is a hack. find why is layout effect called twice
94-
console.log("dirtyCell initialValue", contextValue.value);
9593
containerCellRef.current.innerHTML = "";
9694
renderMarkdown(
9795
cellProperties,

src/components/markdown/MarkdownRenderer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export async function renderMarkdown(
1212
domElement: HTMLDivElement
1313
): Promise<HTMLDivElement> {
1414
try {
15-
console.log("rendering markdown", markdownString);
1615
const view: DatabaseView = (cell as any).tableData.view;
1716
const column = cell.column as unknown as DatabaseColumn;
1817
const { media_height, media_width, enable_media_view } = column.config;

src/settings/handlers/columns/UseFileFieldsAsTemplateColumnsHandler.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { RowDataType } from "cdm/FolderModel";
12
import { obtainColumnsFromFile } from "components/Columns";
2-
import { Setting } from "obsidian";
3-
import { DataviewService } from "services/DataviewService";
3+
import { Notice, Setting } from "obsidian";
44
import { VaultManagerDB } from "services/FileManagerService";
55
import { AbstractSettingsHandler, SettingHandlerResponse } from "settings/handlers/AbstractSettingHandler";
66

@@ -12,12 +12,12 @@ export class UseFileFieldsAsTemplateColumnsHandler extends AbstractSettingsHandl
1212
// Local exclusivey
1313
if (local) {
1414
const filePaths: Record<string, string> = {};
15-
app.vault.getMarkdownFiles()
16-
.filter(file => file.path.startsWith(view.file.parent.path))
17-
.forEach(file => { filePaths[file.path] = file.basename });
15+
view.rows.forEach((row: RowDataType) => {
16+
filePaths[row.note.getFile().path] = row.note.getFile().basename;
17+
});
1818
new Setting(containerEl)
1919
.setName(this.settingTitle)
20-
.setDesc('Select file to use as template for database columns')
20+
.setDesc('Select file to use as template for database columns. Click the button to apply the template.')
2121
.addDropdown((dropdown) => {
2222
dropdown.addOptions(filePaths);
2323
dropdown.setValue("-");
@@ -32,6 +32,7 @@ export class UseFileFieldsAsTemplateColumnsHandler extends AbstractSettingsHandl
3232
const columns = await obtainColumnsFromFile(tfile);
3333
view.diskConfig.yaml.columns = columns;
3434
view.diskConfig.saveOnDisk();
35+
new Notice(`${Object.keys(columns).length} Columns were loaded from file "${tfile.basename}"! Close this dialog to show the database changes`);
3536
});
3637
});
3738
}

0 commit comments

Comments
 (0)