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

Commit 25fc289

Browse files
committed
Merge branch '442-fr-edit-nested-metadata'
2 parents 8e7e956 + b0a9076 commit 25fc289

File tree

65 files changed

+817
-471
lines changed

Some content is hidden

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

65 files changed

+817
-471
lines changed

docs/docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.7.2
2+
### Shiny new things
3+
- Edit nested metadata arrives! You can now edit nested metadata in the cell editor [ISSUE#442](https://github.com/RafaelGB/obsidian-db-folder/issues/442)
4+
### Performance
5+
- Editions use a new method to update the notes under a queue. It should prevent the plugin from locking the UI when editing a lot of notes or errors editing the same note multiple times
6+
### No longer broken
7+
- support for stack tabs. If a ddbb note is included Obsidian does not crash anymore [ISSUE#435](https://github.com/RafaelGB/obsidian-db-folder/issues/435)
18
## 2.7.1
29
- Hotfix for 2.7.0 of global settings developer options
310
- Experimental support for Objects on text fields

manifest-beta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"id": "dbfolder",
33
"name": "DB Folder",
4-
"version": "2.7.1",
5-
"minAppVersion": "0.15.9",
4+
"version": "2.7.2",
5+
"minAppVersion": "0.16.3",
66
"description": "Folder with the capability to store and retrieve data from a folder like database",
77
"author": "RafaelGB",
88
"authorUrl": "https://github.com/RafaelGB/obsidian-bd-folder",

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"id": "dbfolder",
33
"name": "DB Folder",
4-
"version": "2.7.1",
5-
"minAppVersion": "0.15.9",
4+
"version": "2.7.2",
5+
"minAppVersion": "0.16.3",
66
"description": "Folder with the capability to store and retrieve data from a folder like database",
77
"author": "RafaelGB",
88
"authorUrl": "https://github.com/RafaelGB/obsidian-bd-folder",

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-dbfolder",
3-
"version": "2.7.1",
3+
"version": "2.7.2",
44
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
55
"main": "main.js",
66
"scripts": {
@@ -19,34 +19,34 @@
1919
"license": "MIT",
2020
"devDependencies": {
2121
"@faker-js/faker": "7.5.0",
22-
"@rollup/plugin-commonjs": "22.0.2",
23-
"@rollup/plugin-json": "4.1.0",
24-
"@rollup/plugin-node-resolve": "14.1.0",
25-
"@rollup/plugin-replace": "4.0.0",
26-
"@rollup/plugin-typescript": "8.5.0",
22+
"@rollup/plugin-commonjs": "23.0.0",
23+
"@rollup/plugin-json": "5.0.0",
24+
"@rollup/plugin-node-resolve": "15.0.0",
25+
"@rollup/plugin-replace": "5.0.0",
26+
"@rollup/plugin-typescript": "9.0.1",
2727
"@testing-library/jest-dom": "5.16.5",
2828
"@testing-library/react": "13.4.0",
29-
"@types/jest": "29.0.3",
29+
"@types/jest": "29.1.2",
3030
"@types/luxon": "3.0.1",
31-
"@types/node": "18.7.22",
31+
"@types/node": "18.8.4",
3232
"@types/react": "18.0.21",
3333
"@types/react-color": "3.0.6",
3434
"@types/react-csv": "1.1.3",
3535
"@types/react-datepicker": "4.4.2",
3636
"@types/react-dom": "18.0.6",
3737
"@types/react-window": "1.8.5",
38-
"@typescript-eslint/eslint-plugin": "5.38.0",
39-
"@typescript-eslint/parser": "5.38.0",
40-
"eslint": "8.24.0",
41-
"jest": "29.0.3",
38+
"@typescript-eslint/eslint-plugin": "5.40.0",
39+
"@typescript-eslint/parser": "5.40.0",
40+
"eslint": "8.25.0",
41+
"jest": "29.1.2",
4242
"jest-mock-extended": "3.0.1",
4343
"obsidian": "0.16.3",
4444
"rollup": "2.79.1",
4545
"rollup-plugin-terser": "7.0.2",
46-
"rollup-plugin-typescript2": "0.34.0",
47-
"ts-jest": "29.0.2",
46+
"rollup-plugin-typescript2": "0.34.1",
47+
"ts-jest": "29.0.3",
4848
"tslib": "2.4.0",
49-
"typescript": "4.8.3"
49+
"typescript": "4.8.4"
5050
},
5151
"dependencies": {
5252
"@emotion/styled": "11.10.4",
@@ -59,7 +59,7 @@
5959
"fuse.js": "6.6.2",
6060
"luxon": "3.0.4",
6161
"monkey-around": "2.3.0",
62-
"obsidian-dataview": "0.5.46",
62+
"obsidian-dataview": "0.5.47",
6363
"react": "18.2.0",
6464
"react-color": "2.19.3",
6565
"react-csv": "2.2.2",
@@ -68,6 +68,6 @@
6868
"react-popper": "2.3.0",
6969
"react-select": "5.4.0",
7070
"react-window": "1.8.7",
71-
"zustand": "4.1.1"
71+
"zustand": "4.1.2"
7272
}
7373
}

src/cdm/FolderModel.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,36 @@ export type Models = {
3434
}
3535

3636
export interface ConfigColumn {
37+
/** Mandatory */
3738
enable_media_view: boolean;
38-
link_alias_enabled: boolean;
3939
media_width: number;
4040
media_height: number;
4141
isInline: boolean;
42+
/** Circunstancial */
4243
content_alignment?: string;
4344
wrap_content?: boolean;
45+
// Text
46+
link_alias_enabled?: boolean;
47+
// Tasks
4448
task_hide_completed?: boolean;
49+
// Formulas
4550
formula_query?: string;
4651
persist_formula?: boolean;
52+
/** Extras from yaml */
4753
[key: string]: Literal;
4854
}
4955

5056
export type BaseColumn = {
57+
/** Mandatory */
5158
accessorKey: string;
5259
label: string;
5360
key: string;
5461
input: string;
55-
csvCandidate?: boolean;
62+
config: ConfigColumn;
63+
/** Circunstancial */
64+
nestedKey?: string;
5665
options?: RowSelectOption[];
66+
csvCandidate?: boolean;
5767
width?: number;
5868
position?: number;
5969
isMetadata?: boolean;
@@ -63,7 +73,6 @@ export type BaseColumn = {
6373
isHidden?: boolean;
6474
skipPersist?: boolean;
6575
isDragDisabled?: boolean;
66-
config: ConfigColumn;
6776
}
6877
export type TableColumn = ColumnDef<RowDataType, Literal> & BaseColumn;
6978

src/cdm/ModalsModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type ColumnSettingsHandlerResponse = {
2626

2727
export type ColumnSettingsModalProps = {
2828
dataState: Pick<DataState, "actions">,
29-
columnState: Pick<ColumnsState, "info">,
29+
columnState: Pick<ColumnsState, "info" | "actions">,
3030
configState: Pick<ConfigState, "info">,
3131
view: DatabaseView,
3232
headerMenuProps: HeaderMenuProps

src/cdm/StyleModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ColumnSettingsModal } from "components/modals/columnSettings/ColumnSett
33

44
type BaseStyleProps = {
55
modal: ColumnSettingsModal;
6-
columnKey: string;
6+
columnId: string;
77
};
88

99
export type ColorPickerProps = {

src/cdm/TableStateInterface.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface DataState {
4747
dataviewRefresh: (column: TableColumn[], ddbbConfig: LocalSettings, filterConfig: FilterSettings) => void;
4848
renameFile: (rowIndex: number) => Promise<void>;
4949
saveDataFromFile: (file: File, columns: TableColumn[], config: LocalSettings) => Promise<void>;
50-
groupFiles: () => Promise<void>;
50+
groupFiles: () => Promise<void>;
5151
}
5252
}
5353

@@ -60,7 +60,8 @@ export interface ColumnsState {
6060
remove: (column: TableColumn) => void;
6161
alterSorting: (column: TableColumn) => void;
6262
addOptionToColumn: (column: TableColumn, option: string, backgroundColor: string) => void;
63-
alterColumnType: (column: TableColumn, input: string, parsedRows?: RowDataType[]) => void;
63+
alterColumnType: (column: TableColumn, input: string, parsedRows?: RowDataType[]) => Promise<void>;
64+
alterColumnId: (column: TableColumn, root: string, nestedIds: string[]) => Promise<void>;
6465
alterColumnLabel: (column: TableColumn, label: string) => Promise<void>;
6566
alterColumnSize: (id: string, width: number) => void;
6667
alterIsHidden: (column: TableColumn, isHidden: boolean) => void;

src/components/Columns.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export async function obtainColumnsFromFile(
141141
accessorKey: key,
142142
label: key,
143143
key: key,
144+
id: key,
144145
position: index,
145146
config: DEFAULT_COLUMN_CONFIG,
146147
};
@@ -198,6 +199,7 @@ export async function obtainColumnsFromRows(
198199
accessorKey: key,
199200
label: key,
200201
key: key,
202+
id: key,
201203
position: index,
202204
config: DEFAULT_COLUMN_CONFIG,
203205
};

src/components/DefaultCell.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import React from "react";
22
import { InputType } from "helpers/Constants";
33
import { LOGGER } from "services/Logger";
44
import { RowDataType, TableColumn } from "cdm/FolderModel";
5-
import SelectPortal from "components/portals/SelectPortal";
6-
import CalendarPortal from "components/portals/CalendarPortal";
7-
import CalendarTimePortal from "components/portals/CalendarTimePortal";
5+
import SelectCell from "components/cellTypes/SelectCell";
6+
import CalendarCell from "components/cellTypes/CalendarCell";
7+
import CalendarTimeCell from "components/cellTypes/CalendarTimeCell";
88
import CheckboxCell from "components/cellTypes/CheckboxCell";
99
import TaskCell from "components/cellTypes/TaskCell";
1010
import MarkdownCell from "components/cellTypes/MarkdownCell";
11-
import TagsPortal from "components/portals/TagsPortal";
11+
import TagsCell from "components/cellTypes/TagsCell";
1212
import NumberCell from "components/cellTypes/NumberCell";
1313
import TextCell from "components/cellTypes/TextCell";
1414
import MetadataTimeCell from "components/cellTypes/MetadataTimeCell";
@@ -43,23 +43,23 @@ export default function DefaultCell(
4343

4444
/** Calendar option */
4545
case InputType.CALENDAR:
46-
return <CalendarPortal defaultCell={defaultCell} />;
46+
return <CalendarCell defaultCell={defaultCell} />;
4747

4848
/** Calendar with time option */
4949
case InputType.CALENDAR_TIME:
50-
return <CalendarTimePortal defaultCell={defaultCell} />;
50+
return <CalendarTimeCell defaultCell={defaultCell} />;
5151

5252
/** Metadata options related with date/datetime */
5353
case InputType.METATADA_TIME:
5454
return <MetadataTimeCell defaultCell={defaultCell} />;
5555

5656
/** Selector option */
5757
case InputType.SELECT:
58-
return <SelectPortal defaultCell={defaultCell} />;
58+
return <SelectCell defaultCell={defaultCell} />;
5959

6060
/** Tags option */
6161
case InputType.TAGS:
62-
return <TagsPortal defaultCell={defaultCell} />;
62+
return <TagsCell defaultCell={defaultCell} />;
6363

6464
/** Tasks option */
6565
case InputType.TASK:

0 commit comments

Comments
 (0)