From bede42388ffe0aa462444e722d575f68a753ec0b Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 27 Oct 2019 16:43:47 +0100 Subject: [PATCH 1/8] fixed non-working updater --- app/scripts/comp/launcher/launcher-electron.js | 2 +- release-notes.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/scripts/comp/launcher/launcher-electron.js b/app/scripts/comp/launcher/launcher-electron.js index d6f2ecba..3b0c953f 100644 --- a/app/scripts/comp/launcher/launcher-electron.js +++ b/app/scripts/comp/launcher/launcher-electron.js @@ -196,7 +196,7 @@ const Launcher = { resolveProxy(url, callback) { const window = this.getMainWindow(); const session = window.webContents.session; - session.resolveProxy(url, proxy => { + session.resolveProxy(url).then(proxy => { const match = /^proxy\s+([\w\.]+):(\d+)+\s*/i.exec(proxy); proxy = match && match[1] ? { host: match[1], port: +match[2] } : null; callback(proxy); diff --git a/release-notes.md b/release-notes.md index 5fffdba6..8f693b05 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,8 @@ Release notes ------------- +##### v1.12.2 (TBD) +`-` fixed non-working updater + ##### v1.12.1 (2019-10-27) `-` fix #1324: duplicated shortcut editor in settings `-` fix #1313: disabled code signing for macOS dmg From 6dc459a64fd7e25b3660f6f349499b640b779d80 Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 09:51:05 +0100 Subject: [PATCH 2/8] readme links --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af5eab35..9957edac 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Timeline: [Release Notes](release-notes.md), [TODO](https://github.com/keeweb/ke On one page: [Features](https://keeweb.info/#features), [FAQ](https://github.com/keeweb/keeweb/wiki/FAQ) Website: [keeweb.info](https://keeweb.info) Twitter: [kee_web](https://twitter.com/kee_web) -Donate: [OpenCollective](https://opencollective.com/keeweb#support) +Donate: [OpenCollective](https://opencollective.com/keeweb#support), [GitHub](https://github.com/sponsors/antelle) # Status @@ -71,6 +71,8 @@ KeeWeb is not free to develop. It takes time, requires paid code signing certifi You can help the project or say "thank you" with this button: [OpenCollective](https://opencollective.com/keeweb#support) +You can also sponsor the developer directly [on GitHub](https://github.com/sponsors/antelle). + Please note: donation does not imply any type of service contract. From c655defe6d6eb233f692e23cc49c31f8508d5783 Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 10:00:46 +0100 Subject: [PATCH 3/8] fix #1336: saving disabled storage option --- app/scripts/views/settings/settings-general-view.js | 2 +- release-notes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/views/settings/settings-general-view.js b/app/scripts/views/settings/settings-general-view.js index 0f8cd660..ba0c23e3 100644 --- a/app/scripts/views/settings/settings-general-view.js +++ b/app/scripts/views/settings/settings-general-view.js @@ -339,7 +339,7 @@ class SettingsGeneralView extends View { const storage = Storage[$(e.target).data('storage')]; if (storage) { storage.setEnabled(e.target.checked); - AppSettingsModel.storage.name = storage.enabled; + AppSettingsModel[storage.name] = storage.enabled; this.$el .find('.settings__general-' + storage.name) .toggleClass('hide', !e.target.checked); diff --git a/release-notes.md b/release-notes.md index 8f693b05..703c88d2 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,6 +2,7 @@ Release notes ------------- ##### v1.12.2 (TBD) `-` fixed non-working updater +`-` fix #1336: saving disabled storage option ##### v1.12.1 (2019-10-27) `-` fix #1324: duplicated shortcut editor in settings From beda8972e87a20b9162d2d4009fc65ca749ce630 Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 10:04:34 +0100 Subject: [PATCH 4/8] fix #1333: item selection in the auto-type pop-up --- app/scripts/views/auto-type/auto-type-select-view.js | 2 +- release-notes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/views/auto-type/auto-type-select-view.js b/app/scripts/views/auto-type/auto-type-select-view.js index 4a5d52eb..8363fd61 100644 --- a/app/scripts/views/auto-type/auto-type-select-view.js +++ b/app/scripts/views/auto-type/auto-type-select-view.js @@ -193,7 +193,7 @@ class AutoTypeSelectView extends View { itemClicked(e) { const itemEl = $(e.target).closest('.at-select__item'); - const optionsClicked = $(e.target).closest('.at-select__item-options'); + const optionsClicked = $(e.target).closest('.at-select__item-options').length; if (optionsClicked) { this.showItemOptions(itemEl, e); diff --git a/release-notes.md b/release-notes.md index 703c88d2..39ae86f8 100644 --- a/release-notes.md +++ b/release-notes.md @@ -3,6 +3,7 @@ Release notes ##### v1.12.2 (TBD) `-` fixed non-working updater `-` fix #1336: saving disabled storage option +`-` fix #1333: item selection in the auto-type pop-up ##### v1.12.1 (2019-10-27) `-` fix #1324: duplicated shortcut editor in settings From 8794b0d37c0a904e88df5244351893e73e6b9151 Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 11:24:33 +0100 Subject: [PATCH 5/8] fix #1337: displaying groups in trash --- app/scripts/auto-type/auto-type-filter.js | 4 +- app/scripts/collections/entry-collection.js | 44 ---------------- .../collections/search-result-collection.js | 52 +++++++++++++++++++ app/scripts/models/app-model.js | 4 +- app/scripts/views/list-view.js | 4 +- release-notes.md | 1 + 6 files changed, 59 insertions(+), 50 deletions(-) create mode 100644 app/scripts/collections/search-result-collection.js diff --git a/app/scripts/auto-type/auto-type-filter.js b/app/scripts/auto-type/auto-type-filter.js index 458d91ad..a2469051 100644 --- a/app/scripts/auto-type/auto-type-filter.js +++ b/app/scripts/auto-type/auto-type-filter.js @@ -1,4 +1,4 @@ -import { EntryCollection } from 'collections/entry-collection'; +import { SearchResultCollection } from 'collections/search-result-collection'; import { Ranking } from 'util/data/ranking'; const urlPartsRegex = /^(\w+:\/\/)?(?:(?:www|wwws|secure)\.)?([^\/]+)\/?(.*)/; @@ -25,7 +25,7 @@ AutoTypeFilter.prototype.getEntries = function() { x[1] === y[1] ? x[0].title.localeCompare(y[0].title) : y[1] - x[1] ); entries = entries.map(p => p[0]); - return new EntryCollection(entries, { comparator: 'none' }); + return new SearchResultCollection(entries, { comparator: 'none' }); }; AutoTypeFilter.prototype.hasWindowInfo = function() { diff --git a/app/scripts/collections/entry-collection.js b/app/scripts/collections/entry-collection.js index a0b68dd3..f48955e0 100644 --- a/app/scripts/collections/entry-collection.js +++ b/app/scripts/collections/entry-collection.js @@ -1,52 +1,8 @@ import { Collection } from 'framework/collection'; import { EntryModel } from 'models/entry-model'; -import { Comparators } from 'util/data/comparators'; class EntryCollection extends Collection { static model = EntryModel; - - comparators = { - 'none': null, - 'title': Comparators.stringComparator('title', true), - '-title': Comparators.stringComparator('title', false), - 'website': Comparators.stringComparator('url', true), - '-website': Comparators.stringComparator('url', false), - 'user': Comparators.stringComparator('user', true), - '-user': Comparators.stringComparator('user', false), - 'created': Comparators.dateComparator('created', true), - '-created': Comparators.dateComparator('created', false), - 'updated': Comparators.dateComparator('updated', true), - '-updated': Comparators.dateComparator('updated', false), - '-attachments': (x, y) => { - return this.attachmentSortVal(x).localeCompare(this.attachmentSortVal(y)); - }, - '-rank': Comparators.rankComparator().bind(this) - }; - - defaultComparator = 'title'; - - entryFilter = null; - - constructor(models, options) { - super(models); - const comparatorName = (options && options.comparator) || this.defaultComparator; - this.comparator = this.comparators[comparatorName]; - } - - sortEntries(comparator, filter) { - this.entryFilter = filter; - this.comparator = this.comparators[comparator] || this.comparators[this.defaultComparator]; - this.sort(); - } - - attachmentSortVal(entry) { - const att = entry.attachments; - let str = att.length ? String.fromCharCode(64 + att.length) : 'Z'; - if (att[0]) { - str += att[0].title; - } - return str; - } } export { EntryCollection }; diff --git a/app/scripts/collections/search-result-collection.js b/app/scripts/collections/search-result-collection.js new file mode 100644 index 00000000..08b5c0fd --- /dev/null +++ b/app/scripts/collections/search-result-collection.js @@ -0,0 +1,52 @@ +import { Collection } from 'framework/collection'; +import { Model } from 'framework/model'; +import { Comparators } from 'util/data/comparators'; + +class SearchResultCollection extends Collection { + static model = Model; + + comparators = { + 'none': null, + 'title': Comparators.stringComparator('title', true), + '-title': Comparators.stringComparator('title', false), + 'website': Comparators.stringComparator('url', true), + '-website': Comparators.stringComparator('url', false), + 'user': Comparators.stringComparator('user', true), + '-user': Comparators.stringComparator('user', false), + 'created': Comparators.dateComparator('created', true), + '-created': Comparators.dateComparator('created', false), + 'updated': Comparators.dateComparator('updated', true), + '-updated': Comparators.dateComparator('updated', false), + '-attachments': (x, y) => { + return this.attachmentSortVal(x).localeCompare(this.attachmentSortVal(y)); + }, + '-rank': Comparators.rankComparator().bind(this) + }; + + defaultComparator = 'title'; + + entryFilter = null; + + constructor(models, options) { + super(models); + const comparatorName = (options && options.comparator) || this.defaultComparator; + this.comparator = this.comparators[comparatorName]; + } + + sortEntries(comparator, filter) { + this.entryFilter = filter; + this.comparator = this.comparators[comparator] || this.comparators[this.defaultComparator]; + this.sort(); + } + + attachmentSortVal(entry) { + const att = entry.attachments; + let str = att.length ? String.fromCharCode(64 + att.length) : 'Z'; + if (att[0]) { + str += att[0].title; + } + return str; + } +} + +export { SearchResultCollection }; diff --git a/app/scripts/models/app-model.js b/app/scripts/models/app-model.js index 939fb7e7..3f90d7e1 100644 --- a/app/scripts/models/app-model.js +++ b/app/scripts/models/app-model.js @@ -1,7 +1,7 @@ import { Events } from 'framework/events'; import { AutoType } from 'auto-type'; import { Storage } from 'storage'; -import { EntryCollection } from 'collections/entry-collection'; +import { SearchResultCollection } from 'collections/search-result-collection'; import { FileCollection } from 'collections/file-collection'; import { FileInfoCollection } from 'collections/file-info-collection'; import { RuntimeInfo } from 'comp/app/runtime-info'; @@ -307,7 +307,7 @@ class AppModel { getEntriesByFilter(filter) { const preparedFilter = this.prepareFilter(filter); - const entries = new EntryCollection(); + const entries = new SearchResultCollection(); this.files.forEach(file => { file.forEachEntry(preparedFilter, entry => entries.push(entry)); }); diff --git a/app/scripts/views/list-view.js b/app/scripts/views/list-view.js index f33ae80e..be42f7bb 100644 --- a/app/scripts/views/list-view.js +++ b/app/scripts/views/list-view.js @@ -1,6 +1,6 @@ import { View } from 'framework/views/view'; import { Events } from 'framework/events'; -import { EntryCollection } from 'collections/entry-collection'; +import { SearchResultCollection } from 'collections/search-result-collection'; import { DragDropInfo } from 'comp/app/drag-drop-info'; import { Alerts } from 'comp/ui/alerts'; import { AppSettingsModel } from 'models/app-settings-model'; @@ -67,7 +67,7 @@ class ListView extends View { this.readTableColumnsEnabled(); - this.items = new EntryCollection(); + this.items = new SearchResultCollection(); } render() { diff --git a/release-notes.md b/release-notes.md index 39ae86f8..555e7fef 100644 --- a/release-notes.md +++ b/release-notes.md @@ -4,6 +4,7 @@ Release notes `-` fixed non-working updater `-` fix #1336: saving disabled storage option `-` fix #1333: item selection in the auto-type pop-up +`-` fix #1337: displaying groups in trash ##### v1.12.1 (2019-10-27) `-` fix #1324: duplicated shortcut editor in settings From d64eb953880de32134c9c01fb914e5339bfd5b5d Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 11:31:08 +0100 Subject: [PATCH 6/8] filtering file info properties --- app/scripts/models/file-info-model.js | 32 +++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/scripts/models/file-info-model.js b/app/scripts/models/file-info-model.js index 0f190f6f..7a3cddb5 100644 --- a/app/scripts/models/file-info-model.js +++ b/app/scripts/models/file-info-model.js @@ -1,18 +1,7 @@ import { Model } from 'framework/model'; +import { pick } from 'util/fn'; -class FileInfoModel extends Model { - constructor(data) { - data = { ...data }; - for (const [key, val] of Object.entries(data)) { - if (/Date$/.test(key)) { - data[key] = val ? new Date(val) : null; - } - } - super(data); - } -} - -FileInfoModel.defineModelProperties({ +const DefaultProperties = { id: '', name: '', storage: null, @@ -28,6 +17,21 @@ FileInfoModel.defineModelProperties({ opts: null, backup: null, fingerprint: null -}); +}; + +class FileInfoModel extends Model { + constructor(data) { + data = { ...data }; + data = pick(data, Object.keys(DefaultProperties)); + for (const [key, val] of Object.entries(data)) { + if (/Date$/.test(key)) { + data[key] = val ? new Date(val) : null; + } + } + super(data); + } +} + +FileInfoModel.defineModelProperties(DefaultProperties); export { FileInfoModel }; From b1e0056a3ae3f61a1463003067eaf52e83e5007f Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 11:31:46 +0100 Subject: [PATCH 7/8] shorter notation --- app/scripts/models/file-info-model.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/scripts/models/file-info-model.js b/app/scripts/models/file-info-model.js index 7a3cddb5..892cce25 100644 --- a/app/scripts/models/file-info-model.js +++ b/app/scripts/models/file-info-model.js @@ -21,8 +21,7 @@ const DefaultProperties = { class FileInfoModel extends Model { constructor(data) { - data = { ...data }; - data = pick(data, Object.keys(DefaultProperties)); + data = pick({ ...data }, Object.keys(DefaultProperties)); for (const [key, val] of Object.entries(data)) { if (/Date$/.test(key)) { data[key] = val ? new Date(val) : null; From 2b6e8c030d574b9108aecb1ccd07006f2bb58ddb Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 3 Nov 2019 12:25:55 +0100 Subject: [PATCH 8/8] bump version --- desktop/package-lock.json | 2 +- desktop/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- release-notes.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 7f60ea12..2f17ca93 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.12.1", + "version": "1.12.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/desktop/package.json b/desktop/package.json index a2c27df9..e2b04d75 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.12.1", + "version": "1.12.2", "description": "Free cross-platform password manager compatible with KeePass", "main": "main.js", "homepage": "https://keeweb.info", diff --git a/package-lock.json b/package-lock.json index 7fe32b5b..2a2c1b39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.12.1", + "version": "1.12.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0f938e84..d8b81fc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.12.1", + "version": "1.12.2", "description": "Free cross-platform password manager compatible with KeePass", "main": "Gruntfile.js", "private": true, diff --git a/release-notes.md b/release-notes.md index 555e7fef..1f96f214 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,6 +1,6 @@ Release notes ------------- -##### v1.12.2 (TBD) +##### v1.12.2 (2019-11-03) `-` fixed non-working updater `-` fix #1336: saving disabled storage option `-` fix #1333: item selection in the auto-type pop-up