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 searchService = require('../services/search/services/search.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 YEAR_LABEL = 'yearNote';
|
||||
|
@ -1,5 +1,5 @@
|
||||
const cls = require('./cls');
|
||||
const becca = require('../becca/becca');
|
||||
import cls = require('./cls');
|
||||
import becca = require('../becca/becca');
|
||||
|
||||
function getHoistedNoteId() {
|
||||
return cls.getHoistedNoteId();
|
||||
@ -26,14 +26,14 @@ function isHoistedInHiddenSubtree() {
|
||||
function getWorkspaceNote() {
|
||||
const hoistedNote = becca.getNote(cls.getHoistedNoteId());
|
||||
|
||||
if (hoistedNote.isRoot() || hoistedNote.hasLabel('workspace')) {
|
||||
if (hoistedNote && (hoistedNote.isRoot() || hoistedNote.hasLabel('workspace'))) {
|
||||
return hoistedNote;
|
||||
} else {
|
||||
return becca.getRoot();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export = {
|
||||
getHoistedNoteId,
|
||||
getWorkspaceNote,
|
||||
isHoistedInHiddenSubtree
|
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
const hoistedNoteService = require('../hoisted_note.js');
|
||||
const hoistedNoteService = require('../hoisted_note');
|
||||
|
||||
class SearchContext {
|
||||
constructor(params = {}) {
|
||||
|
@ -10,7 +10,7 @@ const becca = require('../../../becca/becca');
|
||||
const beccaService = require('../../../becca/becca_service');
|
||||
const utils = require('../../utils');
|
||||
const log = require('../../log');
|
||||
const hoistedNoteService = require('../../hoisted_note.js');
|
||||
const hoistedNoteService = require('../../hoisted_note');
|
||||
|
||||
function searchFromNote(note) {
|
||||
let searchResultNoteIds, highlightedTokens;
|
||||
|
@ -4,7 +4,7 @@ const becca = require('../becca/becca');
|
||||
const noteService = require('./notes');
|
||||
const dateUtils = require('./date_utils');
|
||||
const log = require('./log');
|
||||
const hoistedNoteService = require('./hoisted_note.js');
|
||||
const hoistedNoteService = require('./hoisted_note');
|
||||
const searchService = require('./search/services/search.js');
|
||||
const SearchContext = require('./search/search_context.js');
|
||||
const {LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT} = require('./hidden_subtree');
|
||||
|
Loading…
x
Reference in New Issue
Block a user