Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
camel casing and fixes
azivner2cdcb3af127b
diff --git a/bin/release.sh b/bin/release.shindex 54feb31ee3..5759da04d1 100755--- a/bin/release.sh+++ b/bin/release.sh@@ -24,7 +24,7 @@ jq '.version = "'$VERSION'"' package.json|sponge package.jsongit add package.json-echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js+echo 'module.exports = { buildDate:"'`date --iso-8601=seconds`'", buildRevision: "'`git log -1 --format="%H"`'" };' > services/build.jsgit add services/build.jsdiff --git a/db/migrations/0085__camelCase_run_values.sql b/db/migrations/0085__camelCase_run_values.sqlindex bfe0697e11..8754cef5d5 100644--- a/db/migrations/0085__camelCase_run_values.sql+++ b/db/migrations/0085__camelCase_run_values.sql@@ -1,2 +1,2 @@-UPDATE labels SET name = 'frontendStartup' WHERE name = 'frontend_startup';-UPDATE labels SET name = 'backendStartup' WHERE name = 'backend_startup';+UPDATE labels SET value = 'frontendStartup' WHERE value = 'frontend_startup';+UPDATE labels SET value = 'backendStartup' WHERE value = 'backend_startup';diff --git a/db/migrations/0086__camelCase_custom_labels.sql b/db/migrations/0086__camelCase_custom_labels.sqlnew file mode 100644index 0000000000..a94a72e1e5--- /dev/null+++ b/db/migrations/0086__camelCase_custom_labels.sql@@ -0,0 +1,7 @@+UPDATE labels SET name = 'dateData' WHERE name = 'date_data';+UPDATE labels SET name = 'dateNote' WHERE name = 'date_note';+UPDATE labels SET name = 'fileSize' WHERE name = 'file_size';+UPDATE labels SET name = 'hideInAutocomplete' WHERE name = 'hide_in_autocomplete';+UPDATE labels SET name = 'monthNote' WHERE name = 'month_note';+UPDATE labels SET name = 'originalFileName' WHERE name = 'original_file_name';+UPDATE labels SET name = 'yearNote' WHERE name = 'year_note';diff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.jsindex 01a9255187..92bcc3ead6 100644--- a/src/public/javascripts/dialogs/options.js+++ b/src/public/javascripts/dialogs/options.js@@ -142,11 +142,11 @@ addTabHandler((async function () {const appInfo = await server.get('app-info');- $appVersion.html(appInfo.app_version);+ $appVersion.html(appInfo.appVersion);$dbVersion.html(appInfo.dbVersion);- $buildDate.html(appInfo.build_date);- $buildRevision.html(appInfo.build_revision);- $buildRevision.attr('href', 'https://github.com/zadam/trilium/commit/' + appInfo.build_revision);+ $buildDate.html(appInfo.buildDate);+ $buildRevision.html(appInfo.buildRevision);+ $buildRevision.attr('href', 'https://github.com/zadam/trilium/commit/' + appInfo.buildRevision);return {};})());diff --git a/src/routes/api/file_upload.js b/src/routes/api/file_upload.jsindex a3b978e09f..5b4f40d8c8 100644--- a/src/routes/api/file_upload.js+++ b/src/routes/api/file_upload.js@@ -26,8 +26,8 @@ async function uploadFile(req) {mime: file.mimetype});- await labelService.createLabel(note.noteId, "original_file_name", originalName);- await labelService.createLabel(note.noteId, "file_size", size);+ await labelService.createLabel(note.noteId, "originalFileName", originalName);+ await labelService.createLabel(note.noteId, "fileSize", size);return {noteId: note.noteId@@ -48,7 +48,7 @@ async function downloadFile(req, res) {}const labelMap = await note.getLabelMap();- const fileName = labelMap.original_file_name ? labelMap.original_file_name : note.title;+ const fileName = labelMap.originalFileName || note.title;res.setHeader('Content-Disposition', 'file; filename="' + fileName + '"');res.setHeader('Content-Type', note.mime);diff --git a/src/routes/api/notes.js b/src/routes/api/notes.jsindex d73cc538f7..099a679742 100644--- a/src/routes/api/notes.js+++ b/src/routes/api/notes.js@@ -54,7 +54,10 @@ async function protectBranch(req) {}async function setNoteTypeMime(req) {- const [noteId, type, mime] = req.params;+ // can't use [] destructuring because req.params is not iterable+ const noteId = req.params[0];+ const type = req.params[1];+ const mime = req.params[2];const note = await repository.getNote(noteId);note.type = type;diff --git a/src/services/app_info.js b/src/services/app_info.jsindex 294290e774..6e82989228 100644--- a/src/services/app_info.js+++ b/src/services/app_info.js@@ -3,11 +3,11 @@const build = require('./build');const packageJson = require('../../package');-const APP_DB_VERSION = 85;+const APP_DB_VERSION = 86;module.exports = {- app_version: packageJson.version,+ appVersion: packageJson.version,dbVersion: APP_DB_VERSION,- build_date: build.build_date,- build_revision: build.build_revision+ buildDate: build.buildDate,+ buildRevision: build.buildRevision};\ No newline at end of filediff --git a/src/services/build.js b/src/services/build.jsindex 0c97c844ad..8ae8d02b45 100644--- a/src/services/build.js+++ b/src/services/build.js@@ -1 +1 @@-module.exports = { build_date:"2018-01-17T23:59:03-05:00", build_revision: "651a9fb3272c85d287c16d5a4978464fb7d2490d" };+module.exports = { buildDate:"2018-01-17T23:59:03-05:00", buildRevision: "651a9fb3272c85d287c16d5a4978464fb7d2490d" };diff --git a/src/services/date_notes.js b/src/services/date_notes.jsindex ec1ac8afc4..10356f485c 100644--- a/src/services/date_notes.js+++ b/src/services/date_notes.js@@ -6,9 +6,9 @@ const labelService = require('./labels');const dateUtils = require('./date_utils');const CALENDAR_ROOT_LABEL = 'calendarRoot';-const YEAR_LABEL = 'year_note';-const MONTH_LABEL = 'month_note';-const DATE_LABEL = 'date_note';+const YEAR_LABEL = 'yearNote';+const MONTH_LABEL = 'monthNote';+const DATE_LABEL = 'dateNote';const DAYS = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];const MONTHS = ['January','February','March','April','May','June','July','August','September','October','November','December'];diff --git a/src/services/scheduler.js b/src/services/scheduler.jsindex 8ba1322930..c7ea04cab1 100644--- a/src/services/scheduler.js+++ b/src/services/scheduler.js@@ -19,8 +19,8 @@ async function runNotesWithLabel(runAttrValue) {}}-setTimeout(() => cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);+setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);-setInterval(() => cls.wrap(() => runNotesWithLabel('hourly')), 3600 * 1000);+setInterval(cls.wrap(() => runNotesWithLabel('hourly')), 3600 * 1000);-setInterval(() => cls.wrap(() => runNotesWithLabel('daily'), 24 * 3600 * 1000));\ No newline at end of file+setInterval(cls.wrap(() => runNotesWithLabel('daily')), 24 * 3600 * 1000);\ No newline at end of file