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

Commit e1d7bd2

Browse files
committed
Merge branch 'master' into 574-support-of-obsidian-projects
2 parents 79bb68e + 8c81b59 commit e1d7bd2

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

src/components/cellTypes/Editor/RelationEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { recordRowsFromRelation } from "helpers/RelationHelper";
88
import { TableColumn } from "cdm/FolderModel";
99
import { Link } from "obsidian-dataview";
1010
import { OnChangeValue } from "react-select";
11-
import { StyleVariables } from "helpers/Constants";
11+
import { DEFAULT_SETTINGS, StyleVariables } from "helpers/Constants";
1212

1313
const RelationEditor = (props: RelationEditorComponentProps) => {
1414
const { defaultCell, persistChange, relationCell } = props;
@@ -49,7 +49,7 @@ const RelationEditor = (props: RelationEditorComponentProps) => {
4949
const relationRowsCallBack = useCallback(async () => {
5050
const relationRows = await recordRowsFromRelation(
5151
tableColumn.config.related_note_path,
52-
configInfo.getLocalSettings(),
52+
DEFAULT_SETTINGS.local_settings,
5353
columnsInfo.getAllColumns()
5454
);
5555
const multiOptions = Object.entries(relationRows).map(([key, value]) => ({

src/helpers/RelationHelper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export async function recordRowsFromRelation(ddbbPath: string, ddbbConfig: Local
3030
const relationRows: Record<string, string> = {};
3131
const ddbbFile = resolve_tfile(ddbbPath);
3232
const ddbbInfo = new DatabaseInfo(ddbbFile);
33-
ddbbInfo.initDatabaseconfigYaml(ddbbConfig);
34-
const ddbbRows = await sourceDataviewPages(ddbbConfig, ddbbFile.parent.path, columns);
33+
await ddbbInfo.initDatabaseconfigYaml(ddbbConfig);
34+
35+
const ddbbRows = await sourceDataviewPages(ddbbInfo.yaml.config, ddbbFile.parent.path, columns);
3536
ddbbRows
3637
.filter((page) => page[DatabaseCore.FRONTMATTER_KEY] === undefined)
3738
.forEach((page) => {

src/parsers/handlers/unmarshall/UnmarshallFiltersHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class UnmarshallFiltersHandler extends AbstractDiskHandler {
4747
// Is a simple filter
4848
this.localDisk.push(`${YAML_INDENT.repeat(indentLevel)}- field: ${(filter as AtomicFilter).field}`);
4949
this.localDisk.push(`${YAML_INDENT.repeat(indentLevel)} operator: ${(filter as AtomicFilter).operator}`);
50-
this.localDisk.push(`${YAML_INDENT.repeat(indentLevel)} value: ${(filter as AtomicFilter).value ?? ""}`);
50+
this.localDisk.push(`${YAML_INDENT.repeat(indentLevel)} value: "${(filter as AtomicFilter).value ?? ''}"`);
5151
}
5252
}
5353
}

src/services/EditEngineService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class EditEngine {
202202
newValue: inline_regex_target_in_function_of(
203203
ddbbConfig.inline_new_position,
204204
columnId,
205-
ParseService.parseLiteral(newValue, InputType.MARKDOWN, ddbbConfig).toString(),
205+
ParseService.parseLiteral(newValue, InputType.MARKDOWN, ddbbConfig, true).toString(),
206206
contentHasFrontmatter
207207
)
208208
};

src/services/ParseService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,13 @@ class Parse {
249249
break;
250250
case 'array':
251251
auxMarkdown = wrapped.value
252-
.map(v => this.parseToMarkdown(DataviewService.getDataviewAPI().value.wrapValue(v), localSettings, isInline))
252+
.map(
253+
v => this.parseToMarkdown(
254+
DataviewService.wrapLiteral(v),
255+
localSettings,
256+
isInline
257+
)
258+
)
253259
.join(', ');
254260
break;
255261
case 'link':

src/stateManagement/data/handlers/RenameFileHandlerAction.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { PromptModal } from "components/modals/PromptModal";
33
import { MetadataColumns } from "helpers/Constants";
44
import { resolve_tfile } from "helpers/FileManagement";
55
import { Notice } from "obsidian";
6+
import { Link } from "obsidian-dataview";
7+
import { DataviewService } from "services/DataviewService";
68
import { AbstractTableAction } from "stateManagement/AbstractTableAction";
79

810
export default class RenameFileHandlerAction extends AbstractTableAction<DataState> {
@@ -11,17 +13,16 @@ export default class RenameFileHandlerAction extends AbstractTableAction<DataSta
1113
implementation.actions.renameFile = async (rowIndex: number) => {
1214
try {
1315
const rowToRename = get().rows[rowIndex];
14-
15-
const oldFile = rowToRename[MetadataColumns.FILE].toString().split("|");
16-
const prompt_filename = new PromptModal(oldFile[0], "");
16+
const fileLink = rowToRename[MetadataColumns.FILE] as Link;
17+
const oldFile = fileLink.fileName();
18+
const prompt_filename = new PromptModal(oldFile, "");
1719

1820
const renameFilePromise = (newFilename: string) => {
19-
const oldTfile = resolve_tfile(oldFile[1]);
21+
const oldTfile = resolve_tfile(fileLink.path);
2022
const newPath = `${oldTfile.parent.path}/${newFilename}.md`;
2123
app.vault.rename(oldTfile, newPath);
22-
const newFile = `${newFilename}|${newPath}`;
2324
rowToRename.__note__.filepath = newPath;
24-
rowToRename[MetadataColumns.FILE] = newFile;
25+
rowToRename[MetadataColumns.FILE] = DataviewService.getDataviewAPI().fileLink(newPath);
2526
set((state) => {
2627
return {
2728
rows: [...state.rows.slice(0, rowIndex), rowToRename, ...state.rows.slice(rowIndex + 1)]

0 commit comments

Comments
 (0)