From d7cb584516619406284134523c0650389fa57d05 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Mon, 13 Apr 2020 11:16:37 -0400 Subject: added something to make search icons active --- src/client/views/search/IconBar.tsx | 12 ++++++++++-- src/client/views/search/SearchBox.tsx | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/search/IconBar.tsx b/src/client/views/search/IconBar.tsx index ec942bf7c..9cf5a9c87 100644 --- a/src/client/views/search/IconBar.tsx +++ b/src/client/views/search/IconBar.tsx @@ -24,8 +24,13 @@ library.add(faChartBar); library.add(faGlobeAsia); library.add(faBan); +export interface IconBarProps { + setIcons: (icons: string[]) => {}; +} + + @observer -export class IconBar extends React.Component { +export class IconBar extends React.Component { public _allIcons: string[] = [DocumentType.AUDIO, DocumentType.COL, DocumentType.IMG, DocumentType.LINK, DocumentType.PDF, DocumentType.RTF, DocumentType.VID, DocumentType.WEB]; @observable private _icons: string[] = this._allIcons; @@ -38,7 +43,10 @@ export class IconBar extends React.Component { @observable public _select: number = 0; @action.bound - updateIcon(newArray: string[]) { this._icons = newArray; } + updateIcon(newArray: string[]) { + this._icons = newArray; + this.props.setIcons?.(this._icons); + } @action.bound getIcons(): string[] { return this._icons; } diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 19a4d558e..0947bff8d 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -318,6 +318,7 @@ export class SearchBox extends React.Component { const types = this.filterTypes; const includeDeleted = this.getDataStatus() ? "" : " AND NOT deleted_b:true"; const includeIcons = this.getDataStatus() ? "" : " AND NOT type_t:fonticonbox"; + // fq: type_t:collection OR {!join from=id to=proto_i}type_t:collection q:text_t:hello return "NOT baseProto_b:true" + includeDeleted + includeIcons + (types ? ` AND (${types.map(type => `({!join from=id to=proto_i}type_t:"${type}" AND NOT type_t:*) OR type_t:"${type}"`).join(" ")})` : ""); } @@ -652,7 +653,7 @@ export class SearchBox extends React.Component {
- + this._icons = icons} />
-- cgit v1.2.3-70-g09d2