Restore navigation to search page in demo-shell

- Remove deprecated router component
- searchChanges and new searchSubmit component outputs work as you would expect
- Update tests

Refs #737
This commit is contained in:
Will Abson
2016-09-23 18:07:40 +01:00
parent 79fc3085c0
commit 147af98bda
6 changed files with 85 additions and 24 deletions

View File

@@ -45,6 +45,9 @@ export class AlfrescoSearchControlComponent {
@Output()
searchChange = new EventEmitter();
@Output()
searchSubmit = new EventEmitter();
@Output()
preview = new EventEmitter();
@@ -74,6 +77,10 @@ export class AlfrescoSearchControlComponent {
(value: string) => {
this.autocompleteSearchTerm = value;
this.searchValid = this.searchControl.valid;
this.searchChange.emit({
value: value,
valid: this.searchValid
});
}
);
@@ -98,11 +105,8 @@ export class AlfrescoSearchControlComponent {
* @param event Submit event that was fired
*/
onSearch(event): void {
if (event) {
event.preventDefault();
}
if (this.searchControl.valid) {
this.searchChange.emit({
this.searchSubmit.emit({
value: this.searchTerm
});
this.searchInput.nativeElement.blur();