X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a5f5a2ec8ae05ec2ad41dda0cd736dafe6cc669d..e4dd4d0e84d0b14c9e71cd72f45e0099273476f1:/src/components/collection-panel-files/collection-panel-files.tsx diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx index 97cbc8ce..1f7e8603 100644 --- a/src/components/collection-panel-files/collection-panel-files.tsx +++ b/src/components/collection-panel-files/collection-panel-files.tsx @@ -48,7 +48,6 @@ const styles: StyleRulesCallback = (theme: Theme) => ({ wrapper: { display: 'flex', minHeight: '600px', - marginBottom: '1rem', color: 'rgba(0, 0, 0, 0.87)', fontSize: '0.875rem', fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif', @@ -202,7 +201,6 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState const [path, setPath]: any = React.useState([]); const [pathData, setPathData]: any = React.useState({}); const [isLoading, setIsLoading] = React.useState(false); - const [collectionAutofetchEnabled, setCollectionAutofetchEnabled] = React.useState(false); const [leftSearch, setLeftSearch] = React.useState(''); const [rightSearch, setRightSearch] = React.useState(''); @@ -279,13 +277,12 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState } }, [rightKey]); // eslint-disable-line react-hooks/exhaustive-deps + const currentPDH = (collectionPanel.item || {}).portableDataHash; React.useEffect(() => { - const hash = (collectionPanel.item || {}).portableDataHash; - - if (hash && collectionAutofetchEnabled) { + if (currentPDH) { fetchData([leftKey, rightKey], true); } - }, [(collectionPanel.item || {}).portableDataHash]); // eslint-disable-line react-hooks/exhaustive-deps + }, [currentPDH]); // eslint-disable-line react-hooks/exhaustive-deps React.useEffect(() => { if (rightData) { @@ -316,10 +313,6 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState if (id) { onItemMenuOpen(event, item, isWritable); - - if (!collectionAutofetchEnabled) { - setCollectionAutofetchEnabled(true); - } } }, [onItemMenuOpen, isWritable, rightData] // eslint-disable-line react-hooks/exhaustive-deps @@ -446,9 +439,6 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState { - if (!collectionAutofetchEnabled) { - setCollectionAutofetchEnabled(true); - } onOptionsMenuOpen(ev, isWritable); }}> @@ -463,7 +453,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
1 ? classes.searchWrapper : classes.searchWrapperHidden}> - +
{ @@ -490,7 +480,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState data-parent-path={name} className={classNames(classes.row, getActiveClass(name))} key={id}> - {getItemIcon(type, getActiveClass(name))} + {getItemIcon(type, getActiveClass(name))}
{name}
@@ -510,14 +500,16 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
- +
{ isWritable &&
} } - :
No data available
+ :
This collection is empty
}} :
}