aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-11 01:56:17 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-11 01:56:17 -0400
commitc2a2b8c119c44b167310485cede0920f313cd40a (patch)
treed70c91fba745ae2d9952e7007d15c659657fb7f1 /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parent74849a5f9307ca64e2bbafa9eaa77822de18102d (diff)
rowmenu info icons
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index a0d3144ce..98a16deea 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -7,7 +7,7 @@ import { CgClose, CgLock, CgLockUnlock, CgMenu } from 'react-icons/cg';
import { FaExternalLinkAlt } from 'react-icons/fa';
import { returnFalse, setupMoveUpEvents } from '../../../../ClientUtils';
import { emptyFunction } from '../../../../Utils';
-import { Doc, DocListCast } from '../../../../fields/Doc';
+import { Doc, DocListCast, FieldResult } from '../../../../fields/Doc';
import { BoolCast } from '../../../../fields/Types';
import { Transform } from '../../../util/Transform';
import { undoable } from '../../../util/UndoManager';
@@ -21,6 +21,7 @@ import { SchemaTableCell } from './SchemaTableCell';
import { ContextMenu } from '../../ContextMenu';
import { CollectionFreeFormView } from '../collectionFreeForm';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { IconProp } from '@fortawesome/fontawesome-svg-core';
interface SchemaRowBoxProps extends FieldViewProps {
rowIndex: number;
@@ -94,6 +95,13 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
return ''
}
+ get menuInfos() {
+ const infos: Array<IconProp> = [];
+ if (this.Document._lockedSchemaEditing) infos.push('lock');
+ if (this.Document._childrenSharedWithSchema) infos.push('star');
+ return infos;
+ }
+
cleanupField = (field: string) => this.schemaView.cleanupComputedField(field)
setCursorIndex = (mouseY: number) => this.schemaView?.setRelCursorIndex(mouseY);
selectedCol = () => this.schemaView._selectedCol;
@@ -113,6 +121,9 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
row && this.schemaView?.addRowRef?.(this.Document, row);
this._ref = row;
}}>
+ <div className="row-menu-infos">
+ {this.menuInfos.map(icn => <FontAwesomeIcon className="row-infos-icon" icon={icn} size='2xs' />)}
+ </div>
<div
className="row-menu"
style={{