Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "whole word" search option #1229

Merged
merged 25 commits into from
Oct 28, 2021
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5f73ae8
wanted some whitespace
Oct 20, 2021
30ba506
refactor check to use regex instead
Oct 20, 2021
b344672
resolved todo, no need for a change in here I don't think.
Oct 20, 2021
f30eb21
this thing is sensitive...hopefully this naming will help a little
Oct 20, 2021
fc19ec8
refactor sequence a bit for readability (bonus: it's probably more pe…
Oct 20, 2021
f318dc2
refactored filter layout on word list page
Oct 21, 2021
0e06e09
added new "whole-word" checkbox
Oct 21, 2021
11753f3
added whole word awareness to the data service
Oct 21, 2021
2fa43d9
bound whole word option into view
Oct 21, 2021
f716a5f
added wholeWord to querystring for deeplinking
Oct 25, 2021
0b5e07a
logic to show reset will not change because of wholeWord
Oct 25, 2021
29202cd
cleared wholeWord on reset
Oct 25, 2021
62abaa3
added wholeWord to options indicator logic
Oct 25, 2021
fd6f0a3
wired up returnToList and made entry view aware of wholeWord option
Oct 25, 2021
d9e2369
refactored entry view to be consistent with list view filters
Oct 25, 2021
5da9215
removed static analysis hint
Oct 25, 2021
95d902a
removed unused code
Oct 26, 2021
2e4ff24
removed unnecessary comment
Oct 26, 2021
5a23556
removed unused code
Oct 26, 2021
188c84f
corrected console errors when adding a new entry
Oct 26, 2021
88c1892
corrected more console errors when adding a new entry
Oct 26, 2021
5b24804
simplified condition
Oct 26, 2021
6358b46
used regex case-insensitive instead of uppercasing (PR feedback)
Oct 27, 2021
563f246
sanitized regex tokens (PR feedback)
Oct 27, 2021
a7cf2f9
removed extraneous whitepsace (PR feedback)
Oct 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added whole word awareness to the data service
billy clark committed Oct 21, 2021
commit 11753f332982b7442dd9be94728aa723f56756e6
3 changes: 2 additions & 1 deletion src/angular-app/bellows/core/offline/editor-data.service.ts
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ class EntryListModifiers {
};
sortOptions: SortOption[] = [];
sortReverse = false;
wholeWord = false;
filterBy: {
text: string;
option: FilterOption;
@@ -447,7 +448,7 @@ export class EditorDataService {

if (this.entryListModifiers.filterText() !== '') {
const query = this.entryListModifiers.filterText().toUpperCase();
const queryRegex = new RegExp(query);
const queryRegex = new RegExp(this.entryListModifiers.wholeWord ? `\\b${query}\\b` : query);
longrunningprocess marked this conversation as resolved.
Show resolved Hide resolved
let found = false;

this.walkEntry(config.entry, entry, (val, isSemanticDomain) => {