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

Commit b1adbe7

Browse files
committed
Merge branch 'style_relations'
2 parents bb191db + 97b1036 commit b1adbe7

37 files changed

+299
-134
lines changed

docs/docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.1.0
2+
### Shiny new things
3+
- Auto refresh when any external change is detected. You can disable it on global settings for performance purposes [ISSUE#482](https://github.com/RafaelGB/obsidian-db-folder/issues/482)
4+
- A database can be related with itselves [ISSUE#605](https://github.com/RafaelGB/obsidian-db-folder/issues/605)
5+
### Visual
6+
- no wrap multiple images avaliable [ISSUE#476](https://github.com/RafaelGB/obsidian-db-folder/issues/476)
17
## 3.1.0-beta.1
28
### Shiny new things
39
- New option for inline fields addition. Add a new field behind the last one. [ISSUE#419](https://github.com/RafaelGB/obsidian-db-folder/issues/419)

manifest-beta.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"id": "dbfolder",
33
"name": "DB Folder",
4-
"version": "3.1.0-beta.1",
5-
"minAppVersion": "0.16.3",
4+
"version": "3.1.0",
5+
"minAppVersion": "1.1.1",
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",
9-
"isDesktopOnly": false
9+
"isDesktopOnly": false,
10+
"fundingUrl": "https://www.buymeacoffee.com/5tsytn22v9Z"
1011
}

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": "3.0.1",
5-
"minAppVersion": "0.16.3",
4+
"version": "3.1.0",
5+
"minAppVersion": "1.1.1",
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-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"jest": "29.3.1",
4343
"jest-mock-extended": "3.0.1",
4444
"jest-environment-jsdom": "29.3.1",
45-
"obsidian": "0.16.3",
45+
"obsidian": "1.1.1",
4646
"rollup": "3.7.5",
4747
"rollup-plugin-typescript2": "0.34.1",
4848
"ts-jest": "29.0.3",

src/DatabaseView.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { obtainFormulasFromFolder } from "automations/AutomationsHelper";
22
import { DatabaseColumn } from "cdm/DatabaseModel";
3-
import { ViewEvents } from "cdm/EmitterModel";
3+
import { UpdaterData, ViewEvents } from "cdm/EmitterModel";
44
import {
55
InitialType,
66
RowDataType,
@@ -35,11 +35,9 @@ import {
3535
WorkspaceLeaf,
3636
TFile,
3737
Menu,
38-
Notice,
3938
} from "obsidian";
4039
import { createRoot, Root } from "react-dom/client";
4140
import DatabaseInfo from "services/DatabaseInfo";
42-
import { DataviewService } from "services/DataviewService";
4341
import { LOGGER } from "services/Logger";
4442
import { SettingsModal } from "Settings";
4543
import StateManager from "StateManager";
@@ -350,4 +348,27 @@ export class DatabaseView extends TextFileView implements HoverParent {
350348
openFilters() {
351349
this.emitter.emit(EMITTERS_GROUPS.SHORTCUT, EMITTERS_SHORTCUT.OPEN_FILTERS);
352350
}
351+
352+
/****************************************************************
353+
* REACTIVE ACTIONS
354+
****************************************************************/
355+
/**
356+
* Dataview API router triggered by any file change
357+
* @param op
358+
* @param file
359+
* @param oldPath
360+
*/
361+
handleExternalMetadataChange(
362+
op: string,
363+
file: TFile,
364+
isActive: boolean,
365+
oldPath?: string
366+
) {
367+
this.emitter.emit(EMITTERS_GROUPS.UPDATER, {
368+
op,
369+
file,
370+
isActive,
371+
oldPath,
372+
} as UpdaterData);
373+
}
353374
}

src/api/obsidian-projects-api.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { resolve_tfile, resolve_tfolder } from "helpers/FileManagement";
1010
import { generateDbConfiguration, generateNewDatabase } from "helpers/CommandsHelper";
1111
import { LocalSettings } from "cdm/SettingsModel";
1212
import { DatabaseColumn } from "cdm/DatabaseModel";
13-
import { dbTrim } from "helpers/StylesHelper";
13+
import { c, dbTrim } from "helpers/StylesHelper";
1414

1515
const projectsMetadataColumns = ["File", "name", "path"];
1616
class ProjectAPI extends ProjectView {
@@ -105,7 +105,9 @@ class ProjectAPI extends ProjectView {
105105
this.view = new DatabaseView(leaf, this.plugin, file);
106106
this.view.initRootContainer(file);
107107
await this.view.initDatabase();
108-
this.dataEl = contentEl.createDiv().appendChild(this.view.containerEl);
108+
this.dataEl = contentEl
109+
.createDiv(c("project-view-container"))
110+
.appendChild(this.view.containerEl);
109111
this.view.onload();
110112
this.enableAutoReload = true;
111113
LOGGER.debug("Database initialized successfully from project view");

src/cdm/EmitterModel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { EMITTERS_GROUPS } from "helpers/Constants";
2+
import { TFile } from "obsidian";
3+
export type UpdaterData = { op: string, file: TFile, isActive: boolean, oldPath?: string };
24

35
export interface ViewEvents {
46
showLaneForm: () => void;
57
[EMITTERS_GROUPS.HOTKEY]: (commandId: string) => void;
68
[EMITTERS_GROUPS.SHORTCUT]: (commandId: string) => void;
9+
[EMITTERS_GROUPS.UPDATER]: (updater: UpdaterData) => void;
710
}

src/cdm/SettingsModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ export type AtomicFilter = {
2424
*/
2525
export interface GlobalSettings {
2626
enable_debug_mode: boolean;
27-
enable_ribbon_icon: boolean;
2827
logger_level_info: string;
2928
media_settings: MediaSettings;
3029
enable_show_state: boolean;
3130
csv_file_header_key: string;
3231
enable_row_shadow: boolean;
32+
enable_auto_update: boolean;
3333
show_search_bar_by_default: boolean;
3434
}
3535

src/cdm/TableStateInterface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ColumnOption } from "cdm/ComponentsModel";
55
import { DatabaseView } from "DatabaseView";
66
import { Literal } from "obsidian-dataview";
77
import { StoreApi, UseBoundStore } from "zustand";
8+
import { UpdaterData } from "cdm/EmitterModel";
89

910
export type TableActionResponse<T> = {
1011
view: DatabaseView,
@@ -54,7 +55,8 @@ export interface DataState {
5455
editOptionForAllRows: (column: TableColumn, oldLabel: string, newLabel: string, columns: TableColumn[], ddbbConfig: LocalSettings) => Promise<void>;
5556
removeOptionForAllRows: (column: TableColumn, option: string, columns: TableColumn[],
5657
ddbbConfig: LocalSettings) => Promise<void>;
57-
dataviewRefresh: (column: TableColumn[], ddbbConfig: LocalSettings, filterConfig: FilterSettings) => void;
58+
dataviewRefresh: (column: TableColumn[], ddbbConfig: LocalSettings, filterConfig: FilterSettings) => Promise<void>;
59+
dataviewUpdater: (updaterData: UpdaterData, columns: TableColumn[], ddbbConfig: LocalSettings, filterConfig: FilterSettings) => Promise<void>;
5860
renameFile: (rowIndex: number) => Promise<void>;
5961
saveDataFromFile: (file: File, columns: TableColumn[], config: LocalSettings) => Promise<void>;
6062
groupFiles: () => Promise<void>;

0 commit comments

Comments
 (0)