From 19f0184da33b5080f301baf78cf8e6f6d113d79a Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 1 Oct 2024 14:03:00 -0400
Subject: fixed some lint errors.  fixed how drawings are added to pdfs.  fixed
 testing for ink in propertiesView.

---
 src/client/views/PropertiesView.tsx | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

(limited to 'src/client/views/PropertiesView.tsx')

diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index fcac4d464..722086aea 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -18,11 +18,12 @@ import { Id } from '../../fields/FieldSymbols';
 import { InkField } from '../../fields/InkField';
 import { List } from '../../fields/List';
 import { ComputedField } from '../../fields/ScriptField';
-import { BoolCast, Cast, DocCast, NumCast, StrCast } from '../../fields/Types';
+import { Cast, DocCast, NumCast, StrCast } from '../../fields/Types';
 import { GetEffectiveAcl, SharingPermissions, normalizeEmail } from '../../fields/util';
 import { CollectionViewType, DocumentType } from '../documents/DocumentTypes';
 import { GroupManager } from '../util/GroupManager';
 import { LinkManager } from '../util/LinkManager';
+import { SettingsManager } from '../util/SettingsManager';
 import { SharingManager } from '../util/SharingManager';
 import { SnappingManager } from '../util/SnappingManager';
 import { Transform } from '../util/Transform';
@@ -30,6 +31,7 @@ import { UndoManager, undoBatch, undoable } from '../util/UndoManager';
 import { EditableView } from './EditableView';
 import { FilterPanel } from './FilterPanel';
 import { InkStrokeProperties } from './InkStrokeProperties';
+import { InkingStroke } from './InkingStroke';
 import { ObservableReactComponent } from './ObservableReactComponent';
 import { PropertiesButtons } from './PropertiesButtons';
 import { PropertiesDocBacklinksSelector } from './PropertiesDocBacklinksSelector';
@@ -41,9 +43,6 @@ import { DocumentView } from './nodes/DocumentView';
 import { StyleProviderFuncType } from './nodes/FieldView';
 import { OpenWhere } from './nodes/OpenWhere';
 import { PresBox, PresEffect, PresEffectDirection } from './nodes/trails';
-import { InkingStroke } from './InkingStroke';
-import { SettingsManager } from '../util/SettingsManager';
-import { MarqueeOptionsMenu } from './collections/collectionFreeForm';
 import { SmartDrawHandler } from './smartdraw/SmartDrawHandler';
 
 interface PropertiesViewProps {
@@ -75,6 +74,10 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
         return 200;
     }
 
+    @computed get containsInkDoc() {
+        return this.containsInk(this.selectedDoc);
+    }
+
     @computed get selectedDoc() {
         return DocumentView.SelectedSchemaDoc() || this.selectedDocumentView?.Document || Doc.ActiveDashboard;
     }
@@ -118,7 +121,6 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
     @observable openSlideOptions: boolean = false;
 
     // For ink groups
-    @observable containsInkDoc: boolean = false;
     @observable inkDoc: Doc | undefined = undefined;
 
     @observable _controlButton: boolean = false;
@@ -1276,19 +1278,16 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
 
     @computed get filtersSubMenu() {
         return (
-            // prettier-ignore
             <PropertiesSection title="Filters" isOpen={this.openFilters} setIsOpen={action(bool => { this.openFilters = bool; })} onDoubleClick={this.CloseAll}>
                 <div className="propertiesView-content filters" style={{ position: 'relative', height: 'auto' }}>
                     <FilterPanel Document={this.selectedDoc ?? Doc.ActiveDashboard!} />
                 </div>
             </PropertiesSection>
-        );
+        ); // prettier-ignore
     }
 
     @computed get inkSubMenu() {
-        this.containsInkDoc = false;
         return (
-            // prettier-ignore
             <>
                 <PropertiesSection title="Appearance" isOpen={this.openAppearance} setIsOpen={bool => { this.openAppearance = bool; }} onDoubleClick={this.CloseAll}>
                     {this.selectedLayoutDoc?.layout_isSvg ? this.appearanceEditor : null}
@@ -1297,7 +1296,7 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
                     {this.transformEditor}
                 </PropertiesSection>
             </>
-        );
+        ); // prettier-ignore
     }
 
     /**
@@ -1306,14 +1305,12 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
      */
     containsInk = (selectedDoc: Doc) => {
         const childDocs: Doc[] = DocListCast(selectedDoc[DocData].data);
-        for (var i = 0; i < childDocs.length; i++) {
+        for (let i = 0; i < childDocs.length; i++) {
             if (DocumentView.getDocumentView(childDocs[i])?.layoutDoc?.layout_isSvg) {
                 this.inkDoc = childDocs[i];
-                this.containsInkDoc = true;
                 return true;
             }
         }
-        this.containsInkDoc = false;
         return false;
     };
 
-- 
cgit v1.2.3-70-g09d2

