diff --git a/CliClient/.gitignore b/CliClient/.gitignore index 26260fc3b..11e6e6b0b 100644 --- a/CliClient/.gitignore +++ b/CliClient/.gitignore @@ -14,4 +14,5 @@ tests/fuzzing -* tests/logs/* tests/cli-integration/ *.mo -*.*~ \ No newline at end of file +*.*~ +tests/sync \ No newline at end of file diff --git a/CliClient/app/app.js b/CliClient/app/app.js index 7e03c6f83..2da2b7966 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -382,8 +382,7 @@ class Application { reg.setLogger(this.logger_); this.dbLogger_.addTarget('file', { path: profileDir + '/log-database.txt' }); - this.dbLogger_.setLevel(Logger.LEVEL_INFO); - //this.dbLogger_.setLevel(initArgs.logLevel); + this.dbLogger_.setLevel(initArgs.logLevel); this.syncLogger_.addTarget('file', { path: profileDir + '/log-sync.txt' }); this.syncLogger_.setLevel(initArgs.logLevel); diff --git a/CliClient/app/fuzzing.js b/CliClient/app/fuzzing.js index c1ddc403a..a0255b49b 100644 --- a/CliClient/app/fuzzing.js +++ b/CliClient/app/fuzzing.js @@ -63,7 +63,7 @@ function randomWord() { function execCommand(client, command, options = {}) { let exePath = 'node ' + joplinAppPath; - let cmd = exePath + ' --update-geolocation-disabled --env dev --profile ' + client.profileDir + ' ' + command; + let cmd = exePath + ' --update-geolocation-disabled --env dev --log-level debug --profile ' + client.profileDir + ' ' + command; logger.info(client.id + ': ' + command); if (options.killAfter) { diff --git a/CliClient/locales/en_GB.po b/CliClient/locales/en_GB.po index b9335d602..2e1b60f22 100644 --- a/CliClient/locales/en_GB.po +++ b/CliClient/locales/en_GB.po @@ -60,7 +60,7 @@ msgstr "" msgid "Synchronizing with directory \"%s\"" msgstr "" -#: /mnt/d/Web/www/joplin/CliClient/app/app.js:422 +#: /mnt/d/Web/www/joplin/CliClient/app/app.js:421 msgid "No notebook is defined. Create one with `mkbook `." msgstr "" @@ -490,16 +490,15 @@ msgstr "" msgid "New notebook" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:189 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:208 msgid "Log" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:194 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:213 msgid "Status" msgstr "" #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:106 -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 msgid "Synchronize" msgstr "" @@ -507,10 +506,6 @@ msgstr "" msgid "Cancel synchronization" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 -msgid "Cancel sync" -msgstr "" - #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/folder.js:73 #, javascript-format msgid "The folder could not be saved: %s" @@ -521,39 +516,43 @@ msgid "" "There is currently no notebook. Create one by clicking on the (+) button." msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:185 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:194 msgid "Untitled" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:201 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:237 msgid "Delete note?" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:232 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:280 msgid "Attach file" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:233 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:281 msgid "Delete note" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to regular note" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to todo" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Hide metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Show metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:409 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:284 +msgid "View location on map" +msgstr "" + +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:435 msgid "Edit" msgstr "" diff --git a/CliClient/locales/fr_FR.po b/CliClient/locales/fr_FR.po index 850ed9511..7a7443f10 100644 --- a/CliClient/locales/fr_FR.po +++ b/CliClient/locales/fr_FR.po @@ -62,7 +62,7 @@ msgstr "Quitter le logiciel." msgid "Synchronizing with directory \"%s\"" msgstr "Synchronisation avec dossier \"%s\"" -#: /mnt/d/Web/www/joplin/CliClient/app/app.js:422 +#: /mnt/d/Web/www/joplin/CliClient/app/app.js:421 msgid "No notebook is defined. Create one with `mkbook `." msgstr "Aucun carnet n'est défini. Créez-en un avec `mkbook `." @@ -526,17 +526,16 @@ msgstr "" msgid "New notebook" msgstr "Supprime le carnet." -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:189 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:208 msgid "Log" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:194 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:213 #, fuzzy msgid "Status" msgstr "Etat : %s." #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:106 -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 msgid "Synchronize" msgstr "" @@ -545,10 +544,6 @@ msgstr "" msgid "Cancel synchronization" msgstr "Commencement de la synchronisation..." -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 -msgid "Cancel sync" -msgstr "" - #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/folder.js:73 #, javascript-format msgid "The folder could not be saved: %s" @@ -559,41 +554,45 @@ msgid "" "There is currently no notebook. Create one by clicking on the (+) button." msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:185 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:194 msgid "Untitled" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:201 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:237 #, fuzzy msgid "Delete note?" msgstr "Supprimer le carnet \"%s\" ?" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:232 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:280 msgid "Attach file" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:233 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:281 #, fuzzy msgid "Delete note" msgstr "Supprime le carnet." -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to regular note" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to todo" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Hide metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Show metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:409 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:284 +msgid "View location on map" +msgstr "" + +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:435 msgid "Edit" msgstr "" diff --git a/CliClient/locales/joplin.pot b/CliClient/locales/joplin.pot index b9335d602..2e1b60f22 100644 --- a/CliClient/locales/joplin.pot +++ b/CliClient/locales/joplin.pot @@ -60,7 +60,7 @@ msgstr "" msgid "Synchronizing with directory \"%s\"" msgstr "" -#: /mnt/d/Web/www/joplin/CliClient/app/app.js:422 +#: /mnt/d/Web/www/joplin/CliClient/app/app.js:421 msgid "No notebook is defined. Create one with `mkbook `." msgstr "" @@ -490,16 +490,15 @@ msgstr "" msgid "New notebook" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:189 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:208 msgid "Log" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:194 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screen-header.js:213 msgid "Status" msgstr "" #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:106 -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 msgid "Synchronize" msgstr "" @@ -507,10 +506,6 @@ msgstr "" msgid "Cancel synchronization" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/side-menu-content.js:133 -msgid "Cancel sync" -msgstr "" - #: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/folder.js:73 #, javascript-format msgid "The folder could not be saved: %s" @@ -521,39 +516,43 @@ msgid "" "There is currently no notebook. Create one by clicking on the (+) button." msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:185 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:194 msgid "Untitled" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:201 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:237 msgid "Delete note?" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:232 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:280 msgid "Attach file" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:233 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:281 msgid "Delete note" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to regular note" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:234 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:282 msgid "Convert to todo" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Hide metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:235 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:283 msgid "Show metadata" msgstr "" -#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:409 +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:284 +msgid "View location on map" +msgstr "" + +#: /mnt/d/Web/www/joplin/ReactNativeClient/lib/components/screens/note.js:435 msgid "Edit" msgstr "" diff --git a/CliClient/tests/synchronizer.js b/CliClient/tests/synchronizer.js index 924baa48c..0f5db435b 100644 --- a/CliClient/tests/synchronizer.js +++ b/CliClient/tests/synchronizer.js @@ -2,7 +2,7 @@ require('source-map-support').install(); require('babel-plugin-transform-runtime'); import { time } from 'lib/time-utils.js'; -import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient } from 'test-utils.js'; +import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId } from 'test-utils.js'; import { Folder } from 'lib/models/folder.js'; import { Note } from 'lib/models/note.js'; import { Tag } from 'lib/models/tag.js'; @@ -40,7 +40,11 @@ async function localItemsSameAsRemote(locals, expect) { expect(!!remote).toBe(true); if (!remote) continue; - expect(remote.updated_time).toBe(dbItem.updated_time); + if (syncTargetId() == Database.enumId('syncTarget', 'filesystem')) { + expect(remote.updated_time).toBe(Math.floor(dbItem.updated_time / 1000) * 1000); + } else { + expect(remote.updated_time).toBe(dbItem.updated_time); + } let remoteContent = await fileApi().get(path); remoteContent = dbItem.type_ == BaseModel.TYPE_NOTE ? await Note.unserialize(remoteContent) : await Folder.unserialize(remoteContent); @@ -240,7 +244,7 @@ describe('Synchronizer', function() { expect(files.length).toBe(1); expect(files[0].path).toBe(Folder.systemPath(folder1)); - let deletedItems = await BaseItem.deletedItems(syncTargetId); + let deletedItems = await BaseItem.deletedItems(syncTargetId()); expect(deletedItems.length).toBe(0); done(); @@ -262,7 +266,7 @@ describe('Synchronizer', function() { await synchronizer().start(); let items = await allItems(); expect(items.length).toBe(1); - let deletedItems = await BaseItem.deletedItems(syncTargetId); + let deletedItems = await BaseItem.deletedItems(syncTargetId()); expect(deletedItems.length).toBe(0); done(); @@ -568,7 +572,7 @@ describe('Synchronizer', function() { await synchronizer().start(); await Note.save({ id: n1.id, is_conflict: 1 }); await Note.delete(n1.id); - const deletedItems = await BaseItem.deletedItems(syncTargetId); + const deletedItems = await BaseItem.deletedItems(syncTargetId()); expect(deletedItems.length).toBe(0); diff --git a/CliClient/tests/test-utils.js b/CliClient/tests/test-utils.js index 0229e7c99..9eae3eff9 100644 --- a/CliClient/tests/test-utils.js +++ b/CliClient/tests/test-utils.js @@ -13,6 +13,7 @@ import { BaseItem } from 'lib/models/base-item.js'; import { Synchronizer } from 'lib/synchronizer.js'; import { FileApi } from 'lib/file-api.js'; import { FileApiDriverMemory } from 'lib/file-api-driver-memory.js'; +import { FileApiDriverLocal } from 'lib/file-api-driver-local.js'; import { FsDriverNode } from '../app/fs-driver-node.js'; import { time } from 'lib/time-utils.js'; @@ -28,6 +29,9 @@ Resource.fsDriver_ = fsDriver; const logDir = __dirname + '/../tests/logs'; fs.mkdirpSync(logDir, 0o755); +const syncTarget = 'filesystem'; +const syncDir = __dirname + '/../tests/sync'; + const logger = new Logger(); logger.addTarget('file', { path: logDir + '/log.txt' }); logger.setLevel(Logger.LEVEL_DEBUG); @@ -41,6 +45,11 @@ BaseItem.loadClass('NoteTag', NoteTag); Setting.setConstant('appId', 'net.cozic.joplin-cli'); Setting.setConstant('appType', 'cli'); +function syncTargetId() { + return JoplinDatabase.enumId('syncTarget', 'filesystem'); + //return JoplinDatabase.enumId('syncTarget', 'memory'); +} + function sleep(n) { return new Promise((resolve, reject) => { setTimeout(() => { @@ -111,7 +120,12 @@ async function setupDatabaseAndSynchronizer(id = null) { synchronizers_[id].setLogger(logger); } - await fileApi().format(); + if (syncTarget == 'filesystem') { + fs.removeSync(syncDir) + fs.mkdirpSync(syncDir, 0o755); + } else { + await fileApi().format(); + } } function db(id = null) { @@ -127,9 +141,17 @@ function synchronizer(id = null) { function fileApi() { if (fileApi_) return fileApi_; - fileApi_ = new FileApi('/root', new FileApiDriverMemory()); - fileApi_.setLogger(logger); - return fileApi_; + if (syncTarget == 'filesystem') { + fs.removeSync(syncDir) + fs.mkdirpSync(syncDir, 0o755); + fileApi_ = new FileApi(syncDir, new FileApiDriverLocal()); + fileApi_.setLogger(logger); + return fileApi_; + } else { + fileApi_ = new FileApi('/root', new FileApiDriverMemory()); + fileApi_.setLogger(logger); + return fileApi_; + } } -export { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient }; \ No newline at end of file +export { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId }; \ No newline at end of file diff --git a/ReactNativeClient/.gitignore b/ReactNativeClient/.gitignore index 10be19751..cc995edae 100644 --- a/ReactNativeClient/.gitignore +++ b/ReactNativeClient/.gitignore @@ -51,3 +51,6 @@ buck-out/ fastlane/report.xml fastlane/Preview.html fastlane/screenshots + +# This is generated: +locales diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index fc0e13421..6caac7ec7 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -90,8 +90,8 @@ android { applicationId "net.cozic.joplin" minSdkVersion 16 targetSdkVersion 22 - versionCode 28 - versionName "0.9.15" + versionCode 29 + versionName "0.9.16" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ReactNativeClient/lib/components/screens/note.js b/ReactNativeClient/lib/components/screens/note.js index 52297358e..e01c0f40b 100644 --- a/ReactNativeClient/lib/components/screens/note.js +++ b/ReactNativeClient/lib/components/screens/note.js @@ -99,53 +99,32 @@ class NoteScreenComponent extends BaseScreenComponent { return !!Object.getOwnPropertyNames(diff).length; } - componentWillMount() { + async componentWillMount() { BackHandler.addEventListener('hardwareBackPress', this.backHandler); + let note = null; + let mode = 'view'; if (!this.props.noteId) { - let note = this.props.itemType == 'todo' ? Note.newTodo(this.props.folderId) : Note.new(this.props.folderId); - this.setState({ - lastSavedNote: Object.assign({}, note), - note: note, - mode: 'edit', - }); - this.refreshNoteMetadata(); + note = this.props.itemType == 'todo' ? Note.newTodo(this.props.folderId) : Note.new(this.props.folderId); + mode = 'edit'; } else { - Note.load(this.props.noteId).then((note) => { - this.setState({ - lastSavedNote: Object.assign({}, note), - note: note, - }); - this.refreshNoteMetadata(); - }); + note = await Note.load(this.props.noteId); } - this.refreshFolder(); + this.setState({ + lastSavedNote: Object.assign({}, note), + note: note, + mode: mode, + folder: await Folder.load(note.parent_id), + }); + + this.refreshNoteMetadata(); } componentWillUnmount() { BackHandler.removeEventListener('hardwareBackPress', this.backHandler); } - async currentFolder() { - let folderId = this.props.folderId; - if (!folderId) { - if (this.state.note && this.state.note.parent_id) folderId = this.state.note.parent_id; - } - - if (!folderId) return Folder.defaultFolder(); - - return Folder.load(folderId); - } - - async refreshFolder(folderId = null) { - if (!folderId) { - this.setState({ folder: await this.currentFolder() }); - } else { - this.setState({ folder: await Folder.load(folderId) }); - } - } - noteComponent_change(propName, propValue) { let note = Object.assign({}, this.state.note); note[propName] = propValue; @@ -448,7 +427,7 @@ class NoteScreenComponent extends BaseScreenComponent { let output = []; for (let i = 0; i < this.props.folders.length; i++) { let f = this.props.folders[i]; - output.push({ label: f.title, value: f.id }); + output.push({ label: f.title + ' ' + f.id, value: f.id }); } return output; } diff --git a/ReactNativeClient/lib/file-api-driver-local.js b/ReactNativeClient/lib/file-api-driver-local.js index 23d68af59..f48b9155c 100644 --- a/ReactNativeClient/lib/file-api-driver-local.js +++ b/ReactNativeClient/lib/file-api-driver-local.js @@ -106,6 +106,8 @@ class FileApiDriverLocal { } } + output = output.concat(deletedItems); + return { hasMore: false, context: null, diff --git a/ReactNativeClient/lib/models/base-item.js b/ReactNativeClient/lib/models/base-item.js index 22abbd979..cd59c300e 100644 --- a/ReactNativeClient/lib/models/base-item.js +++ b/ReactNativeClient/lib/models/base-item.js @@ -73,9 +73,14 @@ class BaseItem extends BaseModel { } // Returns the IDs of the items that have been synced at least once - static async syncedItems(syncTarget) { + static async syncedItemIds(syncTarget) { if (!syncTarget) throw new Error('No syncTarget specified'); - return await this.db().selectAll('SELECT item_id, item_type FROM sync_items WHERE sync_time > 0 AND sync_target = ?', [syncTarget]); + let temp = await this.db().selectAll('SELECT item_id FROM sync_items WHERE sync_time > 0 AND sync_target = ?', [syncTarget]); + let output = []; + for (let i = 0; i < temp.length; i++) { + output.push(temp[i].item_id); + } + return output; } static pathToId(path) { diff --git a/ReactNativeClient/lib/synchronizer.js b/ReactNativeClient/lib/synchronizer.js index 772d8d005..f3aa6883d 100644 --- a/ReactNativeClient/lib/synchronizer.js +++ b/ReactNativeClient/lib/synchronizer.js @@ -105,6 +105,7 @@ class Synchronizer { if (n == 'starting') continue; if (n == 'finished') continue; if (n == 'state') continue; + if (n == 'completedTime') continue; this.logger().info(n + ': ' + (report[n] ? report[n] : '-')); } let folderCount = await Folder.count(); @@ -339,13 +340,14 @@ class Synchronizer { let allIds = null; if (!this.api().supportsDelta()) { - allIds = await BaseItem.syncedItems(syncTargetId); + allIds = await BaseItem.syncedItemIds(syncTargetId); } let listResult = await this.api().delta('', { context: context, itemIds: allIds, }); + let remotes = listResult.items; for (let i = 0; i < remotes.length; i++) { if (this.cancelling()) break; diff --git a/ReactNativeClient/locales/en_GB.json b/ReactNativeClient/locales/en_GB.json deleted file mode 100644 index 416ab98e6..000000000 --- a/ReactNativeClient/locales/en_GB.json +++ /dev/null @@ -1 +0,0 @@ -{"No notebook selected.":"","No notebook has been specified.":"","Usage: --profile ":"","Usage: --env ":"","Usage: --log-level ":"","Unknown flag: %s":"","Command line argument \"%s\" contains both quotes and double-quotes - aborting.":"","Provides help for a given command.":"","Exits the application.":"","Synchronizing with directory \"%s\"":"","No notebook is defined. Create one with `mkbook `.":"","Creates a new command alias which can then be used as a regular command (eg. `alias ll \"ls -l\"`).":"","Displays the given note.":"","Displays the complete information about note.":"","Cannot find \"%s\".":"","Gets or sets a config value. If [value] is not provided, it will show the value of [name]. If neither [name] nor [value] is provided, it will list the current configuration.":"","Duplicates the notes matching to [notebook]. If no notebook is specified the note is duplicated in the current notebook.":"","Edit note.":"","Done editing.":"","No text editor is defined. Please set it using `config editor `":"","No active notebook.":"","Starting to edit note. Close the editor to get back to the prompt.":"","Displays a geolocation URL for the note.":"","Imports an Evernote notebook file (.enex file).":"","Do not ask for confirmation.":"","Folder does not exists: \"%s\". Create it?":"","Imported - %s":"","File \"%s\" will be imported into notebook \"%s\". Continue?":"","Found: %d.":"","Created: %d.":"","Updated: %d.":"","Skipped: %d.":"","Resources: %d.":"","Tagged: %d.":"","Importing notes...":"","Displays the notes in [notebook]. Use `ls /` to display the list of notebooks.":"","Displays only the first top notes.":"","Sorts the item by (eg. title, updated_time, created_time).":"","Reverses the sorting order.":"","Displays only the items of the specific type(s). Can be `n` for notes, `t` for todos, or `nt` for notes and todos (eg. `-tt` would display only the todos, while `-ttd` would display notes and todos.":"","Either \"text\" or \"json\"":"","Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for todos), TITLE":"","Please select a notebook first.":"","Creates a new notebook.":"","Creates a new note.":"","Notes can only be created within a notebook.":"","Moves the notes matching to . If is a note, it will be moved to the notebook . If is a notebook, it will be renamed to .":"","Deletes the items matching .":"","Deletes the items without asking for confirmation.":"","Deletes a notebook.":"","Delete notebook \"%s\"?":"","%d notes match this pattern. Delete them?":"","Searches for the given in all the notes.":"","Sets the property of the given to the given [value].":"","Displays summary about the notes and notebooks.":"","Synchronizes with remote storage.":"","Sync to provided target (defaults to sync.target config value)":"","For \"filesystem\" target only: Path to sync to.":"","Synchronisation is already in progress.":"","Synchronization target: %s":"","Cannot initialize synchronizer.":"","Starting synchronization...":"","Done.":"","Cancelling...":""," can be \"add\", \"remove\" or \"list\" to assign or remove [tag] from [note], or to list the notes associated with [tag]. The command `tag list` can be used to list all the tags.":"","Invalid command: \"%s\"":"","Switches to [notebook] - all further operations will happen within this notebook.":"","Displays version information":"","%s %s (%s)":"","Fatal error:":"","All potential ports are in use - please report the issue at %s":"","The application has been authorised - you may now close this browser tab.":"","The application has been successfully authorised.":"","Please open this URL in your browser to authenticate the application:":"","Created local items: %d.":"","Updated local items: %d.":"","Created remote items: %d.":"","Updated remote items: %d.":"","Deleted local items: %d.":"","Deleted remote items: %d.":"","State: %s.":"","Last error: %s (stacktrace in log).":"","Completed: %s":"","Conflicts":"","A notebook with this title already exists: \"%s\"":"","Notebooks cannot be named \"%s\", which is a reserved title.":"","This note does not have geolocation information.":"","Cannot copy note to \"%s\" notebook":"","Cannot move note to \"%s\" notebook":"","Sync status (synced items / total items)":"","%s: %d/%d":"","Total: %d/%d":"","Conflicted: %d":"","To delete: %d":"","Folders":"","%s: %d notes":"","New todo":"","New note":"","New notebook":"","Log":"","Status":"","Synchronize":"","Cancel synchronization":"","Cancel sync":"","The folder could not be saved: %s":"","There is currently no notebook. Create one by clicking on the (+) button.":"","Untitled":"","Delete note?":"","Attach file":"","Delete note":"","Convert to regular note":"","Convert to todo":"","Hide metadata":"","Show metadata":"","Edit":"","Delete notebook?":"","Delete notebook":"","Edit notebook":"","There are currently no notes. Create one by clicking on the (+) button.":"","Click on the (+) button to create a new note or notebook. Click on the side menu to access your existing notebooks.":"","You currently have no notebook. Create one by clicking on (+) button.":""} \ No newline at end of file diff --git a/ReactNativeClient/locales/fr_FR.json b/ReactNativeClient/locales/fr_FR.json deleted file mode 100644 index ded18c6b3..000000000 --- a/ReactNativeClient/locales/fr_FR.json +++ /dev/null @@ -1 +0,0 @@ -{"No notebook selected.":"Aucun carnet n'est sélectionné.","No notebook has been specified.":"Aucun carnet n'est spécifié.","Usage: --profile ":"Utilisation: --profile ","Usage: --env ":"Utilisation : --env ","Usage: --log-level ":"Utilisation: --log-level ","Unknown flag: %s":"Paramètre inconnu : %s","Command line argument \"%s\" contains both quotes and double-quotes - aborting.":"Paramètre de ligne de command \"%s\" contient à la fois des guillemets simples et doubles - impossible de continuer.","Provides help for a given command.":"Affiche l'aide pour la commande donnée.","Exits the application.":"Quitter le logiciel.","Synchronizing with directory \"%s\"":"Synchronisation avec dossier \"%s\"","No notebook is defined. Create one with `mkbook `.":"Aucun carnet n'est défini. Créez-en un avec `mkbook `.","Creates a new command alias which can then be used as a regular command (eg. `alias ll \"ls -l\"`).":"","Displays the given note.":"Affiche la note.","Displays the complete information about note.":"Affiche tous les détails de la note.","Cannot find \"%s\".":"Impossible de trouver \"%s\".","Gets or sets a config value. If [value] is not provided, it will show the value of [name]. If neither [name] nor [value] is provided, it will list the current configuration.":"Obtient ou modifie une valeur de configuration. Si la [valeur] n'est pas fournie, la valeur de [nom] est affichée. Si ni le [nom] ni la [valeur] ne sont fournies, la configuration complète est affichée.","Duplicates the notes matching to [notebook]. If no notebook is specified the note is duplicated in the current notebook.":"Copie les notes correspondant à [nom] vers [carnet]. Si aucun carnet n'est spécifié, la note est dupliqué sur place.","Edit note.":"Editer la note.","Done editing.":"Edition terminée.","No text editor is defined. Please set it using `config editor `":"Aucun éditeur de texte n'est défini. Veuillez le définir en utilisant la commande `config editor `","No active notebook.":"Aucun carnet actif.","Starting to edit note. Close the editor to get back to the prompt.":"Edition de la note en cours. Fermez l'éditeur de texte pour retourner à l'invite de commande.","Displays a geolocation URL for the note.":"Displays a geolocation URL for the note.","Imports an Evernote notebook file (.enex file).":"Importer un carnet Evernote (fichier .enex).","Do not ask for confirmation.":"Ne pas demander de confirmation.","Folder does not exists: \"%s\". Create it?":"Ce carnet n'existe pas : \"%s\". Le créer ?","Imported - %s":"Importé - %s","File \"%s\" will be imported into notebook \"%s\". Continue?":"Le fichier \"%s\" va être importé dans le carnet \"%s\". Continuer ?","Found: %d.":"Trouvés : %d.","Created: %d.":"Créés : %d.","Updated: %d.":"Mise à jour : %d.","Skipped: %d.":"Ignorés : %d.","Resources: %d.":"Ressources : %d.","Tagged: %d.":"Etiquettes : %d.","Importing notes...":"Importation des notes...","Displays the notes in [notebook]. Use `ls /` to display the list of notebooks.":"Affiche les notes dans le carnet. Utilisez `ls /` pour afficher la liste des carnets.","Displays only the first top notes.":"Affiche uniquement les premières notes.","Sorts the item by (eg. title, updated_time, created_time).":"Trier les notes par (par exemple, title, updated_time, created_time).","Reverses the sorting order.":"Inverser l'ordre.","Displays only the items of the specific type(s). Can be `n` for notes, `t` for todos, or `nt` for notes and todos (eg. `-tt` would display only the todos, while `-ttd` would display notes and todos.":"Affiche uniquement les notes du ou des types spécifiés. Le type peut-être `n` pour les notes, `t` pour les tâches (par exemple, `-tt` affiche uniquement les tâches, tandis que `-ttd` affiche les notes et les tâches).","Either \"text\" or \"json\"":"Soit \"text\" soit \"json\"","Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for todos), TITLE":"Utilise le format de liste longue. Le format est ID, NOMBRE_DE_NOTES (pour les carnets), DATE, TACHE_TERMINE (pour les tâches), TITRE","Please select a notebook first.":"Veuillez sélectionner un carnet d'abord.","Creates a new notebook.":"Créer un carnet.","Creates a new note.":"Créer une note.","Notes can only be created within a notebook.":"Les notes ne peuvent être créées que dans un carnet.","Moves the notes matching to . If is a note, it will be moved to the notebook . If is a notebook, it will be renamed to .":"Déplacer les notes correspondantes à vers . Si est une note, elle sera déplacée vers le carnet . Si est un carnet, il sera renommé .","Deletes the items matching .":"Supprime les objets correspondants à .","Deletes the items without asking for confirmation.":"Supprime les objets sans demander la confirmation.","Deletes a notebook.":"Supprime le carnet.","Delete notebook \"%s\"?":"Supprimer le carnet \"%s\" ?","%d notes match this pattern. Delete them?":"%d notes correspondent à ce motif. Les supprimer ?","Searches for the given in all the notes.":"Chercher le motif dans toutes les notes.","Sets the property of the given to the given [value].":"Assigner la valeur [value] à la propriété de la donnée.","Displays summary about the notes and notebooks.":"Afficher un résumé des notes et carnets.","Synchronizes with remote storage.":"Synchroniser les notes et carnets.","Sync to provided target (defaults to sync.target config value)":"Synchroniser avec la cible donnée (par défaut, la valeur de configuration `sync.target`).","For \"filesystem\" target only: Path to sync to.":"","Synchronisation is already in progress.":"Synchronisation est déjà en cours.","Synchronization target: %s":"Cible de la synchronisation : %s","Cannot initialize synchronizer.":"Impossible d'initialiser le synchroniseur.","Starting synchronization...":"Commencement de la synchronisation...","Done.":"Terminé.","Cancelling...":"Annulation..."," can be \"add\", \"remove\" or \"list\" to assign or remove [tag] from [note], or to list the notes associated with [tag]. The command `tag list` can be used to list all the tags.":" peut être \"add\", \"remove\" ou \"list\" pour assigner ou enlever l'étiquette [tag] de la [note], our pour lister les notes associées avec l'étiquette [tag]. La commande `tag list` peut être utilisée pour lister les étiquettes.","Invalid command: \"%s\"":"Commande invalie : \"%s\"","Switches to [notebook] - all further operations will happen within this notebook.":"Changer de carnet - toutes les opérations à venir se feront dans ce carnet.","Displays version information":"Affiche les informations de version.","%s %s (%s)":"%s %s (%s)","Fatal error:":"Erreur fatale :","All potential ports are in use - please report the issue at %s":"Tous les ports sont en cours d'utilisation. Veuillez signaler ce problème sur %s","The application has been authorised - you may now close this browser tab.":"Le logiciel a été autorisé. Vous pouvez maintenant fermer cet onglet.","The application has been successfully authorised.":"Le logiciel a été autorisé.","Please open this URL in your browser to authenticate the application:":"Please open this URL in your browser to authenticate the application:","Created local items: %d.":"Objets créés localement : %d.","Updated local items: %d.":"Objets mis à jour localement : %d.","Created remote items: %d.":"Objets distants créés : %d.","Updated remote items: %d.":"Objets distants mis à jour : %d.","Deleted local items: %d.":"Objets supprimés localement : %d.","Deleted remote items: %d.":"Objets distants supprimés : %d.","State: %s.":"Etat : %s.","Last error: %s (stacktrace in log).":"Dernière erreur : %s (Plus d'information dans le journal d'erreurs)","Completed: %s":"Terminé : %s","Conflicts":"Conflits","A notebook with this title already exists: \"%s\"":"Un carnet avec ce titre existe déjà : \"%s\"","Notebooks cannot be named \"%s\", which is a reserved title.":"Les carnets ne peuvent être nommés \"%s\" car c'est un nom réservé.","This note does not have geolocation information.":"","Cannot copy note to \"%s\" notebook":"Impossible de copier la note dans le carnet \"%s\"","Cannot move note to \"%s\" notebook":"Impossible de déplacer la note vers le carnet \"%s\"","Sync status (synced items / total items)":"Status de la synchronisation (objets synchro. / total)","%s: %d/%d":"%s: %d/%d","Total: %d/%d":"Total : %d/%d","Conflicted: %d":"Conflits : %d","To delete: %d":"A supprimer : %d","Folders":"Carnets","%s: %d notes":"%s : %d notes","New todo":"","New note":"","New notebook":"New notebook","Log":"","Status":"Status","Synchronize":"","Cancel synchronization":"Cancel synchronization","Cancel sync":"","The folder could not be saved: %s":"","There is currently no notebook. Create one by clicking on the (+) button.":"","Untitled":"","Delete note?":"Delete note?","Attach file":"","Delete note":"Delete note","Convert to regular note":"","Convert to todo":"","Hide metadata":"","Show metadata":"","Edit":"","Delete notebook?":"Delete notebook?","Delete notebook":"Delete notebook","Edit notebook":"Edit notebook","There are currently no notes. Create one by clicking on the (+) button.":"","Click on the (+) button to create a new note or notebook. Click on the side menu to access your existing notebooks.":"","You currently have no notebook. Create one by clicking on (+) button.":""} \ No newline at end of file diff --git a/ReactNativeClient/locales/index.js b/ReactNativeClient/locales/index.js deleted file mode 100644 index 86d824b8a..000000000 --- a/ReactNativeClient/locales/index.js +++ /dev/null @@ -1,4 +0,0 @@ -var locales = {}; -locales['en_GB'] = require('./en_GB.json'); -locales['fr_FR'] = require('./fr_FR.json'); -module.exports = { locales: locales }; \ No newline at end of file diff --git a/ReactNativeClient/locales/index.json b/ReactNativeClient/locales/index.json deleted file mode 100644 index 5209737de..000000000 --- a/ReactNativeClient/locales/index.json +++ /dev/null @@ -1 +0,0 @@ -["en_GB","fr_FR"] \ No newline at end of file