17585: Fixed eslint warnings
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Sat, 4 Sep 2021 21:12:46 +0000 (23:12 +0200)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Sat, 4 Sep 2021 21:12:46 +0000 (23:12 +0200)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>01~

src/common/service-provider.ts
src/components/collection-panel-files/collection-panel-files.tsx
src/store/collection-panel/collection-panel-action.ts

index 1362de9a7680ab82d5bddd473d3c1d3916b930fd..080916c55c3798d1e7e60507edff42503a9b95b0 100644 (file)
@@ -26,7 +26,7 @@ class ServicesProvider {
 
     public getServices() {
         if (!this.services) {
-            throw "Please check if services have been set in the index.ts before the app is initiated";
+            throw "Please check if services have been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal
         }
         return this.services;
     }
index f5aa124462078fb9ed88a92c4f03f0f32f363d2e..e5b88f2f16f2504766c1b5e597308bec2a5f564d 100644 (file)
@@ -236,7 +236,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
         if (rightKey) {
             fetchData(rightKey);
         }
-    }, [rightKey]);
+    }, [rightKey]); // eslint-disable-line react-hooks/exhaustive-deps
 
     React.useEffect(() => {
         const hash = (collectionPanel.item || {}).portableDataHash;
@@ -244,13 +244,14 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
         if (hash && rightClickUsed) {
             fetchData(rightKey, true);
         }
-    }, [(collectionPanel.item || {}).portableDataHash]);
+    }, [(collectionPanel.item || {}).portableDataHash]); // eslint-disable-line react-hooks/exhaustive-deps
 
     React.useEffect(() => {
         if (rightData) {
-            setCollectionFiles(rightData, false)(dispatch);
+            const filtered = rightData.filter(({ name }) => name.indexOf(rightSearch) > -1);
+            setCollectionFiles(filtered, false)(dispatch);
         }
-    }, [rightData, dispatch]);
+    }, [rightData, dispatch, rightSearch]);
 
     const handleRightClick = React.useCallback(
         (event) => {
@@ -277,7 +278,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
                 onItemMenuOpen(event, item, isWritable);
             }
         },
-        [onItemMenuOpen, isWritable, rightData]
+        [onItemMenuOpen, isWritable, rightData] // eslint-disable-line react-hooks/exhaustive-deps
     );
 
     React.useEffect(() => {
@@ -335,7 +336,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
                 props.onSelectionToggle(event, item);
             }
         },
-        [path, setPath, collectionPanelFiles]
+        [path, setPath, collectionPanelFiles] // eslint-disable-line react-hooks/exhaustive-deps
     );
 
     const getItemIcon = React.useCallback(
@@ -371,7 +372,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
         (ev, isWritable) => {
             props.onOptionsMenuOpen(ev, isWritable);
         },
-        [props.onOptionsMenuOpen]
+        [props.onOptionsMenuOpen] // eslint-disable-line react-hooks/exhaustive-deps
     );
 
     return (
index 7401c64ae3a5c79e1279a5459adee66e0fd08606..ca9542c5b18d447854f7110af6fa40104548da00 100644 (file)
@@ -4,7 +4,6 @@
 
 import { Dispatch } from "redux";
 import {
-    loadCollectionFiles,
     COLLECTION_PANEL_LOAD_FILES_THRESHOLD
 } from "./collection-panel-files/collection-panel-files-actions";
 import { CollectionResource } from 'models/collection';