mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Port services/hoisted_note
This commit is contained in:
parent
5d683721b1
commit
1010d11827
@ -7,7 +7,7 @@ const sql = require('./sql');
|
|||||||
const protectedSessionService = require('./protected_session');
|
const protectedSessionService = require('./protected_session');
|
||||||
const searchService = require('../services/search/services/search.js');
|
const searchService = require('../services/search/services/search.js');
|
||||||
const SearchContext = require('../services/search/search_context.js');
|
const SearchContext = require('../services/search/search_context.js');
|
||||||
const hoistedNoteService = require('./hoisted_note.js');
|
const hoistedNoteService = require('./hoisted_note');
|
||||||
|
|
||||||
const CALENDAR_ROOT_LABEL = 'calendarRoot';
|
const CALENDAR_ROOT_LABEL = 'calendarRoot';
|
||||||
const YEAR_LABEL = 'yearNote';
|
const YEAR_LABEL = 'yearNote';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const cls = require('./cls');
|
import cls = require('./cls');
|
||||||
const becca = require('../becca/becca');
|
import becca = require('../becca/becca');
|
||||||
|
|
||||||
function getHoistedNoteId() {
|
function getHoistedNoteId() {
|
||||||
return cls.getHoistedNoteId();
|
return cls.getHoistedNoteId();
|
||||||
@ -26,14 +26,14 @@ function isHoistedInHiddenSubtree() {
|
|||||||
function getWorkspaceNote() {
|
function getWorkspaceNote() {
|
||||||
const hoistedNote = becca.getNote(cls.getHoistedNoteId());
|
const hoistedNote = becca.getNote(cls.getHoistedNoteId());
|
||||||
|
|
||||||
if (hoistedNote.isRoot() || hoistedNote.hasLabel('workspace')) {
|
if (hoistedNote && (hoistedNote.isRoot() || hoistedNote.hasLabel('workspace'))) {
|
||||||
return hoistedNote;
|
return hoistedNote;
|
||||||
} else {
|
} else {
|
||||||
return becca.getRoot();
|
return becca.getRoot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export = {
|
||||||
getHoistedNoteId,
|
getHoistedNoteId,
|
||||||
getWorkspaceNote,
|
getWorkspaceNote,
|
||||||
isHoistedInHiddenSubtree
|
isHoistedInHiddenSubtree
|
@ -1,6 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const hoistedNoteService = require('../hoisted_note.js');
|
const hoistedNoteService = require('../hoisted_note');
|
||||||
|
|
||||||
class SearchContext {
|
class SearchContext {
|
||||||
constructor(params = {}) {
|
constructor(params = {}) {
|
||||||
|
@ -10,7 +10,7 @@ const becca = require('../../../becca/becca');
|
|||||||
const beccaService = require('../../../becca/becca_service');
|
const beccaService = require('../../../becca/becca_service');
|
||||||
const utils = require('../../utils');
|
const utils = require('../../utils');
|
||||||
const log = require('../../log');
|
const log = require('../../log');
|
||||||
const hoistedNoteService = require('../../hoisted_note.js');
|
const hoistedNoteService = require('../../hoisted_note');
|
||||||
|
|
||||||
function searchFromNote(note) {
|
function searchFromNote(note) {
|
||||||
let searchResultNoteIds, highlightedTokens;
|
let searchResultNoteIds, highlightedTokens;
|
||||||
|
@ -4,7 +4,7 @@ const becca = require('../becca/becca');
|
|||||||
const noteService = require('./notes');
|
const noteService = require('./notes');
|
||||||
const dateUtils = require('./date_utils');
|
const dateUtils = require('./date_utils');
|
||||||
const log = require('./log');
|
const log = require('./log');
|
||||||
const hoistedNoteService = require('./hoisted_note.js');
|
const hoistedNoteService = require('./hoisted_note');
|
||||||
const searchService = require('./search/services/search.js');
|
const searchService = require('./search/services/search.js');
|
||||||
const SearchContext = require('./search/search_context.js');
|
const SearchContext = require('./search/search_context.js');
|
||||||
const {LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT} = require('./hidden_subtree');
|
const {LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT} = require('./hidden_subtree');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user