From 3e6f1e6e2388bcab53c4ee7d680fa6504e82f74d Mon Sep 17 00:00:00 2001 From: Monika Date: Thu, 20 Jun 2019 12:56:46 -0400 Subject: collections almost theree --- src/client/views/search/CheckBox.scss | 13 +++++++++---- src/client/views/search/SearchBox.tsx | 31 ++++++++++--------------------- 2 files changed, 19 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/client/views/search/CheckBox.scss b/src/client/views/search/CheckBox.scss index 3f1126948..582d24e72 100644 --- a/src/client/views/search/CheckBox.scss +++ b/src/client/views/search/CheckBox.scss @@ -20,6 +20,15 @@ border-style: solid; border-color: $alt-accent; border-width: 2px; + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + } + + .check-container:hover ~ .check-box { + background-color: $intermediate-color; + } .check-container { @@ -29,10 +38,6 @@ z-index: 1000; } - .box:hover { - background-color: $intermediate-color; - } - .checkmark { z-index: 1000; position: absolute; diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 546d58356..4ebd9c5e4 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { observer } from 'mobx-react'; import { observable, action, runInAction } from 'mobx'; import "./SearchBox.scss"; -import { faSearch, faFilePdf, faFilm, faImage, faObjectGroup, faStickyNote, faMusic, faLink, faChartBar, faGlobeAsia, faBan, faThList } from '@fortawesome/free-solid-svg-icons'; +import { faSearch, faFilePdf, faFilm, faImage, faObjectGroup, faStickyNote, faMusic, faLink, faChartBar, faGlobeAsia, faBan, faThList, faWineGlassAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { library } from '@fortawesome/fontawesome-svg-core'; import * as rp from 'request-promise'; @@ -216,30 +216,19 @@ export class SearchBox extends React.Component { addCollectionFilter(query: string): string { let collections: Doc[] = this.getCurCollections(); - console.log("collections", collections) - let finalQuery: string = ""; let oldWords = query.split(" "); - let newWords: string[] = []; - oldWords.forEach(word => { - collections.forEach(doc => { - let proto = doc.proto; - let protoId = (proto || doc)[Id]; - // console.log(StrCast(doc.title), protoId); - let colString: string = "+{!join from=data_l to=id}id:" + protoId + " "; - //{!join from=data_l to=id}id:{collectionProtoId} - let newWrd: string = colString + word; - // console.log(newWrd); - newWords.push(newWrd); - }); + let collectionString: string[] = []; + collections.forEach(doc => { + let proto = doc.proto; + let protoId = (proto || doc)[Id]; + let colString: string = "{!join from=data_l to=id}id:" + protoId + " "; + collectionString.push(colString); }); - console.log(newWords) - - query = newWords.join(" "); - - return query; - // const protoId = (proto || doc)[Id]; + let finalColString = collectionString.join(" "); + finalColString = finalColString.trim(); + return "+(" + finalColString + ")" + query; } @action -- cgit v1.2.3-70-g09d2