diff --git a/src/public/app/entities/fnote.ts b/src/public/app/entities/fnote.ts index 053ac6be5..66626259b 100644 --- a/src/public/app/entities/fnote.ts +++ b/src/public/app/entities/fnote.ts @@ -38,10 +38,10 @@ const NOTE_TYPE_ICONS = { */ type NoteType = "file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code" | "mindMap" | "geoMap"; -interface NotePathRecord { +export interface NotePathRecord { isArchived: boolean; isInHoistedSubTree: boolean; - isSearch: boolean; + isSearch?: boolean; notePath: string[]; isHidden: boolean; } @@ -402,14 +402,14 @@ class FNote { return notePaths; } - getSortedNotePathRecords(hoistedNoteId = "root") { + getSortedNotePathRecords(hoistedNoteId = "root"): NotePathRecord[] { const isHoistedRoot = hoistedNoteId === "root"; - const notePaths = this.getAllNotePaths().map((path) => ({ + const notePaths: NotePathRecord[] = this.getAllNotePaths().map((path) => ({ notePath: path, isInHoistedSubTree: isHoistedRoot || path.includes(hoistedNoteId), isArchived: path.some((noteId) => froca.notes[noteId].isArchived), - isSearch: path.find((noteId) => froca.notes[noteId].type === "search"), + isSearch: path.some((noteId) => froca.notes[noteId].type === "search"), isHidden: path.includes("_hidden") })); diff --git a/src/public/app/services/load_results.ts b/src/public/app/services/load_results.ts index 0f96cee93..b7cdf5545 100644 --- a/src/public/app/services/load_results.ts +++ b/src/public/app/services/load_results.ts @@ -8,6 +8,7 @@ interface NoteRow { } interface BranchRow { + noteId?: string; branchId: string; componentId: string; parentNoteId?: string; diff --git a/src/public/app/widgets/ribbon_widgets/note_paths.js b/src/public/app/widgets/ribbon_widgets/note_paths.ts similarity index 84% rename from src/public/app/widgets/ribbon_widgets/note_paths.js rename to src/public/app/widgets/ribbon_widgets/note_paths.ts index cabf4f39d..cae48bd4d 100644 --- a/src/public/app/widgets/ribbon_widgets/note_paths.js +++ b/src/public/app/widgets/ribbon_widgets/note_paths.ts @@ -2,6 +2,9 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js"; import treeService from "../../services/tree.js"; import linkService from "../../services/link.js"; import { t } from "../../services/i18n.js"; +import type FNote from "../../entities/fnote.js"; +import type { NotePathRecord } from "../../entities/fnote.js"; +import type { EventData } from "../../components/app_context.js"; const TPL = `
`; export default class NotePathsWidget extends NoteContextAwareWidget { + + private $notePathIntro!: JQuery