mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: FIXME -> TODO
This commit is contained in:
parent
3d9da26bb3
commit
aff1c30557
@ -89,14 +89,14 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasStringContent(): boolean {
|
hasStringContent(): boolean {
|
||||||
// FIXME: Not sure why some entities don't implement it.
|
// TODO: Not sure why some entities don't implement it.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract getPojo(): {};
|
abstract getPojo(): {};
|
||||||
|
|
||||||
get isDeleted(): boolean {
|
get isDeleted(): boolean {
|
||||||
// FIXME: Not sure why some entities don't implement it.
|
// TODO: Not sure why some entities don't implement it.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const attachmentRoleToNoteTypeMapping = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface ContentOpts {
|
interface ContentOpts {
|
||||||
// FIXME: Found in bnote.ts, to check if it's actually used and not a typo.
|
// TODO: Found in bnote.ts, to check if it's actually used and not a typo.
|
||||||
forceSave?: boolean;
|
forceSave?: boolean;
|
||||||
|
|
||||||
/** will also save this BAttachment entity */
|
/** will also save this BAttachment entity */
|
||||||
@ -135,7 +135,7 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
convertToNote(): { note: BNote, branch: BBranch } {
|
convertToNote(): { note: BNote, branch: BBranch } {
|
||||||
// FIXME: can this ever be "search"?
|
// TODO: can this ever be "search"?
|
||||||
if (this.type as string === 'search') {
|
if (this.type as string === 'search') {
|
||||||
throw new Error(`Note of type search cannot have child notes`);
|
throw new Error(`Note of type search cannot have child notes`);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BlobRow } from "./rows";
|
import { BlobRow } from "./rows";
|
||||||
|
|
||||||
// FIXME: Why this does not extend the abstract becca?
|
// TODO: Why this does not extend the abstract becca?
|
||||||
class BBlob {
|
class BBlob {
|
||||||
static get entityName() { return "blobs"; }
|
static get entityName() { return "blobs"; }
|
||||||
static get primaryKeyName() { return "blobId"; }
|
static get primaryKeyName() { return "blobId"; }
|
||||||
|
@ -216,7 +216,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
||||||
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
||||||
*/
|
*/
|
||||||
// FIXME: original declaration was (string | Buffer), but everywhere it's used as a string.
|
// TODO: original declaration was (string | Buffer), but everywhere it's used as a string.
|
||||||
getContent(): string {
|
getContent(): string {
|
||||||
return this._getContent() as string;
|
return this._getContent() as string;
|
||||||
}
|
}
|
||||||
@ -900,7 +900,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
const {searchResultNoteIds} = searchService.searchFromNote(this);
|
const {searchResultNoteIds} = searchService.searchFromNote(this);
|
||||||
|
|
||||||
const becca = this.becca;
|
const becca = this.becca;
|
||||||
return (searchResultNoteIds as string[]) // FIXME: remove cast once search is converted
|
return (searchResultNoteIds as string[]) // TODO: remove cast once search is converted
|
||||||
.map(resultNoteId => becca.notes[resultNoteId])
|
.map(resultNoteId => becca.notes[resultNoteId])
|
||||||
.filter(note => !!note);
|
.filter(note => !!note);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
|
|||||||
*
|
*
|
||||||
* This is the same approach as is used for Note's content.
|
* This is the same approach as is used for Note's content.
|
||||||
*/
|
*/
|
||||||
// FIXME: initial declaration included Buffer, but everywhere it's treated as a string.
|
// TODO: initial declaration included Buffer, but everywhere it's treated as a string.
|
||||||
getContent(): string {
|
getContent(): string {
|
||||||
return this._getContent() as string;
|
return this._getContent() as string;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// FIXME: Booleans should probably be numbers instead (as SQLite does not have booleans.);
|
// TODO: Booleans should probably be numbers instead (as SQLite does not have booleans.);
|
||||||
|
|
||||||
export interface AttachmentRow {
|
export interface AttachmentRow {
|
||||||
attachmentId?: string;
|
attachmentId?: string;
|
||||||
|
@ -31,7 +31,7 @@ function changePassword(currentPassword: string, newPassword: string) {
|
|||||||
const newPasswordVerificationKey = utils.toBase64(myScryptService.getVerificationHash(newPassword));
|
const newPasswordVerificationKey = utils.toBase64(myScryptService.getVerificationHash(newPassword));
|
||||||
|
|
||||||
if (decryptedDataKey) {
|
if (decryptedDataKey) {
|
||||||
// FIXME: what should happen if the decrypted data key is null?
|
// TODO: what should happen if the decrypted data key is null?
|
||||||
passwordEncryptionService.setDataKey(newPassword, decryptedDataKey);
|
passwordEncryptionService.setDataKey(newPassword, decryptedDataKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ function unescapeHtml(str: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toObject<T, K extends string | number | symbol, V>(array: T[], fn: (item: T) => [K, V]): Record<K, V> {
|
function toObject<T, K extends string | number | symbol, V>(array: T[], fn: (item: T) => [K, V]): Record<K, V> {
|
||||||
const obj: Record<K, V> = {} as Record<K, V>; // FIXME: unsafe?
|
const obj: Record<K, V> = {} as Record<K, V>; // TODO: unsafe?
|
||||||
|
|
||||||
for (const item of array) {
|
for (const item of array) {
|
||||||
const ret = fn(item);
|
const ret = fn(item);
|
||||||
@ -98,7 +98,7 @@ function stripTags(text: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function union<T extends string | number | symbol>(a: T[], b: T[]): T[] {
|
function union<T extends string | number | symbol>(a: T[], b: T[]): T[] {
|
||||||
const obj: Record<T, T> = {} as Record<T, T>; // FIXME: unsafe?
|
const obj: Record<T, T> = {} as Record<T, T>; // TODO: unsafe?
|
||||||
|
|
||||||
for (let i = a.length-1; i >= 0; i--) {
|
for (let i = a.length-1; i >= 0; i--) {
|
||||||
obj[a[i]] = a[i];
|
obj[a[i]] = a[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user