Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="search-result">
<texera-search-results
[showResourceTypes]="true"
[searchKeywords]="this.filters.getSearchKeywords()"
[searchKeywords]="searchKeywords"
[currentUid]="this.currentUid">
</texera-search-results>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,21 @@ import { map } from "rxjs/operators";
})
export class HubSearchResultComponent implements OnInit, AfterViewInit {
public searchType: "dataset" | "workflow" = "workflow";
public searchKeywords: string[] = [];
currentUid = this.userService.getCurrentUser()?.uid;

private isLogin = false;
private includePublic = true;
private _searchResultsComponent?: SearchResultsComponent;
@ViewChild(SearchResultsComponent) get searchResultsComponent(): SearchResultsComponent {
if (this._searchResultsComponent) {
return this._searchResultsComponent;
}
throw new Error("Property cannot be accessed before it is initialized.");
@ViewChild(SearchResultsComponent) get searchResultsComponent(): SearchResultsComponent | undefined {
return this._searchResultsComponent;
}
set searchResultsComponent(value: SearchResultsComponent) {
this._searchResultsComponent = value;
}
private _filters?: FiltersComponent;
@ViewChild(FiltersComponent) get filters(): FiltersComponent {
if (this._filters) {
return this._filters;
}
throw new Error("Property cannot be accessed before it is initialized.");
@ViewChild(FiltersComponent) get filters(): FiltersComponent | undefined {
return this._filters;
}
set filters(value: FiltersComponent) {
value.masterFilterListChange.pipe(untilDestroyed(this)).subscribe({ next: () => this.search() });
Expand Down Expand Up @@ -106,6 +101,9 @@ export class HubSearchResultComponent implements OnInit, AfterViewInit {
* todo: Integrate the search functions from different interfaces into a single method.
*/
async search(forced: boolean = false): Promise<void> {
if (!this.filters || !this.searchResultsComponent) {
return;
}
const sameList =
this.masterFilterList !== null &&
this.filters.masterFilterList.length === this.masterFilterList.length &&
Expand All @@ -116,6 +114,7 @@ export class HubSearchResultComponent implements OnInit, AfterViewInit {
}
this.lastSortMethod = this.sortMethod;
this.masterFilterList = this.filters.masterFilterList;
this.searchKeywords = this.filters.getSearchKeywords();
let filterParams = this.filters.getSearchFilterParameters();
if (isDefined(this.pid)) {
// force the project id in the search query to be the current pid.
Expand Down
Loading