From 56568bbb0db34c0129b6a3c8770ce3f889dcbd31 Mon Sep 17 00:00:00 2001
From: IEatChili <nanunguyen99@gmail.com>
Date: Mon, 10 Jun 2024 11:06:02 -0400
Subject: feat: ui changes

---
 src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
index f02cd9d45..b94a22d04 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
@@ -39,7 +39,7 @@ export class MarqueeOptionsMenu extends AntimodeMenu<AntimodeMenuProps> {
                 <IconButton tooltip="Summarize Documents" onPointerDown={this.summarize} icon={<FontAwesomeIcon icon="compress-arrows-alt" />} color={this.userColor} />
                 <IconButton tooltip="Delete Documents" onPointerDown={this.delete} icon={<FontAwesomeIcon icon="trash-alt" />} color={this.userColor} />
                 <IconButton tooltip="Pin selected region" onPointerDown={this.pinWithView} icon={<FontAwesomeIcon icon="map-pin" />} color={this.userColor} />
-                <IconButton tooltip="Classify Images" onPointerDown={this.classifyImages} icon={<FontAwesomeIcon icon="object-group" />} color={this.userColor} />
+                <IconButton tooltip="Classify and Sort Images" onPointerDown={this.classifyImages} icon={<FontAwesomeIcon icon="object-group" />} color={this.userColor} />
             </>
         );
         return this.getElement(buttons);
-- 
cgit v1.2.3-70-g09d2


From d5ae46421b34d688817e059257578906ff2f12a9 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 20 Aug 2024 21:46:56 -0400
Subject: fixing lint errors

---
 .../collectionFreeForm/MarqueeOptionsMenu.tsx            |  4 ++--
 .../views/collections/collectionFreeForm/MarqueeView.tsx | 16 ++++++++++------
 src/server/server_Initialization.ts                      |  9 +++++++++
 3 files changed, 21 insertions(+), 8 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
index b94a22d04..44c916ab9 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
@@ -18,10 +18,10 @@ export class MarqueeOptionsMenu extends AntimodeMenu<AntimodeMenuProps> {
     public showMarquee: () => void = unimplementedFunction;
     public hideMarquee: () => void = unimplementedFunction;
     public pinWithView: (e: KeyboardEvent | React.PointerEvent | undefined) => void = unimplementedFunction;
-    public classifyImages: (e: React.MouseEvent | undefined) => void = unimplementedFunction;
+    public classifyImages: () => void = unimplementedFunction;
     public groupImages: () => void = unimplementedFunction;
     public isShown = () => this._opacity > 0;
-    constructor(props: any) {
+    constructor(props: AntimodeMenuProps) {
         super(props);
         makeObservable(this);
         MarqueeOptionsMenu.Instance = this;
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index 6fee076ee..6cc75aa4b 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -156,6 +156,7 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
         } else if (e.key === 'b' && e.ctrlKey) {
             document.body.focus(); // so that we can access the clipboard without an error
             setTimeout(() =>
+                // eslint-disable-next-line @typescript-eslint/no-explicit-any
                 pasteImageBitmap((data: any, error: any) => {
                     error && console.log(error);
                     data &&
@@ -432,7 +433,7 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
      * Classifies images and assigns the labels as document fields.
      */
     @undoBatch
-    classifyImages = action(async (e: React.MouseEvent | undefined) => {
+    classifyImages = action(async () => {
         const groupButton = DocListCast(Doc.MyLeftSidebarMenu.data).find(d => d.target === Doc.MyImageGrouper);
         if (groupButton) {
             this._selectedDocs = this.marqueeSelect(false, DocumentType.IMG);
@@ -515,13 +516,14 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
 
     @action
     marqueeCommand = (e: KeyboardEvent) => {
-        if (this._commandExecuted || (e as any).propagationIsStopped) {
+        const ee = e as unknown as KeyboardEvent & { propagationIsStopped?: boolean };
+        if (this._commandExecuted || ee.propagationIsStopped) {
             return;
         }
         if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'd' || e.key === 'h') {
             this._commandExecuted = true;
             e.stopPropagation();
-            (e as any).propagationIsStopped = true;
+            ee.propagationIsStopped = true;
             this.delete(e, e.key === 'h');
             e.stopPropagation();
         }
@@ -529,7 +531,7 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
             this._commandExecuted = true;
             e.stopPropagation();
             e.preventDefault();
-            (e as any).propagationIsStopped = true;
+            ee.propagationIsStopped = true;
             if (e.key === 'g') this.collection(e, true);
             if (e.key === 'c' || e.key === 't') this.collection(e);
             if (e.key === 's' || e.key === 'S') this.summary();
@@ -660,8 +662,9 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
      */
     @action
     onDragMovePause = (e: CustomEvent<React.DragEvent>) => {
-        if ((e as any).handlePan || this._props.isAnnotationOverlay) return;
-        (e as any).handlePan = true;
+        const ee = e as CustomEvent<React.DragEvent> & { handlePan?: boolean };
+        if (ee.handlePan || this._props.isAnnotationOverlay) return;
+        ee.handlePan = true;
 
         const bounds = this.MarqueeRef?.getBoundingClientRect();
         if (!this._props.Document._freeform_noAutoPan && !this._props.renderDepth && bounds) {
@@ -682,6 +685,7 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps
             <div
                 className="marqueeView"
                 ref={r => {
+                    // eslint-disable-next-line @typescript-eslint/no-explicit-any
                     r?.addEventListener('dashDragMovePause', this.onDragMovePause as any);
                     this.MarqueeRef = r;
                 }}
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts
index 2190e27c7..8d3afc3ad 100644
--- a/src/server/server_Initialization.ts
+++ b/src/server/server_Initialization.ts
@@ -113,6 +113,7 @@ function registerEmbeddedBrowseRelativePathHandler(server: express.Express) {
     });
 }
 
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
 function proxyServe(req: any, requrl: string, response: any) {
     // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
     const htmlBodyMemoryStream = new (require('memorystream'))();
@@ -137,8 +138,10 @@ function proxyServe(req: any, requrl: string, response: any) {
                     response.send(header?.includes('gzip') ? zlib.gzipSync(htmlText) : htmlText);
                 } else {
                     req.pipe(request(requrl))
+                        // eslint-disable-next-line @typescript-eslint/no-explicit-any
                         .on('error', (e: any) => console.log('requrl ', e))
                         .pipe(response)
+                        // eslint-disable-next-line @typescript-eslint/no-explicit-any
                         .on('error', (e: any) => console.log('response pipe error', e));
                     console.log('EMPTY body:' + req.url);
                 }
@@ -147,14 +150,17 @@ function proxyServe(req: any, requrl: string, response: any) {
             }
         } else {
             req.pipe(htmlBodyMemoryStream)
+                // eslint-disable-next-line @typescript-eslint/no-explicit-any
                 .on('error', (e: any) => console.log('html body memorystream error', e))
                 .pipe(response)
+                // eslint-disable-next-line @typescript-eslint/no-explicit-any
                 .on('error', (e: any) => console.log('html body memory stream response error', e));
         }
     };
     const retrieveHTTPBody = () => {
         // req.headers.cookie = '';
         req.pipe(request(requrl))
+            // eslint-disable-next-line @typescript-eslint/no-explicit-any
             .on('error', (e: any) => {
                 console.log(`CORS url error: ${requrl}`, e);
                 response.send(`<html><body bgcolor="red" link="006666" alink="8B4513" vlink="006666">
@@ -163,6 +169,7 @@ function proxyServe(req: any, requrl: string, response: any) {
                                     <p>${e}</p>
                                 </body></html>`);
             })
+            // eslint-disable-next-line @typescript-eslint/no-explicit-any
             .on('response', (res: any) => {
                 res.headers;
                 const headers = Object.keys(res.headers);
@@ -187,6 +194,7 @@ function proxyServe(req: any, requrl: string, response: any) {
             })
             .on('end', sendModifiedBody)
             .pipe(htmlBodyMemoryStream)
+            // eslint-disable-next-line @typescript-eslint/no-explicit-any
             .on('error', (e: any) => console.log('http body pipe error', e));
     };
     retrieveHTTPBody();
@@ -244,6 +252,7 @@ export default async function InitializeServer(routeSetter: RouteSetter) {
     app.use(whm(compiler));
     app.get(/^\/+$/, (req, res) => res.redirect(req.user ? '/home' : '/login')); // target urls that consist of one or more '/'s with nothing in between
     app.use(express.static(publicDirectory, { setHeaders: res => res.setHeader('Access-Control-Allow-Origin', '*') })); // all urls that start with dash's public directory: /files/  (e.g., /files/images, /files/audio, etc)
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     app.use(cors({ origin: (_origin: any, callback: any) => callback(null, true) }));
     registerAuthenticationRoutes(app); // this adds routes to authenticate a user (login, etc)
     registerCorsProxy(app); // this adds a /corsProxy/ route to allow clients to get to urls that would otherwise be blocked by cors policies
-- 
cgit v1.2.3-70-g09d2

