camel casing and fixes

This commit is contained in:
azivner 2018-04-04 23:04:31 -04:00
parent cf7a336ac2
commit 2cdcb3af12
10 changed files with 32 additions and 22 deletions

View file

@ -24,7 +24,7 @@ jq '.version = "'$VERSION'"' package.json|sponge package.json
git 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.js
git add services/build.js

View file

@ -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';

View file

@ -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';

View file

@ -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 {};
})());

View file

@ -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);

View file

@ -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;

View file

@ -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
};

View file

@ -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" };

View file

@ -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'];

View file

@ -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));
setInterval(cls.wrap(() => runNotesWithLabel('daily')), 24 * 3600 * 1000);