Skip to content

Build your personal knowledge base with Trilium Notes

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

Elian Doran557bfbd1d63b
diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.ts
index fd35c09b8a..b5d575ed97 100644
--- a/apps/client/src/entities/fnote.ts
+++ b/apps/client/src/entities/fnote.ts
@@ -27,7 +27,6 @@ const NOTE_TYPE_ICONS = {
doc: "bx bxs-file-doc",
contentWidget: "bx bxs-widget",
mindMap: "bx bx-sitemap",
- geoMap: "bx bx-map-alt",
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
* 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 {
isArchived: boolean;
diff --git a/apps/client/src/services/note_types.ts b/apps/client/src/services/note_types.ts
index d35e7df8ba..9f566f4879 100644
--- a/apps/client/src/services/note_types.ts
+++ b/apps/client/src/services/note_types.ts
@@ -35,7 +35,6 @@ export const NOTE_TYPES: NoteTypeMapping[] = [
{ type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), icon: "bx-selection" },
// 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: "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" },
@@ -61,7 +60,7 @@ export const NOTE_TYPES: NoteTypeMapping[] = [
const NEW_TEMPLATE_MAX_AGE = 3;
/** The length of a day in milliseconds. */
-const DAY_LENGTH = 1000 * 60 * 60 * 24;
+const DAY_LENGTH = 1000 * 60 * 60 * 24;
/** The menu item badge used to mark new note types and templates */
const NEW_BADGE: MenuItemBadge = {
diff --git a/apps/client/src/widgets/buttons/note_actions.ts b/apps/client/src/widgets/buttons/note_actions.ts
index 6989d81525..9bef36f3a8 100644
--- a/apps/client/src/widgets/buttons/note_actions.ts
+++ b/apps/client/src/widgets/buttons/note_actions.ts
@@ -189,7 +189,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type));
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);
this.toggleDisabled(this.$printActiveNoteButton, canPrint);
diff --git a/apps/client/src/widgets/note_detail.ts b/apps/client/src/widgets/note_detail.ts
index 3b232134a1..2ee5a6116c 100644
--- a/apps/client/src/widgets/note_detail.ts
+++ b/apps/client/src/widgets/note_detail.ts
@@ -197,7 +197,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
// https://github.com/zadam/trilium/issues/2522
const isBackendNote = this.noteContext?.noteId === "_backendLog";
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)
|| this.noteContext?.viewScope?.viewMode === "attachments"
|| isBackendNote;
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts
index c8474075db..2e59cfbab6 100644
--- a/apps/client/src/widgets/note_wrapper.ts
+++ b/apps/client/src/widgets/note_wrapper.ts
@@ -64,7 +64,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
}
#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;
}
diff --git a/apps/server/src/migrations/0233__migrate_geo_map_to_collection.ts b/apps/server/src/migrations/0233__migrate_geo_map_to_collection.ts
index b0f49144cd..bd692a736e 100644
--- a/apps/server/src/migrations/0233__migrate_geo_map_to_collection.ts
+++ b/apps/server/src/migrations/0233__migrate_geo_map_to_collection.ts
@@ -1,4 +1,3 @@
-import type { AttachmentRow } from "@triliumnext/commons";
import becca from "../becca/becca";
import becca_loader from "../becca/becca_loader";
import cls from "../services/cls.js";
@@ -12,7 +11,7 @@ export default () => {
hidden_subtree.checkHiddenSubtree(true);
for (const note of Object.values(becca.notes)) {
- if (note.type !== "geoMap") {
+ if (note.type as string !== "geoMap") {
continue;
}
diff --git a/apps/server/src/services/handlers.ts b/apps/server/src/services/handlers.ts
index 9d64b83039..52e50cbf3e 100644
--- a/apps/server/src/services/handlers.ts
+++ b/apps/server/src/services/handlers.ts
@@ -102,7 +102,7 @@ eventService.subscribe(eventService.ENTITY_CREATED, ({ entityName, entity }) =>
const content = note.getContent();
if (
- ["text", "code", "mermaid", "canvas", "relationMap", "mindMap", "geoMap"].includes(note.type) &&
+ ["text", "code", "mermaid", "canvas", "relationMap", "mindMap"].includes(note.type) &&
typeof content === "string" &&
// if the note has already content we're not going to overwrite it with template's one
(!content || content.trim().length === 0) &&
diff --git a/apps/server/src/services/note_types.ts b/apps/server/src/services/note_types.ts
index 3b2dc8d662..2aa86d0b64 100644
--- a/apps/server/src/services/note_types.ts
+++ b/apps/server/src/services/note_types.ts
@@ -15,7 +15,6 @@ const noteTypes = [
{ type: "doc", defaultMime: "" },
{ type: "contentWidget", defaultMime: "" },
{ type: "mindMap", defaultMime: "application/json" },
- { type: "geoMap", defaultMime: "application/json" },
{ type: "aiChat", defaultMime: "application/json" }
];
diff --git a/packages/commons/src/lib/hidden_subtree.ts b/packages/commons/src/lib/hidden_subtree.ts
index af860aba8a..8440fdeb3c 100644
--- a/packages/commons/src/lib/hidden_subtree.ts
+++ b/packages/commons/src/lib/hidden_subtree.ts
@@ -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" | "geoMap";
+type LauncherNoteType = "launcher" | "search" | "doc" | "noteMap" | "contentWidget" | "book" | "file" | "image" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "webView" | "code" | "mindMap";
enum Command {
jumpToNote,
diff --git a/packages/commons/src/lib/rows.ts b/packages/commons/src/lib/rows.ts
index a407d80013..d45b1eb16b 100644
--- a/packages/commons/src/lib/rows.ts
+++ b/packages/commons/src/lib/rows.ts
@@ -119,8 +119,7 @@ export const ALLOWED_NOTE_TYPES = [
"book",
"webView",
"code",
- "mindMap",
- "geoMap"
+ "mindMap"
] as const;
export type NoteType = (typeof ALLOWED_NOTE_TYPES)[number];
diff --git a/scripts/generate-openapi.ts b/scripts/generate-openapi.ts
index 0a5d6a8612..d2a074e669 100644
--- a/scripts/generate-openapi.ts
+++ b/scripts/generate-openapi.ts
@@ -158,7 +158,7 @@ console.log("Saved to", outputPath);
* type:
* type: string
* 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)"
* mime:
* type: string