mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
client/note types mapping: add a way to highlight newly introduced types
This commit is contained in:
@@ -10,6 +10,8 @@ export interface NoteTypeMapping {
|
||||
mime?: string;
|
||||
title: string;
|
||||
icon?: string;
|
||||
/** Indicates whether this type should be marked as a newly introduced feature. */
|
||||
isNew?: boolean;
|
||||
/** Indicates that this note type is part of a beta feature. */
|
||||
isBeta?: boolean;
|
||||
/** Indicates that this note type cannot be created by the user. */
|
||||
@@ -77,6 +79,10 @@ function getBlankNoteTypes(command): MenuItem<TreeCommandNames>[] {
|
||||
badges: []
|
||||
}
|
||||
|
||||
if (nt.isNew) {
|
||||
menuItem.badges?.push({title: t("note_types.new-feature"), className: "new-note-type-badge"});
|
||||
}
|
||||
|
||||
if (nt.isBeta) {
|
||||
menuItem.badges?.push({title: t("note_types.beta-feature")});
|
||||
}
|
||||
|
||||
@@ -1626,7 +1626,8 @@
|
||||
"geo-map": "Geo Map",
|
||||
"beta-feature": "Beta",
|
||||
"ai-chat": "AI Chat",
|
||||
"task-list": "Task List"
|
||||
"task-list": "Task List",
|
||||
"new-feature": "New"
|
||||
},
|
||||
"protect_note": {
|
||||
"toggle-on": "Protect the note",
|
||||
|
||||
@@ -69,6 +69,11 @@ export default class NoteTypeWidget extends NoteContextAwareWidget {
|
||||
let $typeLink: JQuery<HTMLElement>;
|
||||
|
||||
const $title = $("<span>").text(noteType.title);
|
||||
|
||||
if (noteType.isNew) {
|
||||
$title.append($(`<span class="badge new-note-type-badge">`).text(t("note_types.new-feature")));
|
||||
}
|
||||
|
||||
if (noteType.isBeta) {
|
||||
$title.append($(`<span class="badge">`).text(t("note_types.beta-feature")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user