From f90e2fb484a3552132b7585000b2891bdf842d89 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Fri, 4 Jul 2025 11:46:10 +0300 Subject: [PATCH] client/tree context menu/insert note: mark the beta note types with a badge --- apps/client/src/menus/context_menu.ts | 2 +- apps/client/src/services/note_types.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts index f343c6c0a..796d1dc84 100644 --- a/apps/client/src/menus/context_menu.ts +++ b/apps/client/src/menus/context_menu.ts @@ -17,7 +17,7 @@ interface MenuSeparatorItem { title: "----"; } -interface MenuItemBadge { +export interface MenuItemBadge { title: string; className?: string; } diff --git a/apps/client/src/services/note_types.ts b/apps/client/src/services/note_types.ts index 7d5b884d9..b9a9fa3ef 100644 --- a/apps/client/src/services/note_types.ts +++ b/apps/client/src/services/note_types.ts @@ -1,10 +1,11 @@ import server from "./server.js"; import froca from "./froca.js"; import { t } from "./i18n.js"; -import type { MenuItem } from "../menus/context_menu.js"; +import type { MenuItem, MenuItemBadge } from "../menus/context_menu.js"; import type { TreeCommandNames } from "../menus/tree_context_menu.js"; const SEPARATOR = { title: "----" }; +const BETA_BADGE: MenuItemBadge = {title: t("note_types.beta-feature")}; async function getNoteTypeItems(command?: TreeCommandNames) { const items: MenuItem[] = [ @@ -24,7 +25,7 @@ async function getNoteTypeItems(command?: TreeCommandNames) { // Map notes { title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" }, - { title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" }, + { title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap", badges: [BETA_BADGE]}, { title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" }, { title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },