aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-04-13 11:16:37 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-04-13 11:16:37 -0400
commitd7cb584516619406284134523c0650389fa57d05 (patch)
tree056354df5501f5e743adac122498d8cc0d81b00b /src
parented02920bd50e284e188376b142f494df4e330ac5 (diff)
added something to make search icons active
Diffstat (limited to 'src')
-rw-r--r--src/client/views/search/IconBar.tsx12
-rw-r--r--src/client/views/search/SearchBox.tsx3
2 files changed, 12 insertions, 3 deletions
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<IconBarProps> {
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<SearchProps> {
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<SearchProps> {
<button className="filter-item" style={this._nodeStatus ? { background: "#aaaaa3" } : {}} onClick={this.handleNodeChange}>Nodes</button>
</div>
<div id={`node${this.props.id}`} className="filter-body" style={this._nodeStatus ? { borderTop: "grey 1px solid" } : { borderTop: "0px" }}>
- <IconBar />
+ <IconBar setIcons={(icons: string[]) => this._icons = icons} />
</div>
<div className="filter-key" id={`key${this.props.id}`} style={this._keyStatus ? { borderTop: "grey 1px solid" } : { borderTop: "0px" }}>
<div className="filter-keybar">