From c8dc7104f8a4923bcfc70dcc5ff5f492666487bd Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Fri, 7 Jun 2024 02:56:22 -0400 Subject: add col button tooltip + row menu icon change --- .../collectionSchema/CollectionSchemaView.tsx | 30 ++++++++++++++-------- .../collections/collectionSchema/SchemaRowBox.tsx | 4 ++- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index ec1341b14..03e7ed5f3 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -1,6 +1,6 @@ /* eslint-disable no-restricted-syntax */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { Popup, PopupTrigger, Type } from 'browndash-components'; +import { IconButton, Popup, PopupTrigger, Size, Type } from 'browndash-components'; import { ObservableMap, action, autorun, computed, makeObservable, observable, observe, runInAction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; @@ -759,7 +759,7 @@ const filteredChildDocs = sortedDocs.filter((doc: Doc) => !this._lentDocs. @action openColumnMenu = (index: number, newCol: boolean) => { this.closeFilterMenu(); - + this._makeNewColumn = false; this._columnMenuIndex = index; this._menuValue = ''; @@ -1061,15 +1061,23 @@ const filteredChildDocs = sortedDocs.filter((doc: Doc) => !this._lentDocs. }}>
- this.addColumn()} icon="plus" />} //here - trigger={PopupTrigger.CLICK} - type={Type.TERT} - isOpen={this._columnMenuIndex !== -1 ? false : undefined} - popup={this.renderKeysMenu} + } + size={Size.XSMALL} + color={'black'} + onPointerDown={e => + setupMoveUpEvents( + this, + e, + returnFalse, + emptyFunction, + undoable(clickEv => { + clickEv.stopPropagation(); + this.addColumn() + }, 'add key to schema') + ) + } />
{this.columnKeys.map((key, index) => ( diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx index 8cac302ce..099670022 100644 --- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx +++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx @@ -20,6 +20,7 @@ import './CollectionSchemaView.scss'; import { SchemaTableCell } from './SchemaTableCell'; import { ContextMenu } from '../../ContextMenu'; import { CollectionFreeFormView } from '../collectionFreeForm'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; interface SchemaRowBoxProps extends FieldViewProps { rowIndex: number; @@ -113,8 +114,9 @@ export class SchemaRowBox extends ViewBoxBaseComponent() { }}> } + icon={ } size={Size.XSMALL} + color={'black'} onPointerDown={e => setupMoveUpEvents( this, -- cgit v1.2.3-70-g09d2