From 25d8d43425785038a74acbc9be618b70f48bbba0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 1 Sep 2020 17:43:59 -0400 Subject: fixed search bar getting stuck open. fixed search for fields in full db. --- src/client/util/SearchUtil.ts | 3 ++- src/client/views/collections/CollectionSchemaHeaders.tsx | 2 -- src/client/views/nodes/LabelBox.scss | 1 + src/client/views/search/SearchBox.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index afa8ff575..b34acce27 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -41,7 +41,8 @@ export namespace SearchUtil { const rpquery = Utils.prepend("/dashsearch"); let replacedQuery = query.replace(/type_t:([^ )])/g, (substring, arg) => `{!join from=id to=proto_i}type_t:${arg}`); if (options.onlyAliases) { - replacedQuery = `{!join from=id to=proto_i}DEFAULT:${replacedQuery}`; + const header = query.match(/_[atnb]?:/) ? replacedQuery : "DEFAULT:" + replacedQuery; + replacedQuery = `{!join from=id to=proto_i}${header}`; } const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } }); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx index cecee1de3..94f9d4f92 100644 --- a/src/client/views/collections/CollectionSchemaHeaders.tsx +++ b/src/client/views/collections/CollectionSchemaHeaders.tsx @@ -352,7 +352,6 @@ export class KeysDropdown extends React.Component { // if search term does not already exist as a group type, give option to create new group type if (this._key !== this._searchTerm.slice(0, this._key.length)) { - console.log("little further"); if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) { options.push(
{ updateFilter() { const filters = Cast(this.props.Document._docFilters, listSpec("string")); if (filters === undefined || filters.length === 0 || filters.includes(this._key) === false) { - console.log("PLEASE"); this.props.col.setColor("rgb(241, 239, 235)"); this.closeResultsVisibility = "none"; } diff --git a/src/client/views/nodes/LabelBox.scss b/src/client/views/nodes/LabelBox.scss index b605df262..109a02df4 100644 --- a/src/client/views/nodes/LabelBox.scss +++ b/src/client/views/nodes/LabelBox.scss @@ -8,6 +8,7 @@ } .labelBox-mainButton { + max-width: 100%; width: fit-content; height: max-content; border-radius: inherit; diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index c04b1da10..e6fd64a3c 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -250,7 +250,7 @@ export class SearchBox extends ViewBoxBaseComponent { - this._searchbarOpen = true; + this.open = this._searchbarOpen = true; this.resultsScrolled(); }); } -- cgit v1.2.3-70-g09d2