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

Commit 03f3efb

Browse files
committed
fixing subgroups with new link info
1 parent a22f6da commit 03f3efb

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

src/components/cellTypes/SelectCell.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Relationship from "components/RelationShip";
22
import { grey, randomColor } from "helpers/Colors";
3-
import React, { useState } from "react";
3+
import React, { useMemo, useState } from "react";
44
import { CellComponentProps, RowSelectOption } from "cdm/ComponentsModel";
55
import { TableColumn } from "cdm/FolderModel";
66
import CreatableSelect from "react-select/creatable";
@@ -32,9 +32,7 @@ const SelectCell = (popperProps: CellComponentProps) => {
3232

3333
const [showSelect, setShowSelect] = useState(false);
3434

35-
const columnActions = table.options.meta.tableState.columns(
36-
(state) => state.actions
37-
);
35+
const columnActions = tableState.columns((state) => state.actions);
3836

3937
function getColor() {
4038
const match = tableColumn.options.find(
@@ -49,13 +47,21 @@ const SelectCell = (popperProps: CellComponentProps) => {
4947
color: getColor(),
5048
};
5149

52-
const multiOptions = tableColumn.options
53-
.sort((a, b) => a.label.localeCompare(b.label))
54-
.map((option: RowSelectOption) => ({
55-
value: option.label,
56-
label: option.label,
57-
color: option.backgroundColor,
58-
}));
50+
const multiOptions = useMemo(
51+
() =>
52+
tableColumn.options
53+
.filter(
54+
(option: RowSelectOption) =>
55+
option.label !== undefined && option.label !== null
56+
)
57+
.sort((a, b) => a.label.localeCompare(b.label))
58+
.map((option: RowSelectOption) => ({
59+
value: option.label,
60+
label: option.label,
61+
color: option.backgroundColor,
62+
})),
63+
[selectRow]
64+
);
5965

6066
const handleOnChange = (
6167
newValue: OnChangeValue<any, false>,

src/components/cellTypes/TagsCell.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ const TagsCell = (tagsProps: CellComponentProps) => {
7171
const multiOptions = useMemo(
7272
() =>
7373
tableColumn.options
74+
.filter(
75+
(option: RowSelectOption) =>
76+
option.label !== undefined && option.label !== null
77+
)
7478
.sort((a, b) => a.label.localeCompare(b.label))
7579
.map((option: RowSelectOption) => ({
7680
value: option.label,

src/services/FileGroupingService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { RowDataType } from "cdm/FolderModel";
55
import { LocalSettings } from "cdm/SettingsModel";
66
import { resolveNewFilePath } from "helpers/FileManagement";
77
import { MetadataColumns } from "helpers/Constants";
8+
import { Link } from "obsidian-dataview";
9+
import { DataviewService } from "./DataviewService";
810

911
const limitMovingFiles = pLimit(1);
1012
const limitCreatingFolders = pLimit(1);
@@ -46,7 +48,7 @@ export class FileGroupingService {
4648
}
4749

4850
await app.fileManager.renameFile(file, filePath);
49-
row[MetadataColumns.FILE] = `${file.basename}|${folderPath}/${file.name}`;
51+
row[MetadataColumns.FILE] = DataviewService.getDataviewAPI().fileLink(filePath);
5052
row.__note__.filepath = `${folderPath}/${file.name}`;
5153
return true;
5254
});

src/stateManagement/data/handlers/GroupFilesHandlerAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export default class GroupFilesHandlerAction extends AbstractTableAction<DataSta
1616
view.diskConfig.yaml.config
1717
);
1818
await FileGroupingService.removeEmptyFolders(
19-
folderPath,
20-
view.diskConfig.yaml.config
19+
folderPath,
20+
view.diskConfig.yaml.config
2121
);
2222
const rowsMap = new Map(movedRows.map((row) => [row.__note__.filepath, row]));
2323
set((state) => {

0 commit comments

Comments
 (0)