diff --git a/package-lock.json b/package-lock.json index aebe0d41f7..7efaa46d3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.46.3-beta", + "version": "0.46.4-beta", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/public/app/services/attribute_renderer.js b/src/public/app/services/attribute_renderer.js index 5212536d2a..08120e754c 100644 --- a/src/public/app/services/attribute_renderer.js +++ b/src/public/app/services/attribute_renderer.js @@ -79,6 +79,15 @@ async function renderAttributes(attributes, renderIsInheritable) { return $container; } +const HIDDEN_ATTRIBUTES = [ + 'originalFileName', + 'template', + 'cssClass', + 'iconClass', + 'pageSize', + 'viewType' +]; + async function renderNormalAttributes(note) { const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes(); let attrs = note.getAttributes(); @@ -90,6 +99,7 @@ async function renderNormalAttributes(note) { attrs = attrs.filter( attr => !attr.isDefinition() && !attr.isAutoLink + && !HIDDEN_ATTRIBUTES.includes(attr.name) && attr.noteId === note.noteId ); } diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.js index b4f79ba6d7..fefcc047ef 100644 --- a/src/public/app/widgets/attribute_widgets/attribute_detail.js +++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js @@ -194,7 +194,7 @@ const ATTR_HELP = { "appTheme": "marks CSS notes which are full Trilium themes and are thus available in Trilium options.", "cssClass": "value of this label is then added as CSS class to the node representing given note in the tree. This can be useful for advanced theming. Can be used in template notes.", "iconClass": "value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.", - "bookZoomLevel": 'applies only to book note and sets the "zoom level" (how many notes fit on 1 row)', + "pageSize": "number of items per page in note listing", "customRequestHandler": 'see Custom request handler', "customResourceProvider": 'see Custom request handler' }, diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js index 5105c24814..f2cd6521b2 100644 --- a/src/public/app/widgets/note_detail.js +++ b/src/public/app/widgets/note_detail.js @@ -278,7 +278,7 @@ export default class NoteDetailWidget extends TabAwareWidget { const label = attrs.find(attr => attr.type === 'label' - && ['readOnly', 'autoReadOnlyDisabled', 'cssClass', 'bookZoomLevel', 'displayRelations'].includes(attr.name) + && ['readOnly', 'autoReadOnlyDisabled', 'cssClass', 'displayRelations'].includes(attr.name) && attr.isAffecting(this.note)); const relation = attrs.find(attr => diff --git a/src/routes/api/clipper.js b/src/routes/api/clipper.js index 324b7c5bb1..13b7a44962 100644 --- a/src/routes/api/clipper.js +++ b/src/routes/api/clipper.js @@ -106,7 +106,7 @@ function processContent(images, note, content) { for (const {src, dataUrl, imageId} of images) { const filename = path.basename(src); - if (!dataUrl.startsWith("data:image")) { + if (!dataUrl || !dataUrl.startsWith("data:image")) { log.info("Image could not be recognized as data URL:", dataUrl.substr(0, Math.min(100, dataUrl.length))); continue; } diff --git a/src/services/attributes.js b/src/services/attributes.js index 38832b9586..3a684adbc7 100644 --- a/src/services/attributes.js +++ b/src/services/attributes.js @@ -27,7 +27,6 @@ const BUILTIN_ATTRIBUTES = [ { type: 'label', name: 'run', isDangerous: true }, { type: 'label', name: 'customRequestHandler', isDangerous: true }, { type: 'label', name: 'customResourceProvider', isDangerous: true }, - { type: 'label', name: 'bookZoomLevel', isDangerous: false }, { type: 'label', name: 'widget', isDangerous: true }, { type: 'label', name: 'noteInfoWidgetDisabled' }, { type: 'label', name: 'linkMapWidgetDisabled' }, @@ -41,6 +40,8 @@ const BUILTIN_ATTRIBUTES = [ { type: 'label', name: 'hoistedSearchHome' }, { type: 'label', name: 'sqlConsoleHome' }, { type: 'label', name: 'datePattern' }, + { type: 'label', name: 'pageSize' }, + { type: 'label', name: 'viewType' }, // relation names { type: 'relation', name: 'runOnNoteCreation', isDangerous: true }, diff --git a/src/services/note_cache/similarity.js b/src/services/note_cache/similarity.js index 4fecae088d..f5cf3b17df 100644 --- a/src/services/note_cache/similarity.js +++ b/src/services/note_cache/similarity.js @@ -23,7 +23,6 @@ const IGNORED_ATTR_NAMES = [ "archived", "hidepromotedattributes", "keyboardshortcut", - "bookzoomlevel", "noteinfowidgetdisabled", "linkmapwidgetdisabled", "noterevisionswidgetdisabled",