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