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

Commit a9388cc

Browse files
committed
Merge branch 'pane-adjustments'
2 parents e396077 + b60e8f2 commit a9388cc

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

docs/docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.8.1
2+
### No longer broken
3+
- Supports for popout windows. Create new ddbb with Obsidian v15 open a new pane instead of replace file manager[ISSUE#172](https://github.com/RafaelGB/obsidian-db-folder/issues/172)
4+
- Create new rows with the task column enabled works well now [ISSUE#188](https://github.com/RafaelGB/obsidian-db-folder/issues/188)
15
## 1.8.0
26
### Shiny new things
37
- New source option: query. Use your own dataview query as source of the database. Start the query with the `FROM` term, since the plugin will autocomplete the beginning with `TABLE` and the column fields[ISSUE#156](https://github.com/RafaelGB/obsidian-db-folder/issues/156)

src/DatabaseView.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ export class DatabaseView extends TextFileView implements HoverParent {
7474
get isPrimary(): boolean {
7575
return this.plugin.getStateManager(this.file)?.getAView() === this;
7676
}
77-
78-
onMoreOptionsMenu(menu: Menu) {
77+
onPaneMenu(menu: Menu, source: string, callSuper: boolean = true): void {
78+
if (source !== "more-options") {
79+
super.onPaneMenu(menu, source);
80+
return;
81+
}
7982
// Add a menu item to force the database to markdown view
8083
menu
8184
.addItem((item) => {
@@ -109,7 +112,9 @@ export class DatabaseView extends TextFileView implements HoverParent {
109112
})
110113
.addSeparator();
111114

112-
super.onMoreOptionsMenu(menu);
115+
if (callSuper) {
116+
super.onPaneMenu(menu, source);
117+
}
113118
}
114119

115120
async initDatabase(): Promise<void> {

src/components/Cell.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default function DefaultCell(cellProperties: Cell) {
5050
LOGGER.debug(
5151
`default useEffect. dataType:${dataType} - value: ${contextValue.value} cellValue: ${cellValue}`
5252
);
53+
if (dirtyCell) {
54+
// End useEffect
55+
return;
56+
}
5357
switch (dataType) {
5458
case DataTypes.TASK:
5559
// Check if there are tasks in the cell
@@ -70,8 +74,16 @@ export default function DefaultCell(cellProperties: Cell) {
7074

7175
break;
7276
case DataTypes.MARKDOWN:
73-
containerCellRef.current.innerHTML = "";
74-
renderMarkdown(cellProperties, cellValue, containerCellRef.current, 5);
77+
case DataTypes.TEXT:
78+
if (containerCellRef.current !== null) {
79+
containerCellRef.current.innerHTML = "";
80+
renderMarkdown(
81+
cellProperties,
82+
cellValue.toString(),
83+
containerCellRef.current,
84+
5
85+
);
86+
}
7587
break;
7688
default:
7789
// do nothing
@@ -98,7 +110,7 @@ export default function DefaultCell(cellProperties: Cell) {
98110
);
99111
renderMarkdown(
100112
cellProperties,
101-
contextValue.value,
113+
contextValue.value.toString(),
102114
containerCellRef.current,
103115
5
104116
);

src/components/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function CheckboxCell(props: CheckboxProps) {
1717
const note: NoteInfo = (cellProperties.row.original as any).__note__;
1818
/** state of cell value */
1919
const { contextValue, setContextValue } = useContext(CellContext);
20-
const [checked, setChecked] = useState(contextValue.value === 1);
20+
const [checked, setChecked] = useState(contextValue.value.toString() === "1");
2121
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
2222
const newValue = event.target.checked ? 1 : 0;
2323
// save on disk

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { obtainUniqueOptionValues } from "helpers/SelectHelper";
2626
import { Literal } from "obsidian-dataview/lib/data-model/value";
2727
import { DateTime } from "luxon";
2828
import { RowSelectOption } from "cdm/ComponentsModel";
29-
import { viewport } from "@popperjs/core";
3029

3130
export function databaseReducer(state: TableDataType, action: ActionType) {
3231
LOGGER.debug(`<=>databaseReducer action: ${action.type}`, action);
@@ -87,6 +86,7 @@ export function databaseReducer(state: TableDataType, action: ActionType) {
8786
const metadata: Record<string, Literal> = {};
8887
metadata[MetadataColumns.CREATED] = DateTime.now();
8988
metadata[MetadataColumns.MODIFIED] = DateTime.now();
89+
metadata[MetadataColumns.TASKS] = ""; // Represents the tasks for the row as empty
9090
const row: RowDataType = {
9191
...rowRecord.frontmatter,
9292
...rowRecord.inline,

0 commit comments

Comments
 (0)