-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search Function overwritten for Territories ... proof of concept, it …
…works, but now we need also more types of searchable elements
- Loading branch information
1 parent
bab4dbf
commit d21a0ad
Showing
11 changed files
with
844 additions
and
348 deletions.
There are no files selected for viewing
This file contains 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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,11 @@ | ||
export class Search { | ||
|
||
searchText:string = ""; | ||
searchResults:SearchResult[] = []; | ||
} | ||
|
||
export class SearchResult { | ||
searchType:string = ""; | ||
readableText:string = ""; | ||
data:any; | ||
} |
This file contains 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,39 @@ | ||
import { Injectable } from '@angular/core'; | ||
import {Subject} from "rxjs"; | ||
import {Search, SearchResult} from "../domains/Search"; | ||
|
||
/** | ||
* <h3>Search functionality</h3> | ||
* <ul> | ||
* <li>app provides the search textfield and also the search result display</li> | ||
* <li>if user hits CTRL+F the input field is displayed</li> | ||
* <li>every key hit (except ENTER and ESC) is forwarded to the sub components by the search Subject (they subscribe to the search)</li> | ||
* <li>the component performs the search according to the context and returns the search result to this service as a closeSearch</li> | ||
* <li>app component displays the search result</li> | ||
* <li>if user selects a result, app triggers the corresponding event inside the sub component</li> | ||
* </ul> | ||
* <p>All in all, the service provides the 3 subjects for the interaction</p> | ||
*/ | ||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class SharedService { | ||
|
||
search = new Subject<string>(); | ||
searchPerformed = new Subject<Search|undefined>(); | ||
searchResultIdentified = new Subject<SearchResult>(); | ||
|
||
constructor() { } | ||
|
||
getSearchSubject() { | ||
return this.search.asObservable(); | ||
} | ||
|
||
getSearchResultIdentifiedSubject() { | ||
return this.searchResultIdentified.asObservable(); | ||
} | ||
|
||
getSearchPerformed() { | ||
return this.searchPerformed.asObservable(); | ||
} | ||
} |
This file contains 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