From ee4155a168dadad182719eb55df3459d6a937a45 Mon Sep 17 00:00:00 2001 From: Monika Date: Fri, 28 Jun 2019 16:28:30 -0400 Subject: end of day 6/28 --- src/client/views/search/FilterBox.scss | 55 ++++++++++++++++++++++++++++ src/client/views/search/FilterBox.tsx | 65 ++++++++++++++++++++++++++++++++-- 2 files changed, 117 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/search/FilterBox.scss b/src/client/views/search/FilterBox.scss index 1eb8963d7..4a8632753 100644 --- a/src/client/views/search/FilterBox.scss +++ b/src/client/views/search/FilterBox.scss @@ -105,4 +105,59 @@ border-top-style: solid; padding-top: 10px; } +} + +.active-filters { + position: absolute; + width: 20; + z-index: 1000; + display: flex; + flex-direction: column; + // overflow: visible; + // float: right; + // float: right; + + .active-icon { + &.container { + display: flex; + flex-direction: row-reverse; + height: 50px; + margin-top: 10px; + margin-bottom: 5px; + // position: relative; + width: 100; + } + + &.description { + display: flex; + font-size: 10; + text-align: center; + align-items: center; + justify-content: center; + // position: relative; + height: 50px; + width: 50px; + margin-right: 5px; + opacity: 0; + -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; + } + + &.icon:hover + .description { + opacity: 1; + } + } + + .col-icon { + height: 50px; + width: 50px; + background-color: black; + color: white; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + } } \ No newline at end of file diff --git a/src/client/views/search/FilterBox.tsx b/src/client/views/search/FilterBox.tsx index cc1feeaf7..8faf0a991 100644 --- a/src/client/views/search/FilterBox.tsx +++ b/src/client/views/search/FilterBox.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import { observer } from 'mobx-react'; import { observable, action } from 'mobx'; import "./SearchBox.scss"; -import { faTimes } from '@fortawesome/free-solid-svg-icons'; -import { library} from '@fortawesome/fontawesome-svg-core'; +import { faTimes, faCheckCircle, faObjectGroup } from '@fortawesome/free-solid-svg-icons'; +import { library } from '@fortawesome/fontawesome-svg-core'; import { Doc } from '../../../new_fields/Doc'; import { Id } from '../../../new_fields/FieldSymbols'; import { DocTypes } from '../../documents/Documents'; @@ -19,8 +19,11 @@ import { NaviconButton } from './NaviconButton'; import * as $ from 'jquery'; import "./FilterBox.scss"; import { SearchBox } from './SearchBox'; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; library.add(faTimes); +library.add(faCheckCircle); +library.add(faObjectGroup); export enum Keys { TITLE = "title", @@ -35,12 +38,16 @@ export class FilterBox extends React.Component { public _allIcons: string[] = [DocTypes.AUDIO, DocTypes.COL, DocTypes.HIST, DocTypes.IMG, DocTypes.LINK, DocTypes.PDF, DocTypes.TEXT, DocTypes.VID, DocTypes.WEB]; //if true, any keywords can be used. if false, all keywords are required. + //this also serves as an indicator if the word status filter is applied @observable private _basicWordStatus: boolean = true; @observable private _filterOpen: boolean = false; + //if icons = all icons, then no icon filter is applied @observable private _icons: string[] = this._allIcons; + //if all of these are true, no key filter is applied @observable private _titleFieldStatus: boolean = true; @observable private _authorFieldStatus: boolean = true; @observable private _dataFieldStatus: boolean = true; + //this also serves as an indicator if the collection status filter is applied @observable private _collectionStatus = false; @observable private _collectionSelfStatus = true; @observable private _collectionParentStatus = true; @@ -248,6 +255,40 @@ export class FilterBox extends React.Component { return finalDocs; } + getABCicon() { + return ( + + + + + + ); + } + + getTypeIcon() { + return ( + + + + ); + } + + getKeyIcon() { + return ( + + + + ); + } + + getColIcon() { + return ( +
+ +
+ ); + } + @action.bound openFilter = () => { this._filterOpen = !this._filterOpen; @@ -376,7 +417,25 @@ export class FilterBox extends React.Component { - ) : undefined} + ) : +
+
+
{this.getABCicon()}
+
Required Words Applied
+
+
+
{this.getTypeIcon()}
+
Type Filters Applied
+
+
+
{this.getKeyIcon()}
+
Field Filters Applied
+
+
+
{this.getColIcon()}
+
Collection Filters Active
+
+
} ); } -- cgit v1.2.3-70-g09d2