mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	camel casing and fixes
This commit is contained in:
		| @@ -24,7 +24,7 @@ jq '.version = "'$VERSION'"' package.json|sponge package.json | |||||||
|  |  | ||||||
| git add 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 | git add services/build.js | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,2 +1,2 @@ | |||||||
| UPDATE labels SET name = 'frontendStartup' WHERE name = 'frontend_startup'; | UPDATE labels SET value = 'frontendStartup' WHERE value = 'frontend_startup'; | ||||||
| UPDATE labels SET name = 'backendStartup' WHERE name = 'backend_startup'; | UPDATE labels SET value = 'backendStartup' WHERE value = 'backend_startup'; | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								db/migrations/0086__camelCase_custom_labels.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								db/migrations/0086__camelCase_custom_labels.sql
									
									
									
									
									
										Normal 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'; | ||||||
| @@ -142,11 +142,11 @@ addTabHandler((async function () { | |||||||
|  |  | ||||||
|     const appInfo = await server.get('app-info'); |     const appInfo = await server.get('app-info'); | ||||||
|  |  | ||||||
|     $appVersion.html(appInfo.app_version); |     $appVersion.html(appInfo.appVersion); | ||||||
|     $dbVersion.html(appInfo.dbVersion); |     $dbVersion.html(appInfo.dbVersion); | ||||||
|     $buildDate.html(appInfo.build_date); |     $buildDate.html(appInfo.buildDate); | ||||||
|     $buildRevision.html(appInfo.build_revision); |     $buildRevision.html(appInfo.buildRevision); | ||||||
|     $buildRevision.attr('href', 'https://github.com/zadam/trilium/commit/' + appInfo.build_revision); |     $buildRevision.attr('href', 'https://github.com/zadam/trilium/commit/' + appInfo.buildRevision); | ||||||
|  |  | ||||||
|     return {}; |     return {}; | ||||||
| })()); | })()); | ||||||
|   | |||||||
| @@ -26,8 +26,8 @@ async function uploadFile(req) { | |||||||
|         mime: file.mimetype |         mime: file.mimetype | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     await labelService.createLabel(note.noteId, "original_file_name", originalName); |     await labelService.createLabel(note.noteId, "originalFileName", originalName); | ||||||
|     await labelService.createLabel(note.noteId, "file_size", size); |     await labelService.createLabel(note.noteId, "fileSize", size); | ||||||
|  |  | ||||||
|     return { |     return { | ||||||
|         noteId: note.noteId |         noteId: note.noteId | ||||||
| @@ -48,7 +48,7 @@ async function downloadFile(req, res) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     const labelMap = await note.getLabelMap(); |     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-Disposition', 'file; filename="' + fileName + '"'); | ||||||
|     res.setHeader('Content-Type', note.mime); |     res.setHeader('Content-Type', note.mime); | ||||||
|   | |||||||
| @@ -54,7 +54,10 @@ async function protectBranch(req) { | |||||||
| } | } | ||||||
|  |  | ||||||
| async function setNoteTypeMime(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); |     const note = await repository.getNote(noteId); | ||||||
|     note.type = type; |     note.type = type; | ||||||
|   | |||||||
| @@ -3,11 +3,11 @@ | |||||||
| const build = require('./build'); | const build = require('./build'); | ||||||
| const packageJson = require('../../package'); | const packageJson = require('../../package'); | ||||||
|  |  | ||||||
| const APP_DB_VERSION = 85; | const APP_DB_VERSION = 86; | ||||||
|  |  | ||||||
| module.exports = { | module.exports = { | ||||||
|     app_version: packageJson.version, |     appVersion: packageJson.version, | ||||||
|     dbVersion: APP_DB_VERSION, |     dbVersion: APP_DB_VERSION, | ||||||
|     build_date: build.build_date, |     buildDate: build.buildDate, | ||||||
|     build_revision: build.build_revision |     buildRevision: build.buildRevision | ||||||
| }; | }; | ||||||
| @@ -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" }; | ||||||
|   | |||||||
| @@ -6,9 +6,9 @@ const labelService = require('./labels'); | |||||||
| const dateUtils = require('./date_utils'); | const dateUtils = require('./date_utils'); | ||||||
|  |  | ||||||
| const CALENDAR_ROOT_LABEL = 'calendarRoot'; | const CALENDAR_ROOT_LABEL = 'calendarRoot'; | ||||||
| const YEAR_LABEL = 'year_note'; | const YEAR_LABEL = 'yearNote'; | ||||||
| const MONTH_LABEL = 'month_note'; | const MONTH_LABEL = 'monthNote'; | ||||||
| const DATE_LABEL = 'date_note'; | const DATE_LABEL = 'dateNote'; | ||||||
|  |  | ||||||
| const DAYS = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; | const DAYS = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; | ||||||
| const MONTHS = ['January','February','March','April','May','June','July','August','September','October','November','December']; | const MONTHS = ['January','February','March','April','May','June','July','August','September','October','November','December']; | ||||||
|   | |||||||
| @@ -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); | ||||||
		Reference in New Issue
	
	Block a user