-
Notifications
You must be signed in to change notification settings - Fork 13
feat(web worker): more fluent search #160
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
Draft
DanielHabenicht
wants to merge
13
commits into
master
Choose a base branch
from
feat/web-worker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1d36e07
chore(workspace): fix err in file and add settings
DanielHabenicht 2ea5580
chore(angular): update project structure to match the cli
DanielHabenicht 95577d9
wip(web-worker): base functionality implemented
DanielHabenicht 76ad877
test(e2e): fix e2e tests not found
DanielHabenicht f0384eb
test(unit): Fix units tests by updating ColumnIds
DanielHabenicht 27baf4c
fix(sort): fix sorting for webworker
DanielHabenicht b640ac3
chore(docker): fix docker build
DanielHabenicht 5339a3a
test(unit): edit tests according to changes
DanielHabenicht 36deae7
fix(web-worker): harden Web worker
DanielHabenicht 4c42a1d
fix(web-worker): remove not existing function
DanielHabenicht f989434
chore(table): remove unused code
DanielHabenicht 95b73e2
chore(search): refactoring column finding
DanielHabenicht d711b5d
Merge branch 'master' into feat/web-worker
DanielHabenicht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { TableLogic } from 'src/app/modules/table/table-logic'; | ||
| import { Person, PhonebookSortDirection, SearchFilter, TableSort } from 'src/app/shared/models'; | ||
| import { ColumnId } from 'src/app/shared/models/enumerables/ColumnId'; | ||
|
|
||
| export class SearchParams { | ||
| public filterKeyword: string; | ||
| public searchFilters: SearchFilter[]; | ||
| public searchableColumns: ColumnId[]; | ||
| public sort: TableSort | null; | ||
| public data: Person[]; | ||
| } | ||
|
|
||
| export function performSearch(searchParams: SearchParams): Person[] { | ||
| let preResult = searchParams.data; | ||
|
|
||
| // Filtering | ||
| searchParams.searchFilters.forEach(searchFilter => { | ||
| preResult = TableLogic.filter(preResult, searchFilter.filterValue, [searchFilter.filterColumn]); | ||
| }); | ||
|
|
||
| // Searching | ||
| let searchResult: Person[] = TableLogic.filter(preResult, searchParams.filterKeyword, searchParams.searchableColumns); | ||
|
|
||
| // Sorting | ||
| if (searchParams.sort == null || searchParams.sort.direction === PhonebookSortDirection.none) { | ||
| searchResult = TableLogic.rankedSort(searchResult, searchParams.filterKeyword, searchParams.searchableColumns); | ||
| } else { | ||
| searchResult = TableLogic.sort(searchResult, searchParams.sort); | ||
| } | ||
| return searchResult; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.