feat(views/geomap): remove old geo map type

This commit is contained in:
Elian Doran 2025-07-06 20:23:50 +03:00
parent f5a6dfa629
commit 557bfbd1d6
No known key found for this signature in database
11 changed files with 10 additions and 17 deletions

View File

@ -27,7 +27,6 @@ const NOTE_TYPE_ICONS = {
doc: "bx bxs-file-doc", doc: "bx bxs-file-doc",
contentWidget: "bx bxs-widget", contentWidget: "bx bxs-widget",
mindMap: "bx bx-sitemap", mindMap: "bx bx-sitemap",
geoMap: "bx bx-map-alt",
aiChat: "bx bx-bot" aiChat: "bx bx-bot"
}; };
@ -36,7 +35,7 @@ const NOTE_TYPE_ICONS = {
* end user. Those types should be used only for checking against, they are * end user. Those types should be used only for checking against, they are
* not for direct use. * not for direct use.
*/ */
export type NoteType = "file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code" | "mindMap" | "geoMap" | "aiChat"; export type NoteType = "file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code" | "mindMap" | "aiChat";
export interface NotePathRecord { export interface NotePathRecord {
isArchived: boolean; isArchived: boolean;

View File

@ -35,7 +35,6 @@ export const NOTE_TYPES: NoteTypeMapping[] = [
{ type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), icon: "bx-selection" }, { type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), icon: "bx-selection" },
// Map notes // Map notes
{ type: "geoMap", mime: "application/json", title: t("note_types.geo-map"), icon: "bx-map-alt", isBeta: true },
{ type: "mindMap", mime: "application/json", title: t("note_types.mind-map"), icon: "bx-sitemap" }, { type: "mindMap", mime: "application/json", title: t("note_types.mind-map"), icon: "bx-sitemap" },
{ type: "noteMap", mime: "", title: t("note_types.note-map"), icon: "bxs-network-chart", static: true }, { type: "noteMap", mime: "", title: t("note_types.note-map"), icon: "bxs-network-chart", static: true },
{ type: "relationMap", mime: "application/json", title: t("note_types.relation-map"), icon: "bxs-network-chart" }, { type: "relationMap", mime: "application/json", title: t("note_types.relation-map"), icon: "bxs-network-chart" },

View File

@ -189,7 +189,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type)); this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type));
this.toggleDisabled(this.$showAttachmentsButton, !isInOptions); this.toggleDisabled(this.$showAttachmentsButton, !isInOptions);
this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "geoMap"].includes(note.type)); this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap"].includes(note.type));
const canPrint = ["text", "code"].includes(note.type); const canPrint = ["text", "code"].includes(note.type);
this.toggleDisabled(this.$printActiveNoteButton, canPrint); this.toggleDisabled(this.$printActiveNoteButton, canPrint);

View File

@ -197,7 +197,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
// https://github.com/zadam/trilium/issues/2522 // https://github.com/zadam/trilium/issues/2522
const isBackendNote = this.noteContext?.noteId === "_backendLog"; const isBackendNote = this.noteContext?.noteId === "_backendLog";
const isSqlNote = this.mime === "text/x-sqlite;schema=trilium"; const isSqlNote = this.mime === "text/x-sqlite;schema=trilium";
const isFullHeightNoteType = ["canvas", "webView", "noteMap", "mindMap", "geoMap", "mermaid"].includes(this.type ?? ""); const isFullHeightNoteType = ["canvas", "webView", "noteMap", "mindMap", "mermaid"].includes(this.type ?? "");
const isFullHeight = (!this.noteContext?.hasNoteList() && isFullHeightNoteType && !isSqlNote) const isFullHeight = (!this.noteContext?.hasNoteList() && isFullHeightNoteType && !isSqlNote)
|| this.noteContext?.viewScope?.viewMode === "attachments" || this.noteContext?.viewScope?.viewMode === "attachments"
|| isBackendNote; || isBackendNote;

View File

@ -64,7 +64,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
} }
#isFullWidthNote(note: FNote) { #isFullWidthNote(note: FNote) {
if (["image", "mermaid", "book", "render", "canvas", "webView", "mindMap", "geoMap"].includes(note.type)) { if (["image", "mermaid", "book", "render", "canvas", "webView", "mindMap"].includes(note.type)) {
return true; return true;
} }

View File

@ -1,4 +1,3 @@
import type { AttachmentRow } from "@triliumnext/commons";
import becca from "../becca/becca"; import becca from "../becca/becca";
import becca_loader from "../becca/becca_loader"; import becca_loader from "../becca/becca_loader";
import cls from "../services/cls.js"; import cls from "../services/cls.js";
@ -12,7 +11,7 @@ export default () => {
hidden_subtree.checkHiddenSubtree(true); hidden_subtree.checkHiddenSubtree(true);
for (const note of Object.values(becca.notes)) { for (const note of Object.values(becca.notes)) {
if (note.type !== "geoMap") { if (note.type as string !== "geoMap") {
continue; continue;
} }

View File

@ -102,7 +102,7 @@ eventService.subscribe(eventService.ENTITY_CREATED, ({ entityName, entity }) =>
const content = note.getContent(); const content = note.getContent();
if ( if (
["text", "code", "mermaid", "canvas", "relationMap", "mindMap", "geoMap"].includes(note.type) && ["text", "code", "mermaid", "canvas", "relationMap", "mindMap"].includes(note.type) &&
typeof content === "string" && typeof content === "string" &&
// if the note has already content we're not going to overwrite it with template's one // if the note has already content we're not going to overwrite it with template's one
(!content || content.trim().length === 0) && (!content || content.trim().length === 0) &&

View File

@ -15,7 +15,6 @@ const noteTypes = [
{ type: "doc", defaultMime: "" }, { type: "doc", defaultMime: "" },
{ type: "contentWidget", defaultMime: "" }, { type: "contentWidget", defaultMime: "" },
{ type: "mindMap", defaultMime: "application/json" }, { type: "mindMap", defaultMime: "application/json" },
{ type: "geoMap", defaultMime: "application/json" },
{ type: "aiChat", defaultMime: "application/json" } { type: "aiChat", defaultMime: "application/json" }
]; ];

View File

@ -1,6 +1,4 @@
import type { AttributeType } from "./rows.js"; type LauncherNoteType = "launcher" | "search" | "doc" | "noteMap" | "contentWidget" | "book" | "file" | "image" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "webView" | "code" | "mindMap";
type LauncherNoteType = "launcher" | "search" | "doc" | "noteMap" | "contentWidget" | "book" | "file" | "image" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "webView" | "code" | "mindMap" | "geoMap";
enum Command { enum Command {
jumpToNote, jumpToNote,

View File

@ -119,8 +119,7 @@ export const ALLOWED_NOTE_TYPES = [
"book", "book",
"webView", "webView",
"code", "code",
"mindMap", "mindMap"
"geoMap"
] as const; ] as const;
export type NoteType = (typeof ALLOWED_NOTE_TYPES)[number]; export type NoteType = (typeof ALLOWED_NOTE_TYPES)[number];

View File

@ -158,7 +158,7 @@ console.log("Saved to", outputPath);
* type: * type:
* type: string * type: string
* example: "text" * example: "text"
* enum: ["text", "code", "render", "file", "image", "search", "relationMap", "book", "noteMap", "mermaid", "canvas", "webView", "launcher", "doc", "contentWidget", "mindMap", "geoMap"] * enum: ["text", "code", "render", "file", "image", "search", "relationMap", "book", "noteMap", "mermaid", "canvas", "webView", "launcher", "doc", "contentWidget", "mindMap"]
* description: "[Reference list](https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/note_types.ts)" * description: "[Reference list](https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/note_types.ts)"
* mime: * mime:
* type: string * type: string