diff --git a/src/public/app/entities/fnote.ts b/src/public/app/entities/fnote.ts index 2e0293112..ec200bdfa 100644 --- a/src/public/app/entities/fnote.ts +++ b/src/public/app/entities/fnote.ts @@ -28,7 +28,8 @@ const NOTE_TYPE_ICONS = { doc: "bx bxs-file-doc", contentWidget: "bx bxs-widget", mindMap: "bx bx-sitemap", - geoMap: "bx bx-map-alt" + geoMap: "bx bx-map-alt", + taskList: "bx bx-list-check" }; /** @@ -36,7 +37,7 @@ const NOTE_TYPE_ICONS = { * end user. Those types should be used only for checking against, they are * not for direct use. */ -export type NoteType = "file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code" | "mindMap" | "geoMap"; +export type NoteType = "file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code" | "mindMap" | "geoMap" | "taskList"; export interface NotePathRecord { isArchived: boolean; diff --git a/src/public/app/services/note_types.ts b/src/public/app/services/note_types.ts index 7aebd48ff..fc6e7bed6 100644 --- a/src/public/app/services/note_types.ts +++ b/src/public/app/services/note_types.ts @@ -20,6 +20,7 @@ async function getNoteTypeItems(command?: NoteTypeCommandNames) { { title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" }, { title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" }, { title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" }, + { title: t("note_types.task-list"), command, type: "taskList", uiIcon: "bx bx-list-check" } ]; const templateNoteIds = await server.get("search-templates"); diff --git a/src/public/app/widgets/note_detail.ts b/src/public/app/widgets/note_detail.ts index afd51a6ae..a16de3ece 100644 --- a/src/public/app/widgets/note_detail.ts +++ b/src/public/app/widgets/note_detail.ts @@ -35,6 +35,7 @@ import GeoMapTypeWidget from "./type_widgets/geo_map.js"; import utils from "../services/utils.js"; import type { NoteType } from "../entities/fnote.js"; import type TypeWidget from "./type_widgets/type_widget.js"; +import TaskListWidget from "./type_widgets/task_list.js"; const TPL = `
@@ -72,7 +73,8 @@ const typeWidgetClasses = { attachmentDetail: AttachmentDetailTypeWidget, attachmentList: AttachmentListTypeWidget, mindMap: MindMapWidget, - geoMap: GeoMapTypeWidget + geoMap: GeoMapTypeWidget, + taskList: TaskListWidget }; /** diff --git a/src/public/app/widgets/note_type.ts b/src/public/app/widgets/note_type.ts index 9b3b90665..1824974fd 100644 --- a/src/public/app/widgets/note_type.ts +++ b/src/public/app/widgets/note_type.ts @@ -48,7 +48,8 @@ const NOTE_TYPES: NoteTypeMapping[] = [ { type: "image", title: t("note_types.image"), selectable: false }, { type: "launcher", mime: "", title: t("note_types.launcher"), selectable: false }, { type: "noteMap", mime: "", title: t("note_types.note-map"), selectable: false }, - { type: "search", title: t("note_types.saved-search"), selectable: false } + { type: "search", title: t("note_types.saved-search"), selectable: false }, + { type: "taskList", title: t("note_types.task-list"), selectable: false } ]; const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter((nt) => !nt.selectable).map((nt) => nt.type); diff --git a/src/public/app/widgets/type_widgets/task_list.ts b/src/public/app/widgets/type_widgets/task_list.ts new file mode 100644 index 000000000..30a5572a2 --- /dev/null +++ b/src/public/app/widgets/type_widgets/task_list.ts @@ -0,0 +1,26 @@ +import type FNote from "../../entities/fnote.js"; +import TypeWidget from "./type_widget.js"; + +const TPL = ` +
+ Task list goes here. +
+`; + +export default class TaskListWidget extends TypeWidget { + + static getType() { return "taskList" } + + doRender() { + this.$widget = $(TPL); + } + + async doRefresh(note: FNote) { + this.$widget.show(); + + if (!this.note) { + return; + } + } + +} diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 1a5d92b32..feaba40ef 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1416,7 +1416,8 @@ "widget": "Widget", "confirm-change": "It is not recommended to change note type when note content is not empty. Do you want to continue anyway?", "geo-map": "Geo Map", - "beta-feature": "Beta" + "beta-feature": "Beta", + "task-list": "To-Do List" }, "protect_note": { "toggle-on": "Protect the note", diff --git a/src/services/note_types.ts b/src/services/note_types.ts index 3e086acf4..46a2e01a9 100644 --- a/src/services/note_types.ts +++ b/src/services/note_types.ts @@ -15,7 +15,8 @@ const noteTypes = [ { type: "doc", defaultMime: "" }, { type: "contentWidget", defaultMime: "" }, { type: "mindMap", defaultMime: "application/json" }, - { type: "geoMap", defaultMime: "application/json" } + { type: "geoMap", defaultMime: "application/json" }, + { type: "taskList", defaultMime: "" } ]; function getDefaultMimeForNoteType(typeName: string) {