From: Daniel Kutyła Date: Sat, 4 Sep 2021 21:12:46 +0000 (+0200) Subject: 17585: Fixed eslint warnings X-Git-Tag: 2.3.0~1^2~7 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/87184cd1febea084a96e87d2b94028b6751d4418 17585: Fixed eslint warnings Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła 01~ --- diff --git a/src/common/service-provider.ts b/src/common/service-provider.ts index 1362de9a..080916c5 100644 --- a/src/common/service-provider.ts +++ b/src/common/service-provider.ts @@ -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; } diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx index f5aa1244..e5b88f2f 100644 --- a/src/components/collection-panel-files/collection-panel-files.tsx +++ b/src/components/collection-panel-files/collection-panel-files.tsx @@ -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 ( diff --git a/src/store/collection-panel/collection-panel-action.ts b/src/store/collection-panel/collection-panel-action.ts index 7401c64a..ca9542c5 100644 --- a/src/store/collection-panel/collection-panel-action.ts +++ b/src/store/collection-panel/collection-panel-action.ts @@ -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';