backend API to create a launcher

This commit is contained in:
zadam
2022-12-22 14:57:00 +01:00
parent 059c339c09
commit 8ec2547b4a
32 changed files with 947 additions and 173 deletions

View File

@@ -147,7 +147,7 @@ class NoteShort {
async getContent() {
// we're not caching content since these objects are in froca and as such pretty long lived
const note = await server.get("notes/" + this.noteId);
const note = await server.get(`notes/${this.noteId}`);
return note.content;
}
@@ -372,7 +372,7 @@ class NoteShort {
isInHoistedSubTree: path.includes(hoistedNotePath),
isArchived: path.find(noteId => froca.notes[noteId].hasLabel('archived')),
isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
isHidden: path.includes("hidden")
isHidden: path.includes('_hidden')
}));
notePaths.sort((a, b) => {
@@ -454,7 +454,7 @@ class NoteShort {
else if (this.noteId === 'root') {
return "bx bx-chevrons-right";
}
if (this.noteId === 'share') {
if (this.noteId === '_share') {
return "bx bx-share-alt";
}
else if (this.type === 'text') {
@@ -841,7 +841,7 @@ class NoteShort {
return await bundleService.getAndExecuteBundle(this.noteId);
}
else if (env === "backend") {
return await server.post('script/run/' + this.noteId);
const resp = await server.post(`script/run/${this.noteId}`);
}
else {
throw new Error(`Unrecognized env type ${env} for note ${this.noteId}`);
@@ -860,7 +860,7 @@ class NoteShort {
continue;
}
if (parentNote.noteId === 'share' || parentNote.isShared()) {
if (parentNote.noteId === '_share' || parentNote.isShared()) {
return true;
}
}
@@ -873,7 +873,7 @@ class NoteShort {
}
isLaunchBarConfig() {
return this.type === 'launcher' || ['lbRoot', 'lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(this.noteId);
return this.type === 'launcher' || ['_lbRoot', '_lbAvailableLaunchers', '_lbVisibleLaunchers'].includes(this.noteId);
}
isOptions() {