diff options
| author | bobzel <zzzman@gmail.com> | 2024-10-09 21:55:06 -0400 | 
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-10-09 21:55:06 -0400 | 
| commit | 4864f06dcc6eac232bbb9346c68f831fd6420dae (patch) | |
| tree | 36354417e952c979ceb03e8370f39b6223b964f3 /src/client/views/FilterPanel.tsx | |
| parent | 139a3cb0b3b081c270187e9b4ca281d04ca923bf (diff) | |
| parent | b9fda86731a01ebfc3f21ebdd4eaf43a1c9eccc6 (diff) | |
Merge branch 'master' into ajs-before-executable
Diffstat (limited to 'src/client/views/FilterPanel.tsx')
| -rw-r--r-- | src/client/views/FilterPanel.tsx | 36 | 
1 files changed, 4 insertions, 32 deletions
| diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx index e34b66963..11425e477 100644 --- a/src/client/views/FilterPanel.tsx +++ b/src/client/views/FilterPanel.tsx @@ -1,3 +1,4 @@ +import { IconProp } from '@fortawesome/fontawesome-svg-core';  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';  import { Tooltip } from '@mui/material';  import { action, computed, makeObservable, observable, ObservableMap } from 'mobx'; @@ -12,18 +13,15 @@ import { DocData } from '../../fields/DocSymbols';  import { Id } from '../../fields/FieldSymbols';  import { List } from '../../fields/List';  import { RichTextField } from '../../fields/RichTextField'; -import { DocCast, StrCast } from '../../fields/Types'; -import { Button, CurrentUserUtils } from '../util/CurrentUserUtils'; +import { StrCast } from '../../fields/Types';  import { SearchUtil } from '../util/SearchUtil';  import { SnappingManager } from '../util/SnappingManager';  import { undoable } from '../util/UndoManager';  import { FieldsDropdown } from './FieldsDropdown';  import './FilterPanel.scss';  import { DocumentView } from './nodes/DocumentView'; -import { ButtonType } from './nodes/FontIconBox/FontIconBox';  import { Handle, Tick, TooltipRail, Track } from './nodes/SliderBox-components';  import { ObservableReactComponent } from './ObservableReactComponent'; -import { IconProp } from '@fortawesome/fontawesome-svg-core';  interface HotKeyButtonProps {      hotKey: Doc; @@ -159,6 +157,7 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel  interface filterProps {      Document: Doc; +    addHotKey: (hotKey: string) => void;  }  @observer @@ -357,33 +356,6 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {      };      /** -     * Allows users to add a filter hotkey to the properties panel. Will also update the multitoggle at the top menu and the -     * icontags tht are displayed on the documents themselves -     * @param hotKey tite of the new hotkey -     */ -    addHotkey = (hotKey: string) => { -        const buttons = DocCast(Doc.UserDoc().myContextMenuBtns); -        const filter = DocCast(buttons.Filter); -        const title = hotKey.startsWith('#') ? hotKey.substring(1) : hotKey; - -        const newKey: Button = { -            title, -            icon: 'question', -            toolTip: `Click to toggle the ${title}'s group's visibility`, -            btnType: ButtonType.ToggleButton, -            expertMode: false, -            toolType: '#' + title, -            funcs: {}, -            scripts: { onClick: '{ return handleTags(this.toolType, _readOnly_);}' }, -        }; - -        const newBtn = CurrentUserUtils.setupContextMenuBtn(newKey, filter); -        newBtn.isSystem = newBtn[DocData].isSystem = undefined; - -        Doc.AddToFilterHotKeys(newBtn); -    }; - -    /**       * Renders the newly formed hotkey icon buttons       * @returns the buttons to be rendered       */ @@ -472,7 +444,7 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {                  <div>                      <div className="filterBox-select">                          <div style={{ width: '100%' }}> -                            <FieldsDropdown Document={this.Document} selectFunc={this.addHotkey} showPlaceholder placeholder="add a hotkey" addedFields={['acl_Guest', LinkedTo]} /> +                            <FieldsDropdown Document={this.Document} selectFunc={this._props.addHotKey} showPlaceholder placeholder="add a hotkey" addedFields={['acl_Guest', LinkedTo]} />                          </div>                      </div>                  </div> | 
