Skip to content

Build your personal knowledge base with Trilium Notes

camelCase builtin labels

azivner6f567e3e10b2
diff --git a/db/migrations/0083__camelCase_labels.sql b/db/migrations/0083__camelCase_labels.sql
new file mode 100644
index 0000000000..fa318b6c40
--- /dev/null
+++ b/db/migrations/0083__camelCase_labels.sql
@@ -0,0 +1,7 @@
+UPDATE labels SET name = 'disableVersioning' WHERE name = 'disable_versioning';
+UPDATE labels SET name = 'calendarRoot' WHERE name = 'calendar_root';
+UPDATE labels SET name = 'hideInAutocomplete' WHERE name = 'hide_in_autocomplete';
+UPDATE labels SET name = 'excludeFromExport' WHERE name = 'exclude_from_export';
+UPDATE labels SET name = 'manualTransactionHandling' WHERE name = 'manual_transaction_handling';
+UPDATE labels SET name = 'disableInclusion' WHERE name = 'disable_inclusion';
+UPDATE labels SET name = 'appCss' WHERE name = 'app_css';
\ No newline at end of file
diff --git a/src/routes/api/export.js b/src/routes/api/export.js
index a988e09048..e5cf87aeb4 100644
--- a/src/routes/api/export.js
+++ b/src/routes/api/export.js
@@ -33,7 +33,7 @@ async function exportNoteInner(branchId, directory, pack) {
const metadata = await getMetadata(note);
- if (metadata.labels.find(label => label.name === 'exclude_from_export')) {
+ if (metadata.labels.find(label => label.name === 'excludeFromExport')) {
return;
}
diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js
index 9276582a13..f0e251e15c 100644
--- a/src/routes/api/tree.js
+++ b/src/routes/api/tree.js
@@ -38,7 +38,7 @@ async function getTree() {
FROM
notes
LEFT JOIN labels AS hideInAutocomplete ON hideInAutocomplete.noteId = notes.noteId
- AND hideInAutocomplete.name = 'hide_in_autocomplete'
+ AND hideInAutocomplete.name = 'hideInAutocomplete'
AND hideInAutocomplete.isDeleted = 0
WHERE
notes.isDeleted = 0`));
diff --git a/src/routes/index.js b/src/routes/index.js
index d5157135d5..d31138446b 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -16,7 +16,7 @@ async function index(req, res) {
async function getAppCss() {
let css = '';
- const notes = labelService.getNotesWithLabel('app_css');
+ const notes = labelService.getNotesWithLabel('appCss');
for (const note of await notes) {
css += `/* ${note.noteId} */
diff --git a/src/scripts/Reddit Importer.tar b/src/scripts/Reddit Importer.tar
index 24ff66938f..f501cbb052 100644
Binary files a/src/scripts/Reddit Importer.tar and b/src/scripts/Reddit Importer.tar differ
diff --git a/src/scripts/Weight Tracker.tar b/src/scripts/Weight Tracker.tar
index 2e3b4f44b0..b2346ce36d 100644
Binary files a/src/scripts/Weight Tracker.tar and b/src/scripts/Weight Tracker.tar differ
diff --git a/src/services/app_info.js b/src/services/app_info.js
index f3a6d3ea50..5501db8d8e 100644
--- a/src/services/app_info.js
+++ b/src/services/app_info.js
@@ -3,7 +3,7 @@
const build = require('./build');
const packageJson = require('../../package');
-const APP_DB_VERSION = 81;
+const APP_DB_VERSION = 83;
module.exports = {
app_version: packageJson.version,
diff --git a/src/services/date_notes.js b/src/services/date_notes.js
index 65730cc81f..ec1ac8afc4 100644
--- a/src/services/date_notes.js
+++ b/src/services/date_notes.js
@@ -5,7 +5,7 @@ const noteService = require('./notes');
const labelService = require('./labels');
const dateUtils = require('./date_utils');
-const CALENDAR_ROOT_LABEL = 'calendar_root';
+const CALENDAR_ROOT_LABEL = 'calendarRoot';
const YEAR_LABEL = 'year_note';
const MONTH_LABEL = 'month_note';
const DATE_LABEL = 'date_note';
diff --git a/src/services/labels.js b/src/services/labels.js
index 1a15a03060..97b3c00de7 100644
--- a/src/services/labels.js
+++ b/src/services/labels.js
@@ -5,16 +5,14 @@ const repository = require('./repository');
const Label = require('../entities/label');
const BUILTIN_LABELS = [
- 'frontend_startup',
- 'backend_startup',
- 'disable_versioning',
- 'calendar_root',
- 'hide_in_autocomplete',
- 'exclude_from_export',
+ 'disableVersioning',
+ 'calendarRoot',
+ 'hideInAutocomplete',
+ 'excludeFromExport',
'run',
- 'manual_transaction_handling',
- 'disable_inclusion',
- 'app_css'
+ 'manualTransactionHandling',
+ 'disableInclusion',
+ 'appCss'
];
async function getNoteLabelMap(noteId) {
diff --git a/src/services/notes.js b/src/services/notes.js
index b8e274f829..e602e064c8 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -175,7 +175,7 @@ async function saveNoteRevision(note) {
const msSinceDateCreated = now.getTime() - dateUtils.parseDateTime(note.dateCreated).getTime();
if (note.type !== 'file'
- && labelsMap.disable_versioning !== 'true'
+ && labelsMap.disableVersioning !== 'true'
&& !existingnoteRevisionId
&& msSinceDateCreated >= noteRevisionSnapshotTimeInterval * 1000) {
diff --git a/src/services/script.js b/src/services/script.js
index 51f973eff4..dadb0b17f9 100644
--- a/src/services/script.js
+++ b/src/services/script.js
@@ -23,7 +23,7 @@ async function executeBundle(bundle, startNote) {
const ctx = new ScriptContext(startNote, bundle.allNotes);
- if (await bundle.note.hasLabel('manual_transaction_handling')) {
+ if (await bundle.note.hasLabel('manualTransactionHandling')) {
return await execute(ctx, script, '');
}
else {
@@ -72,7 +72,7 @@ async function getScriptBundle(note, root = true, scriptEnv = null, includedNote
return;
}
- if (!root && await note.hasLabel('disable_inclusion')) {
+ if (!root && await note.hasLabel('disableInclusion')) {
return;
}