mirror of
https://github.com/brendan-ch/todo-tracker-obsidian.git
synced 2026-04-16 23:00:32 +00:00
Add placeholder daily note selection modal
This commit is contained in:
25
src/modals/daily-note-select-modal.ts
Normal file
25
src/modals/daily-note-select-modal.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { App, Modal, Setting } from 'obsidian';
|
||||
|
||||
export class DailyNoteSelectModal extends Modal {
|
||||
constructor(app: App, onSubmit: (result: string) => void) {
|
||||
super(app);
|
||||
this.setTitle('Select a daily note');
|
||||
|
||||
let name = '';
|
||||
new Setting(this.contentEl)
|
||||
.setName('Date')
|
||||
.addMomentFormat((component) => {
|
||||
|
||||
});
|
||||
|
||||
new Setting(this.contentEl)
|
||||
.addButton((btn) =>
|
||||
btn
|
||||
.setButtonText('Submit')
|
||||
.setCta()
|
||||
.onClick(() => {
|
||||
this.close();
|
||||
onSubmit(name);
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import type { TodoItem } from '../core/types';
|
||||
export interface TodoItemCallbacks {
|
||||
onToggle: (todo: TodoItem) => void;
|
||||
onMoveClick: (todo: TodoItem) => void;
|
||||
onMoveDailyNoteClick: (todo: TodoItem) => void;
|
||||
onClick: (todo: TodoItem) => void;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ItemView, Keymap, Platform, TFile, WorkspaceLeaf } from 'obsidian';
|
||||
import { ItemView, Platform, TFile, WorkspaceLeaf } from 'obsidian';
|
||||
import type { TodoItem, TodoGroup } from '../core/types';
|
||||
import { parseTodosGroupedByHeading } from '../core/todo-parser';
|
||||
import { toggleTodo, collectTodoBlockLines, removeTodoBlock } from '../core/todo-transformer';
|
||||
import { createTodoItemEl, collectChildLineNumbers } from './todo-item-component';
|
||||
import { toggleTodo } from '../core/todo-transformer';
|
||||
import { createTodoItemEl } from './todo-item-component';
|
||||
|
||||
export const TODO_VIEW_TYPE = 'todo-tracker-view';
|
||||
|
||||
@@ -144,6 +144,7 @@ export class TodoSidebarView extends ItemView {
|
||||
const itemEl = createTodoItemEl(container, todo, {
|
||||
onToggle: (t) => this.handleToggle(file, t),
|
||||
onMoveClick: (t) => this.handleMoveClick(t, file),
|
||||
onMoveDailyNoteClick: (t) => this.handleMoveDailyNoteClick(t, file),
|
||||
onClick: (t) => this.openTodoInEditor(file, t),
|
||||
});
|
||||
|
||||
@@ -349,4 +350,8 @@ export class TodoSidebarView extends ItemView {
|
||||
new NoteSelectModal(this.app, todo, file).open();
|
||||
});
|
||||
}
|
||||
|
||||
private handleMoveDailyNoteClick(t: TodoItem, file: TFile): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user