diff options
author | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-02-13 01:05:33 +0300 |
---|---|---|
committer | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-02-13 01:05:33 +0300 |
commit | d1911cc42ecde95f1471f76040a11743b6414dcf (patch) | |
tree | da4af8c3d61f4643805d038268878efa06fe8946 /src/js/Search | |
parent | f3787825f7d4e79751a87cffb3c551f8dc9fa7e7 (diff) |
Added server browsing functionality
Diffstat (limited to 'src/js/Search')
-rw-r--r-- | src/js/Search/Indexer/FolderIndexer.js | 5 | ||||
-rw-r--r-- | src/js/Search/Indexer/PasswordIndexer.js | 5 | ||||
-rw-r--r-- | src/js/Search/Query/Sort/SortAscending.js | 5 | ||||
-rw-r--r-- | src/js/Search/Query/Sort/SortDescending.js | 8 |
4 files changed, 19 insertions, 4 deletions
diff --git a/src/js/Search/Indexer/FolderIndexer.js b/src/js/Search/Indexer/FolderIndexer.js index dda043c..e911f8b 100644 --- a/src/js/Search/Indexer/FolderIndexer.js +++ b/src/js/Search/Indexer/FolderIndexer.js @@ -30,6 +30,11 @@ export default class FolderIndexer extends AbstractIndexer { this._indexTextFields(folder, index); this._indexFields(folder, index); + let value = folder.getParent(); + if(value && value.length !== 0) { + index.folder.push(value); + } + return index; } }
\ No newline at end of file diff --git a/src/js/Search/Indexer/PasswordIndexer.js b/src/js/Search/Indexer/PasswordIndexer.js index 16f622b..2cce967 100644 --- a/src/js/Search/Indexer/PasswordIndexer.js +++ b/src/js/Search/Indexer/PasswordIndexer.js @@ -55,6 +55,11 @@ export default class PasswordIndexer extends AbstractIndexer { index.password.push(value); } + value = password.getFolder(); + if(value && value.length !== 0) { + index.folder.push(value); + } + let customFields = password.getCustomFields(); for(let customField of customFields) { if(!customField.getValue() || customField.getValue().length === 0) continue; diff --git a/src/js/Search/Query/Sort/SortAscending.js b/src/js/Search/Query/Sort/SortAscending.js index 056e2f7..cea5dca 100644 --- a/src/js/Search/Query/Sort/SortAscending.js +++ b/src/js/Search/Query/Sort/SortAscending.js @@ -4,7 +4,10 @@ export default class SortAscending extends AbstractSort { _compareValues(a, b) { if(a === b) return 0; - if(typeof a === 'string') return a.localeCompare(b, 'kn', {sensitivity: 'base'}); + if(typeof a === 'string') { + if(b === null) return -1; + return a.localeCompare(b, 'kn', {sensitivity: 'base'}); + } return a < b ? -1:1; } }
\ No newline at end of file diff --git a/src/js/Search/Query/Sort/SortDescending.js b/src/js/Search/Query/Sort/SortDescending.js index a3ca0d7..9fa888a 100644 --- a/src/js/Search/Query/Sort/SortDescending.js +++ b/src/js/Search/Query/Sort/SortDescending.js @@ -4,8 +4,10 @@ export default class SortDescending extends AbstractSort { _compareValues(a, b) { if(a === b) return 0; - if(typeof a === 'string') return b.localeCompare(a, 'kn', {sensitivity: 'base'}); - return a < b ? -1:1; + if(typeof a === 'string') { + if(b === null) return 1; + return b.localeCompare(a, 'kn', {sensitivity: 'base'}); + } + return b < a ? -1:1; } - }
\ No newline at end of file |