Include code snippets in full-text search (#7)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-10-13 09:25:03 -05:00
parent 28d6986eea
commit 527697b2fc
4 changed files with 21 additions and 8 deletions

View File

@@ -22,7 +22,6 @@
&.node {
.search-icon {
color: var(--noded-background-node);
content: '\f10d';
}
}
@@ -31,6 +30,12 @@
color: var(--noded-background-db);
}
}
&.code {
.search-icon {
color: var(--noded-background-code);
}
}
}
.search-assoc {

View File

@@ -7,11 +7,11 @@ import {Router} from '@angular/router';
export interface SearchResult {
title: string;
short_title: string;
type: 'page' | 'node';
type: 'page' | 'node' | 'code';
id: string;
associated?: {
title: string,
type: 'page' | 'node',
type: 'page',
id: string
};
}
@@ -30,6 +30,7 @@ export class SearchComponent implements OnInit {
node: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
code: 'fa fa-code',
};
constructor(
@@ -68,6 +69,9 @@ export class SearchComponent implements OnInit {
} else if ( result.type === 'node' ) {
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
await this.dismiss();
} else if ( result.type === 'code' ) {
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
await this.dismiss();
}
}